Opus Audio Codec on Youtube

In this article we want to explain what the Opus Audio Codec is and how Youtube uses it.

What is the Opus Audio Codec?

Opus is an audio codec designed to efficiently compress digital audio data. It was adopted as a standard by the Internet Engineering Task Force (IETF) in 2012 and is supported by numerous applications and platforms such as WebRTC, Skype, WhatsApp, Discord, Mozilla Firefox and Google Chrome. Capable of covering a wide range of audio frequencies, including speech and music, the Opus codec offers high audio quality at low bit rates. It uses a combination of linear and non-linear predictive filters and variable sampling rateto allow efficient compression. This allows high quality audio data to be transmitted at bit rates as low as 6 to 510 kbps. Another advantage of the Opus codec is its adaptability to different network conditions. It supports variable bitrates and can adapt its encoding speed and quality in real time to the available network bandwidth. This ensures that the audio quality remains stable during transmission and that there are no interruptions or delays.

How does Youtube use the Opus Audio Codec?

Youtube supports the Opus codec for audio transmission in its videos and live streams. Since 2013, Youtube has been using the Opus codec as the default codec for its web media players and has also adopted it for its mobile apps and streaming devices like Chromecast and Google Home. The Opus codec is used by Youtube in a number of ways. For example, Youtube uses the Opus codec to extract audio data from video content and store it in separate audio streams. Also, Youtube uses the Opus codec to transmit live audio. Audio during live streams. Youtube supports the Opus codec in various bit rates including 128 kbps, 160 kbps and 192 kbps. Youtube automatically adjusts the bit rate of the Opus codec based on the available network bandwidth and the user's device capabilities to ensure optimal audio quality and smooth playback. Overall, the Opus codec has helped improve the audio quality of Youtube videos and optimize playback on different devices and network conditions.

You want the best possible, distortion-free playback of your song on all platforms?

What bitrates does the Opus Audio Codec use?

The Opus Audio Codec can use different bitrates for audio encoding. The codec was designed to deliver high quality audio at low bitrates, but also support higher bitrates for even better audio quality. Typical bit rates for the Opus codec are between 6 kbps and 510 kbps. However, the codec can support bitrates up to 768 kbps if even higher audio quality is required. The Opus codec uses a variable bitrate (VBR) that allows it to adjust the bitrate in real-time to match the needs of the audio content. This means that the codec automatically chooses higher bitrates for more complex audio content and lower bitrates for simpler audio content in order to achieve optimal audio quality and compression. In practice, this means that the Opus codec is suitable for a wide range of audio applications. suitable for audio applications ranging from low bit rate voice to higher bit rate music streaming. The Youtube app itself often uses significantly lower bit rates than the browser version on the smartphone.

Can the use of the Opus audio codec cause distortion?

Yes, there may be some distortion when using the Opus codec. Distortions can occur if the codec is used at bit rates that are too low, or if the audio material is too complex for the selected bit rate. In these cases, the codec cannot store enough information about the audio, which can result in degraded audio quality and distortion. Another factor that can cause distortion is the way the codec has been implemented. If the codec has not been correctly implemented or is incompatible with the software or hardware used, distortion can also occur. However, it is important to note that the Opus codec is generally optimized for high audio quality at low bitrates. If the codec is used with a sufficient bitrate and the audio is not too complex, the audio quality should be good and distortion can be avoided.

How do I avoid codec distortions?

To avoid distortion, the Streaming Services Specifications get noticed. As a rule of thumb, master your song so that it sounds good and if the integrated loudness is higher than -14 LUFS is, better leave 2 dB true peak headroom, um Intersample peak distortion to avoid.

You want to know if your song works on all platforms? We'll tell you in our professional mix analysis.

Opus Codec gets AI update

The new version 1.5 or 1.5.1 of the license-free audio codec Opus has received an AI update. Machine learning (ML) is intended to improve the coding so that the data stream remains compatible with existing decoders. But the decoder also receives artificial intelligence to improve the sound.

 

AI for better sound quality

A technology called "Neural Vocoder" is designed to compress speech particularly efficiently. Compared to the LPCNet vocoder, the CPU cores of laptops or smartphones are only loaded by about one percent. The developers call the algorithm Framewise AutoRegressive Generative Adversarial Network (FARGAN). They plan to publish a paper on this later.

They optimize signal processing with the Linear Adaptive Coding Enhancer (LACE) and a nonlinear variant (NoLACE). LACE behaves like a classic postfilter, in which a deep neural network (DNN) adjusts the coefficients on the fly with all available data - but the audio signal itself does not pass through the DNN. The result is a small DNN with very low complexity that also works on older phones. The NoLACE variant requires more computing power, but is also significantly more powerful due to the non-linear signal processing. Both significantly improve the voice quality.

 

Opus codec: Bitstream remains standards compatible

Instead of programming a completely new codec based on ML, Opus remains completely compatible. This ensures that Opus continues to run on older and slower devices while providing an easy upgrade path. While deep learning is often associated with powerful GPU accelerators, the Opus project has optimized everything so that it runs on most processors, including smartphone CPUs.

Most users shouldn't notice the higher load, but those using microprocessors or smartphones that are more than five years old might notice it. The new functions are therefore still deactivated by default and must be activated during compilation and at runtime, for example via command line parameters.

 

Improve packet loss

Packet loss leads to missing sound fragments. Codecs usually try to prevent this through packet loss concealment (PLC). This is usually a kind of decoder-side interpolation with "plausible audio" inserted at the loss points. Machine learning could be particularly helpful here - the Opus developers are tackling this with a deep neural network (DNN), which increases the codec's binary file by around 1 MByte and leads to one percent more load on a laptop CPU core in the event of severe packet loss.

Image by Chris Jones

Chris Jones

CEO – Mixing and Mastering Engineer. Founder of Peak-Studios (2006) and one of the first online service providers for professional audio mixing and mastering in Germany.