Conditional Encoding (Prevent upscaling) #1061
getroot
announced in
Announcement
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Many OvenMediaEngine users, including us, service WebRTC and LLHLS at the same time. To do so, Opus and AAC had to be provided at the same time. This is because WebRTC only supports OPUS and LLHLS only supports AAC.
In the past, when ingesting mainly via RTMP, setting AAC to a passthrough configuration and encoding only OPUS was sufficient, so system resources were not wasted. But now there are many cases of ingesting via WebRTC and WHIP. In this case the AAC can no longer be set up in a passthrough configuration as the OPUS audio is coming as an input. In the end, whatever audio is input, both AAC/OPUS must be encoded. This is a waste of system resources because even when aac is input, it has to be encoded to aac once more, and the same for opus.
With this motivation, @Keukhan developed a conditional encoding scheme called
BypassIfMatch
. And it has been confirmed that it can be used in a wider variety of cases.This is now available for testing with the master branch.
It can be configured as below.
As above, you can set BypassIfMatch and make true according to Codec, Samplerate, and Channel conditions.
The conditions are:
eq: euqal to
lte: less than or equal to
gte: greater than or equal to
In the above configuration, cond_audio_opus is bypassed when opus is entered. In the case of cond_audio_aac, if the input stream is the aac codec, the number of channels is the same (2), and the sample rate is larger or the same, the encoding will be bypassed.
We have extended this to Video as well, as shown below. This will prevent upscale and bypass encoding. This can significantly save system resources.
Note that Framerates and Bitrates cannot be supported by BypassIfMatch because they are not meta information, but a value that can only be known by measurement and can be constantly changed. We will consider more because to support this feature OME has to delay the initial stream creation by about 1 second and measure these values.
Beta Was this translation helpful? Give feedback.
All reactions