We all are very familiar with the very popular video codec x264 used extensively online to play videos on sites like Youtube, Vimeo, Dailymotion and more. Now they have developed a newer codec called x265 that promises superior quality video at a much reduced file size compared to the x264 codec. The latest versions of the popular media player VLC support playing of the videos encoded using this new x265 codec. If you want to encode your existing videos using the x265 codec then you can use the following two methods:
1. Using FFmpeg
FFmpeg is the leading media encoding, recording, playback and streaming library under the open source GPL license. You can use the following FFmpeg command line for encoding videos using the x265 codec:
Here input.mp4 is the source video that you want to encode and the output.mp4 is the output video file that would be encoded using the x265 codec.
The process is extremely slow and will take a longer time if you try to encode a longer duration video. But in the end a smaller size x265 encoded video file is created.
2. Using VideoLAN x265 Encoder
While FFmpeg works perfectly well, there is another command line tool created for the the sole purpose of encoding video files using the x265 codec by the VideoLAN developers (the people who also make the VLC media player). You can give the following command for using this tool:
Here input.mp4 is the source video that you want to encode and the output.mp4 is the output video file that would be encoded using the x265 codec. In this tool, you also have to specify the frame rate and the resolution of the source video for the encoding process to work.
As with the FFmpeg, this tool also may take a longer time if the video file has a considerable long playback time duration. But in several of my attempts, this tool failed to properly encode the files unlike FFmpeg that worked flawlessly all the time.