HEVC and VP9 Codecs: Try them yourself
High efficiency video coding (HEVC) and WebM VP9 are new codec formats designed to support HD and ultra HD streaming and broadcasting. This article explains how to start using HEVC and VP9 software encoders. If you are planning to use these codecs in your application or product, or if you just want to find out more about HEVC and VP9, then this is a good starting point. In this article we provide instructions for getting started with the HM and x265 HEVC encoders and the WebM VP9 encoder.
1 HEVC: HM reference software
The HM software codec is a reference implementation of the HEVC coding standard developed by the Joint Collaborative Team on Video Coding (JCT-VC). It is suitable for experimenting with the various features available in the HEVC coding standard and/or for checking compliance, but is unlikely to be suitable for real-time implementations. Follow these steps to build and run the HM codec:
Step 1: Get the source code
The latest source code can be obtained using SVN as follows:
svn checkout https://hevc.hhi.fraunhofer.de/svn/svn_HEVCSoftware/trunk/
Files will download into a folder called trunk.
Step 2: Build the software
Project files are provided for the following environments:
If you are using Mac or a linux-based machine, we recommend building the release version of the source using the makefile in /trunk/build/linux folder by running these command lines:
sudo make release
For Windows machines, you will need Microsoft Visual Studio to build the solutions.
Depending on the version of the software, choose the relevant project solution in trunk/ build folder and build in release mode.
If everything builds successfully, you should have TAppEncoder and TAppDecoder executable in the /trunk/bin folder.
Step 3: Read the user manual
Detailed documentation is available here:
Step 4: Using the encoder
The HEVC encoder requires three inputs:
- An uncompressed (raw) YUV or Y4M video file,
- A codec configuration file
- A sequence-specific configuration file
Codec configuration files can be found in the folder trunk/cfg. Each configuration file operates the encoder in a specific mode. For example, encoder_intra_main.cfg operates the encoder using only Intra encoding (no motion compensation), with tools
supported by the Main Profile. Key parameters in the .cfg file include:
Sequence specific configuration files are available in folder /trunk/cfg/per-sequence. You should customise one of these files based on the input sequence. Description of the parameters are as follows:
Consider the 4k test sequence Jockey obtained from http://ultravideo.cs.tut.fi/#testsequences. The sequence consists of 345 frames, each with luma resolution of 3840x2160 8-bit samples. The sequence specific configuration file, jockey.cfg will be:
The command line to run the encoder in random access mode:
./TAppEncoder -c encoder_randomaccess.cfg -c jockey.cfg
Note that this will take a considerable length of time. You may wish to first run a test encoding session, for example with FramesToBeEncoded set to 5, to check that everything is working correctly.
Step 5: Decoding / playing the output
The encoder outputs two files: compressed (.bin) file and reconstructed (.yuv) file. The reconstructed file is identical to the output obtained by decoding the .bin file and can be played back using any YUV player, such as GLYUVPlay. The .bin file can be decoded by a compatible HEVC decoder. For example, the GPAC Osmo4 player can decode and play the .bin file if you change the file extension from .bin to .mp4.
2 x265: Standalone encoder for HEVC
x265 is an open source software library for HEVC encoding, developed by a consortium coordinated by MulticoreWare. It is available under the GNU General Public License. The current version (March 2014) provides:
- Full support for Main profile of HEVC including 8-bits per sample, YUV 4:2:0 format
- Limited support for Main 10 profile.
The software can be used as a standalone tool or as a library with FFMPEG. The download and installation instructions are as follows
Step 1: Get the source code and install instructions from:
Step 2: Install x265
MacOS / Linux install instructions:
Windows install instructions:
About the authors
Abharana Bhat specializes in video compression, media streaming and video quality assessment. Her PhD thesis on quality assessment of compressed video included the development of a novel, fully automated video quality metric.
Iain Richardson is the author of “The H.264 Advanced Video Compression Standard”, a widely cited work in the research literature. He has written three further books and over 50 journal and conference papers on image and video compression. He regularly advises companies on video codec technology, video coding patents and mergers/acquisitions in the video coding industry. Professor Richardson leads an internationally renowned image and video coding research team, contributes to the MPEG industry standards group and is sought after as an expert witness and litigation consultant.