We're hiring!
*

Open source machine learning for video compression

Marcus Edel avatar

Marcus Edel
September 14, 2022

Share this post:

Over the past few years, different video codecs have been successfully developed, including H.265 and VP9, to meet the needs of various applicationsranging from video conferencing platforms like Zoom to streaming services like YouTube and software like OBS to broadcast to different sites.

The quality of the reconstructed video using these codecs is excellent at medium-to-low bitrates, but it degrades when operating at very low bitrates. While these codecs leverage expert knowledge of human perception and carefully engineered signal processing pipelines, there has been a massive interest in replacing these handcrafted methods with machine learning approaches that learn to encode video data.

Using open source software, Collabora has developed an efficient compression pipeline that enables a face video broadcasting system that achieves the same visual quality as the H.264 standard while only using one-tenth of the bandwidth. In a nutshell, the face video compression algorithms rely on a source frame of the face, a pipeline to extract the important features from a face image, and a generator to reconstruct the face using the extracted and compressed features on the receiving side.

Key takeaways

  • Machine learning model to predict facial landmarks, capturing both facial expressions and overall head poses from a video.
  • We generate speaker-aware talking-head animations based on a single source image and a driving video.
  • The compact landmark representation enables a video conferencing system that achieves the same visual quality as the commercial H.264 standard while only using one-tenth of the bandwidth.

Talking heads problem

Animating expressive talking heads is essential for filmmaking, virtual avatars, video streaming, computer games, and mixed realities. Despite recent advances, generating realistic facial animation with little or no manual labor remains an open challenge in computer graphics. Several key factors contribute to this challenge. Traditionally the generation process needs a lot of compute, making it nontrivial to run it in real-time in a video conference setting. Facial dynamics are difficult to reconstruct using based on a few images.

We present a method that generates expressive talking-head videos from a single facial image and a driving video. The key component of our method is the prediction of the facial landmarks reflecting the facial dynamics. Based on this intermediate representation, our method works with many portrait images in a single unified framework and generalizes well for faces that were not observed during training.

Talking heads generation

A neural network extracts and encodes the locations of key facial features of the user for each frame, which is much more efficient than compressing pixel and color data. The encoded data is then passed on to a generative adversarial network along with a reference video frame captured at the beginning of the session. The GAN is trained to reconstruct the new image by projecting the facial features onto the reference frame.

Implementation details

We base our generator network on the image-to-image translation architecture proposed by Johnson et al., but replace downsampling and upsampling layers with residual blocks similarly. For the discriminator, we use a similar network, which consists of residual downsampling blocks without normalization layers. We also use self-attention blocks, which are inserted at 32×32 spatial resolution in all downsampling parts of the networks and at 64×64 resolution in the upsampling part of the generator.

We also integrated our Super-Resolution model on top of the reconstructed output to enhance the overall image quality without increasing the necessary bandwidth.

Video compression in action

The video shows the video compression model in action; the first video is the H.264 compression, and the second is the reconstructed video based on a single source image and predicted landmarks for the driving video. The last video applies Super-Resolution on top of it to improve the overall video quality.

The compression pipeline can be used as a standalone tool, but it can also be embedded directly into existing video conferencing tools. Thanks to that, the model can tap into all the metadata you have about your video stream and dynamically adjust the number of landmarks to improve facial reconstruction.

Limitations

Currently, the key limitation of our method is that using landmarks from a different person leads to a noticeable mismatch. In addition, our reconstruction network takes a lot of compute, hindering wider adoption for resource-constrained devices.

Outlook

Our work could not have been possible without the help of countless open source resources. We hope our contributions will help others in the video compression and web conferencing community build the next generation of innovative technology. We released the code to reproduce the results.

If you have questions or ideas on how to compress your data, join us on our Gitter #lounge channel or leave a comment in the comment section.

Comments (0)


Add a Comment






Allowed tags: <b><i><br>Add a new comment:


Search the newsroom

Latest Blog Posts

Open source machine learning for video compression

14/09/2022

Using open source software, Collabora has developed an efficient compression pipeline that enables a face video broadcasting system that…

Improving Vulkan graphics state tracking in Mesa

07/09/2022

Introducing new common code for Mesa Vulkan drivers to support a new Vulkan extension, making it easier for app and game authors to manage…

Using a Raspberry Pi as a Bluetooth speaker with PipeWire

02/09/2022

Using PipeWire, WirePlumber and a Raspberry Pi, you can create an audio bridge between a Bluetooth® device and an analog speaker system,…

Introducing the r600/NIR back-end

07/07/2022

Adventures in NIR-land: the past, the present, and what's lies ahead for the native NIR back-end for Mesa's R600 driver.

Adding secondary command buffers to PanVk

15/06/2022

Getting PanVk, an open source driver for Arm Mali Midgard and Bifrost GPUs, closer to conformancy by implementing one of the core Vulkan…

Bridging the synchronization gap on Linux

09/06/2022

After fighting with the divide between implicit and explicit synchronization with Vulkan on Linux for over seven years, we may finally have…

Open Since 2005 logo

We use cookies on this website to ensure that you get the best experience. By continuing to use this website you are consenting to the use of these cookies. To find out more please follow this link.

Collabora Ltd © 2005-2022. All rights reserved. Privacy Notice. Sitemap.