Using a transcoders file
Transcoding plugins
To perform a transcoding operation, the Unified Streaming transcoding framework uses a so-called transcoding pipeline. Such a pipeline consists of:
a decoder, which decodes compressed media data (in some specific format) to uncompressed ('raw') media data;
a list of (zero or more) filters that manipulate the raw media data, and
an encoder, which converts the raw media data to some specific (and possibly different) compressed format.
Most of our decoders, filters, and encoders are implemented as plugins in the form of dynamically loaded DLLs/shared libraries, which allows the user to select a specific implementation.
These plugins may differ in terms of performance, media quality, or requirements on the computing environment, such as the operating system, the availability of some run-time library component, a specific GPU, or the ability to run in a containerized environment.
For example, for decoding AVC video data, we offer a plugin that uses the mfx library from the Intel Media SDK (which, on Linux, requires an Intel GPU and cannot be used in a standard containerized environment), and one based on FFmpeg's avcodec library (which is more portable and adapts itself to the available hardware resources).
The transcoders file
Using a transcoders file, the user can specify which plugins to use when a transcoding pipeline is created. This is probably best illustrated by an example transcoders file:
# Example transcoders file selecting the mfx plugins (Intel Media SDK)
# for video transcoding
# Transcoder type Implementation Attributes (as of version 1.14.3)
video_decoder_avc mfx mode=auto
video_filter_resize mfx mode=auto
video_encoder_avc mfx mode=auto
video_encoder_jpg mfx mode=auto quality=30
Each non-empty [1] line specifies a transcoder type, followed by the name of the user-selected implementation for that transcoder type. Each transcoder type/implementation pair is mapped to some platform- and version-specific plugin name, which is dynamically loaded when the transcoding pipeline is created.
New in version 1.14.3: In addition to the transcoder type and its corresponding
implementation, a list of zero or more attributes in the form of
<key>=<value>
pairs may be added at the end of the line to
configure the plugin. Each plugin has its own set of accepted
attributes; if an attribute is not set explicitly, a default value
applies.
Specifying which transcoders file to use
--transcoders_file=<path>
option. This results in local
transcoding: the transcoding pipeline is run as an integral part of
the locally invoked OS process [8]. For an example use of local
transcoding, see Tiled Thumbnails with FFmpeg.
Available video transcoding plugins
Currently, the following video transcoding plugins are available [7]:
Transcoder type |
Implementation |
Attributes (as of version 1.14.3) |
---|---|---|
video_decoder_avc |
mfx [2] |
mode [5] |
video_decoder_avc |
avcodec [3] |
|
video_filter_resize |
mfx [2] |
mode [5] |
video_filter_resize |
swscale [4] |
|
video_encoder_avc |
mfx [2] |
mode [5] |
video_encoder_jpg |
mfx [2] |
|
video_encoder_jpg |
avcodec [3] |
quality [6] |
Default video transcoding plugin settings
For backward compatibility reasons, in the absence of an explicitly specified transcoders file, or if a particular transcoder type is not listed in this file, the following defaults apply:
Transcoder type |
Implementation |
Attributes (as of version 1.14.3) |
---|---|---|
video_decoder_avc |
mfx [2] |
mode=auto [5] |
video_filter_resize |
mfx [2] |
mode=auto [5] |
video_encoder_avc |
mfx [2] |
mode=auto [5] |
video_encoder_jpg |
mfx [2] |
Warning
Because we're in the process of providing alternatives for the use of the Intel Media SDK/libmfx, the default implementation names listed above may change in some future USP release. Instead of relying on any defaults, it is better to always specify the implementation names in a transcoders file.
Footnotes