Encoding hevc

Libav does not provide a native encoder for hevc, but since libav11 wraps x265 and with libav12 it provides support also for kvazaar, Intel MediaSDK, NVidia NVENC and vaapi.

x265

Building x265 support

x265 is a GPL software Libav compiled with it results being GPL as well.

Assuming your systems has x265 installed all you need to do is

./configure --enable-libx265 --enable-gpl

Once it is built and installed you can check for its availability

avconv -codecs | grep hevc
DEV.L. hevc                 HEVC (High Efficiency Video Coding) (encoders: libx265 )

Invocation

Recent avconv provide an automatic codec mapping, thus

avconv -i source -c:v hevc -c:a copy out.mkv

or

avconv -i source -c:v libx265 -c:a copy out.mkv

are equivalent as long x265 is the only hevc encoder present.

Use -c:v libx265 to be sure you are using the right encoder.

Suggested settings

x265 has a large number of options, all of them a through -x265-params using a string compatible with the options separated by the : marker.

Preset and Tune

x265 comes with a batch of default presets and tunings. They normally provide a proper result for the task.

avconv -i source -c:v libx265 -preset slow -c:a copy out.mkv 

The full list of tuning and presets can be checked using the x265 cli.

The presets are ultrafast, superfast, veryfast, faster, fast, medium, slow, slower, veryslow, placebo.

The tunings are psnr, ssim, zero-latency, fast-decode.

Each preset is twice as slow as the previous, tunings and preset can be mixed and matched, e.g. -preset fast -tune zero-latency

Profiles

Profiles enforce a standard, ensuring compatibility with specific targets by restricting the encoding features used. Since the codec is at its early stage none are mapped to the avconv -profile option.

kvazaar

Building kvazaar support

Assuming your systems has x265 installed all you need to do is

./configure --enable-libkvazaar

Once it is built and installed you can check for its availability

avconv -codecs | grep libkvazaar
DEV.L. hevc                 HEVC (High Efficiency Video Coding) (encoders: libkvazaar )

Invocation

Recent avconv provide an automatic codec mapping, thus

avconv -i source -c:v hevc -c:a copy out.mkv

or

avconv -i source -c:v libkvazaar -c:a copy out.mkv

are equivalent as long kvazaar is the only hevc encoder present.

Use -c:v libkvazaar to be sure you are using the right encoder.


CategoryWIP