Encoding

To evaluate the compression-efficiency and performance benefits of LCEVC-enhanced encoding with your content there are two primary approaches directly available from V-Nova in addition to using encoders from 3rd parties:

FFmpeg Quick Start

This short guide aims to help you through the simple process of installing the LCEVC enabled FFmpeg and then to perform your first encode.

The LCEVC-enabled FFmpeg can be installed under Linux or Windows. The instructions here are specific to Windows. If running on a Linux environment, please note the small differences as described at the bottom of this page.

1. Putting the software together

The LCEVC-enabled FFmpeg build can be easily assembled. You will have received software in the following packages:

  • FFmpeg: the FFmpeg binaries with support for x264 and x265

  • lcevc: the LCEVC libraries both encoder and decoder libraries

  • base codecs: any additional base codecs requested (if applicable)

To set it all up, simply:

  1. UnZip the FFmpeg binaries for your operating system into a local directory of your choice (or create a new one). This will be your “FFmpeg directory”.

  2. Copy the LCEVC encoder and decoder libraries with their subfolders onto the root FFmpeg directory

  3. Copy any additional base codecs and base codec plug-ins that you may have received from their folder onto the root FFmpeg directory (if applicable).

  4. If running in a docker you may need to install extra dependencies. See the 'Putting the software together' section in the main documentation guide for more details.

2. Encode a stream using LCEVC h264

This release of FFmpeg supports LCEVC with either an x264 or x265 base codec. Additional supported base codecs are available on request from V-Nova.

Most standard FFmpeg command-line options are included, as well as additional options for configuring V-Nova LCEVC.

The following help commands in FFmpeg describe the behaviour of lcevc_<codec>:

.\ffmpeg.exe -help encoder=lcevc_h264 .\ffmpeg.exe -help encoder=lcevc_hevc

An extra command line parameter "eil_params" is used to control the operation of both the enhancement and base codecs. eil_params is a semicolon-separated string of parameters and values that are passed to the LCEVC enhancement layer:

.\ffmpeg.exe -i input.mp4 -c:v lcevc_h264 -base_encoder x264 -eil_params "<param1>=<value1>;<param2>=<value2>;…" output.ts

Further details are provided in the following page: FFmpeg with LCEVC

Certain parameters (e.g., bitrate, GOP length and framerate) are needed by both LCEVC and the base codec it enhances. These parameters are not set through the eil_params string, but use the standard FFmpeg command line options:

-b:v for video bitrate -g for GOP length (suggested default at 2 seconds, frame rate x2) -r for framerate

These values are used to calculate initialisation values for both LCEVC and the base codec.

Suggested default command line for LCEVC x264:

.\ffmpeg.exe -i ${INPUT_PATH} -g 50 -b:v 2100k -c:v lcevc_h264 -base_encoder x264 -r 25 -s 1920x1080 -eil_params "preset=medium;lcevc_tune=vq" ${OUTPUT_NAME}.ts

Suggested default command line for native libx264 if you are conducting comparison tests:

.\ffmpeg.exe -i ${INPUT_PATH} -g 50 -b:v 3100k -c:v libx264 -preset medium -bufsize 6200k -maxrate 3100k -r 25 -s 1920x1080 ${OUTPUT_NAME}.ts

If you are unsure or require any assistance for a ffmpeg command line conversion, please reach out to V-Nova for support.

3. Encode with test LCEVC enhancement layer

The following test can be performed to ensure the decoder / decoded file is correctly working with LCEVC.

N.B. The command should be entered on one long line. It is shown here as multiple lines for clarity, but must be typed on a single line.

.\ffmpeg.exe -i ${INPUT_PATH} -g 50 -b:v 2100k -c:v lcevc_h264 -base_encoder x264 -r 25 -s 1920x1080 -eil_params "preset=medium;lcevc_tune=vq;encoding_debug_residuals=1" ${OUTPUT_NAME}.ts

This test will add moving squares to the LCEVC layer only. Non LCEVC players or decoders will not see these blocks, but a correctly configured LCEVC player will show images like the one below.

N.B. This command must not be used for quality testing. It is simply a tool for functional encoding/ decoding tests.

4. Decoding with FFmpeg

For decoding with FFmpeg for either simple playback or to create uncompressed files to use in video-quality metrics testing, please see the FFmpeg section in the following "Decoding" page.

5. Further information

Further information and more in-depth documentation is available at: https://docs.v-nova.com/v-nova/lcevc/reference-applications/ffmpeg https://docs.v-nova.com/v-nova/lcevc/lcevc-best-practices

6. Using Linux

The commands in this guide are for a windows environment. If running on a Linux environment there are three key differences.

  1. All instances of ‘\’ should be swapped with ‘/’

  2. The binaries must be made executable by using chmod +x ./ffmpeg

  3. A library path must be defined for ffmpeg and ffplay, such as the following: LD_LIBRARY_PATH=. ./ffmpeg -i ${INPUT_PATH}…

Last updated