High Efficiency Video Coding
|Organization||ITU-T, ISO, IEC|
|Developed by||ITU-T Study Group 16, VCEG, MPEG|
|Type of format||Video coding format|
|Extended to||H.266 (VVC)|
|Standard||H.261, H.262, H.263, H.264, MPEG-1|
High Efficiency Video Coding (HEVC, better known as H265) is a fairly efficient non-free patent-riddled video compression standard developed by the ISO/IEC Moving Picture Experts Group. It is a widely used standard in proprietary products and solutions like IPTV, video on demand and round metallic coasters used to distribute movies through retail stores.
The HEVC format is covered by myriad of patents held by a number of corporations who have a hard time agreeing on anything. The result of this is that there are two patent pools. Anyone who wants to create commercial products capable of encoding or playing HEVC or distribute video encoded in the HEVC format will have to pay royalty fees to both patent pools. The result of the patent mess is that some big players not invested in MPEG and their patent-riddled standards, namely Google, refuse to have anything to do with HEVC. The biggest video distribution platform, Google-controlled YouTube, is using the competing free and open VP9 codec to distribute higher-resolution 1440p and 4K video.
The only web browsers that are capable of playing HEVC video are those found on Android devices and those made by some American fruit company who makes overpriced social media interaction devices. VP9, on the other hand, can be played by every web modern web browser except those made by said American fruit company.
|Browser||H.264/MPEG-4 AVC (MP4)||HEVC (MP4)||VP8 (WebM)||VP9 (WebM)||AV1 (WebM)|
|Chromium||Depends on the build|
(Modern Chromium based versions)
|Only if hardware decoding is available|
|Mozilla Firefox||if ffmpeg supports it|
|Safari (macOS/iOS)||only for WebRTC|
|GNOME Web||if gstreamer codecs are present||if gstreamer codecs are present|
Linux Tools And Compatibility
GNU/Linux distributions do not include tools and libraries capable of playing or encoding HEVC video. This default severe lack of ability to handle HEVC files means that GNU/Linux users are, out of the box, unable to play the majority of the high resolution video files found on local friendly BitTorrent sites.
Most distributions require a user-configured third party repository to be configured in order to play and encode HEVC video. As an example, the FFmpeg library available in the rpmfusion Fedora repository can be used to both decode and encode HEVC video. The FFmpeg library found in Fedora's own repositories can't. mpv and other media players who utilize the FFmpeg library will only be able to play HEVC if such a repository is enabled. The same applies to VLC, the plain "stock" version included in modern GNU/Linux is typically compiled without HEVC support.
Creating HEVC files with ffmpeg
The basic arguments you need to use for good quality using CPU software encoding are:
||crf sets the picture quality target. Higher numbers mean better quality and larger file sizes. |
||Can also be slow, fast, superfast. Medium works well for most use-cases.|
||Enabled more parallel processing than default.|
||Select AAC for audio. You must use AAC audio if you use a MP4 container. You can mix HEVC with Opus and other audio codecs if you use a container like MPV.|
||Sets audio bitrate.|
||ffmpeg refuses to do anything if you don't enable supposedly "experimental" features.|
Combining the above in a script may or may not be useful.
- See also: HOWTO Convert video files
Skylake and newer Intel CPUs with iGPUs and Polaris and newer AMD graphics chips support HEVC hardware encoding (and decoding). This requires several parameters that are completely different from those used for software (CPU) encoding. The important ones for doing hardware video encoding are:
||Selects the first available graphics card as the render device. A rendering device must be defined before any filter graph option (|
||Use HEVC VAAPI as video codec|
||Sets bitrate to variable bitrate targeting 6Mbps.|
You can't use a
You may want, but do not need, a few additional parameters:
||Caps the max bitrate to 6M. Useful if you use |
||Set max audio bitrate to 192k|
The above parameters can be combined into a simple script so you do not have to type them all the time:
The ffmpeg wiki has some VAAPI examples, mostly not related to HEVC, at trac.ffmpeg.org/wiki/Hardware/VAAPI.