Transcoding
OutputProfile
The <OutputProfile>
setting allows incoming streams to be re-encoded via the <Encodes>
setting to create a new output stream. The name of the new output stream is determined by the rules set in <OutputStreamName>
, and the newly created stream can be used according to the streaming URL format.
According to the above setting, if the incoming stream name is stream
, the output stream becomes stream_bypass
and the stream URL can be used as follows.
WebRTC
ws://192.168.0.1:3333/app/stream_bypassLLHLS
http://192.168.0.1:8080/app/stream_bypass/llhls.m3u8HLS
http://192.168.0.1:8080/app/stream_bypass/ts:playlist.m3u8
Encodes
Video
You can set the video profile as below:
Codec*
Type of codec to be encoded See the table below
Bitrate*
Bit per second
Name*
Encode name for Renditions No duplicates allowed
Width
Width of resolution
Height
Height of resolution
Framerate
Frames per second
KeyFrameInterval
Number of frames between two keyframes (0~600) default is framerate (i.e. 1 second)
BFrames
Number of B-frames (0~16) default is 0
Profile
H264 only encoding profile (baseline, main, high)
Preset
Presets of encoding quality and performance See the table below
ThreadCount
Number of threads in encoding
Lookahead
Number of frames to look ahead default is 0 x264 is 0-250
nvenc is 0-31 xma is 0-20
Modules
An encoder library can be specified; otherwise, the default codec See the table below
* required
Supported Video Codecs
Video
VP8
vp8
SW: libvpx*
H.264
h264
SW: openh264*, x264
HW: nv, xma
H.265 (Hardware Only)
h265
HW: nv, xma
Preset
A table in which presets provided for each codec library are mapped to OvenMediaEngine presets. Slow presets are of good quality and use a lot of resources, whereas Fast presets have lower quality and better performance. It can be set according to your own system environment and service purpose.
slower
QP( 10-39)
p7
best
slow
QP (16-45)
p6
best
medium
QP (24-51)
p5
good
fast
QP (32-51)
p4
realtime
faster
QP (40-51)
p3
realtime
References
https://trac.ffmpeg.org/wiki/Encode/VP8
https://docs.nvidia.com/video-technologies/video-codec-sdk/nvenc-preset-migration-guide/
Audio
You can set the audio profile as below:
Codec*
Type of codec to be encoded See the table below
Bitrate*
Bits per second
Name*
Encode name for Renditions No duplicates allowed
Samplerate
Samples per second
Channel
The number of audio channels
Modules
An encoder library can be specified; otherwise, the default codec See the table below
* required
It is possible to have an audio only output profile by specifying the Audio profile and omitting a Video one.
Supported Audio Codecs
Audio
AAC
aac
SW: fdkaac*
Opus
opus
SW: libopus*
Bypass (Passthrough)
You can configure Video and Audio to bypass transcoding as follows:
You need to consider codec compatibility with some browsers. For example, chrome only supports OPUS codec for audio to play WebRTC stream. If you set to bypass incoming audio, it can't play on chrome.
WebRTC doesn't support AAC, so if video bypasses transcoding, audio must be encoded in OPUS.
Additional Features
Conditional Encoding
If the codec or quality of the input stream is the same as the profile to be encoded into the output stream. there is no need to perform re-transcoding while unnecessarily consuming a lot of system resources. If the quality of the input track matches all the conditions of BypassIfMatch, it will be Pass-through without encoding
Matching elements in video
Codec (Optional)
eq
Compare video codecs
Width (Optional)
eq, lte, gte
Compare horizontal pixel of video resolution
Height (Optional)
eq, lte, gte
Compare vertical pixel of video resolution
SAR (Optional)
eq
Compare ratio of video resolution
* eq: equal to / lte: less than or equal to / gte: greater than or equal to
Matching elements in audio
Codec (Optional)
eq
Compare audio codecs
Samplerate (Optional)
eq, lte, gte
Compare sampling rate of audio
Channel (Optional)
eq, lte, gte
Compare number of channels in audio
* eq: equal to / lte: less than or equal to / gte: greater than or equal to
To support WebRTC and LLHLS, AAC and Opus codecs must be supported at the same time. Use the settings below to reduce unnecessary audio encoding.
If a video track with a lower quality than the encoding option is input, unnecessary upscaling can be prevented. SAR (Storage Aspect Ratio) is the ratio of original pixels. In the example below, even if the width and height of the original video are smaller than or equal to the width and height set in the encoding option, if the ratio is different, it means that encoding is performed without bypassing.
Keep Original and Change Bitrate
If you want to transcode with the same quality as the original. See the sample below for possible parameters that OME supports to keep original. If you remove the Width, Height, Framerate, Samplerate, and Channel parameters. then, It is transcoded with the same options as the original.
Rescaling with Keep the Aspect Ratio
To change the video resolution when transcoding, use the values of width and height in the Video encode option. If you don't know the resolution of the original, it will be difficult to keep the aspect ratio after transcoding. Please use the following methods to solve these problems. For example, if you input only the Width value in the Video encoding option, the Height value is automatically generated according to the ratio of the original video.
Decoding Thread Configuration
The software decoder uses 2 threads by default. If the CPU speed is too low for decoding, increasing the thread count can improve performance.
Last updated
Was this helpful?