LCEVC in Chromium

This section describes the V-Nova LCEVC integration into Chromium.

Note: The Chromium build integrated with V-Nova LCEVC is a fork from the Chromium open source project. The integration is currently still in beta and is not aligned with all versions of the main project. Please contact us for more details if you are interested in deploying with your solution.

Chromium is a Google-maintained open-source browser project. LCEVC Chromium is a derived work by V-Nova Ltd, that adds support for playing back streams enhanced with MPEG-5 Part 2 LCEVC using HTML5 video elements, Media Source Extension or Encrypted Media Extensions.

The official project page is https://www.chromium.org/. which provides information about the project, design documents, getting the code, and build guides.

Design Overview

Media playback in Chromium encompasses a large array of technologies, so by necessity, this will provide only a brief outline. Inside the Chromium source media/ directory resides the components for media demuxing, software and hardware video decode, audio output, as well as audio and video rendering. (source)

Specifically, under the playback heading, media/ contains the implementations of components required for HTML media elements and extensions:

The following diagram provides a simplified overview of the media playback pipeline and where LCEVC is integrated.

As seen in the previous figure, the LCEVC integration point receives the encoded image frame (plus the enhancement data) after being demuxed by the FFmpeg demuxer (HTML video element pipeline), chunk demuxer (Media Source Extensions pipeline), and from CDM in the Encrypted Media Extensions pipeline.

The following figure shows the design of the unmodified versus LCEVC integrated video pipeline which can be applied to Chromium in the DemuxerStream object.

Supported formats

The V-Nova LCEVC Chromium integration adds support for;

  • LCEVC H264 in an MP4 container

  • LCEVC VP8 & VP9 in a WEBM container

  • DRM Protected Content

Components

The V-Nova LCEVC Chromium integration affects the media module in the following manner:

  • media/filters/DecoderStream: Receives the encoded data and returns the decoded frame. Modified to pass LCEVC enhancement data to the LCEVC Decoder Integration Layer (DIL) and to use the DIL to generate the final video frame.

  • media/lcevc/LcevcDecoderContext: handles DIL component integration.

Usage

This integration is a fork from the Chromium open source project. The solution provides a way to dynamically load the LCEVC libraries. These libraries should be available in the following manner:

  • Windows: the DLLs must be located in the executable directory or available through the PATH environment path

  • Linux: Add the .so files location to the LD_LIBRARY_PATH environment variable.

This integration detects the input format and adds the enhancement to every video played using the Chromium video pipeline, so no other modification is needed.

Checkout, Build, & Run Chromium

In order to be able to build Chromium in your environment, you will need to follow the guidelines for your OS that can be found here.

Setting up the environment

In Windows, Chromium requires Visual Studio 2017 (>=15.7.2) to build, but VS2019 (>=16.0.0) is preferred and Windows SDK debug tools. Visual Studio can also be used to debug Chromium, and VS2019 is preferred for this as it handles Chromium's large debug information much better. The clang-cl compiler is used but Visual Studio's header files, libraries, and some tools are required. Visual Studio Community Edition should work if its license is appropriate for you. You must install the "Desktop development with C++" component and the "MFC/ATL support" sub-components.

Full details of build prerequisites and instructions for Windows and Linux can be are provided by Chromium project here:

You can then continue preparing your environment by installing the depot_tools. These are tools for working with Chromium development.

Getting the code

Access to the LCEVC Chromium repository can be requested by contacting V-Nova via info@v-nova.com.

The code for the Chromium project can be retrieved by using the fetch tool from depot_tools, as described in

  • https://chromium.googlesource.com/chromium/src/+/main/docs/linux/build_instructions.md#Get-the-code or

  • https://chromium.googlesource.com/chromium/src/+/HEAD/docs/windows_build_instructions.md#Get-the-code.

Once the repository has been fetched, go into the Chromium git repository (in the src sub-directory), add the LCEVC-Chromium git repository as a remote, fetch and checkout its main branch, then sync the dependencies by using the following command:

gclient sync -D --force --reset --with_branch_heads

The binary libraries from the LCEVC SDK should then be copied to media/lcevc_dependencies, and the header files to media/lcevc/includes.

Building

You can create any number of build directories with different configurations. To create a build directory:

gn gen out/Default

  • You only have to run this once for each new build directory.

  • You can replace Default with another name, but it should be a subdirectory of out.

Enabling proprietary codecs and DRM (with Widevine)

In order to include support for H264, you need to enable proprietary codecs. Also, to enable DRM and EME (Encrypted Media Extensions) with Widevine you need to add the following lines in the out/Default/args.gn file

# Set build arguments here. See `gn help buildargs`.

ffmpeg_branding = "Chrome"

proprietary_codecs = true

enable_widevine = true

Building for Production

When building for Production, you should disable DCHECK as it stops Chromium execution when some validations are not met. This DCHECK is usually disabled in release distributions.

To disable DCHECK and create a Release build you should add the following lines in the out/Default/args.gn

is_debug = false

dcheck_always_on = false

Add V-Nova DLLs to the system path in Windows

In order to use the V-Nova DLLs, you need to add this folder to the system path or copy all the DLLs to the chromium/src/out/Default folder.

Add V-Nova libraries to the system path in Linux

In order to use the V-Nova .so files, you need to add this folder to the /usr/lib folder or add the dependency folder to the LD_INCLUDE_PATH.

Build with autoninja

To build chromium, run the following command:

autoninja -C out/Default chrome

or, to produce installer packages:

autoninja -C out/Default chrome/installer/mini_installer

for Windows, or

autoninja -C out/Default chrome/installer/linux:unstable.deb

for Debian-like Linux systems etc.

Supported Operating Systems

  • Windows 10

  • Linux: Ubuntu 18.04, Ubuntu 20.04, Debian 10, Debian 11

Last updated