Friday, August 25, 2017
Ubuntu FFMPEG H265 Getting Started
Ubuntu FFMPEG H265 Getting Started
High Efficiency Video Coding (HEVC), which is more commonly known as h265, since it is the successor to H.264, has been out for a while now, and ffmpeg added it on the 12th of February 2014. I have had a little bit of practice with it now, and whilst my first reaction was to be blown away by the initial results of the compression (less than 10% initial file size), I have come to realize that video encoding really is a fine art, so this post will be a "dummies" post on getting started with doing a basic conversion with default settings, and being able to play the result. Readers can then delve deeper into mastering the art in an upcoming post.

[ Initial conversion from h264 (bottom) to h265 (top) ]
Installing FFMPEG
Here is how to install FFMPEG on Ubuntu 14.04sudo add-apt-repository ppa:samrog131/ppa -y
sudo apt-get update
sudo apt-get install ffmpeg -y
Conversion Command
This is an incredibly simple conversion command that converts the video to h265 and just copies the audio, all bundlded within a Matroska file.
ffmpeg -i $inputFile -c:v libx265 -c:a copy $outputFile.mkv
Play H265
Unfortunately, the default VLC for Ubuntu 14.04 (2.1.5 Rincewind), does not appear to have h265 support.
sudo apt-add-repository ppa:strukturag/libde265 -y
sudo apt-get update
sudo apt-get install vlc-plugin-libde265 -y
Summary
H265 can produce amazingly small filesizes with a little reduction in quality, or halve the filesize with no detectable change in quality. This could already be having a massive effect on internet based video. As it stands, 1 out of every 3 bits flowing on the internet is video, mostly in the form of Netflix and Porn. Reducing this to 25%-50% means that not only will these files be able to fit more easily onto your mobile devices, but they will be able to stream there a lot more quickly and cheaply, although we will probably just increase resolutions instead.
It did take a lot longer to convert than Im used to but maybe now I can reclaim some space on my BTRFS RAID 10 NFS. I will now keep two copies of each video, a single 480p x264 for streaming to my tablet, and a 1080p or higher copy in x265 for my desktops.
References
- Wikipedia - High Efficiency Video Coding
- Ask Ubuntu - How to install H.265 / HEVC codec on Ubuntu Linux?
download file now