Media Mapping Phase
This article discusses the media mapping phase of encoding. You can find an overview of the entire encoding process in the Job Processing article.
To decide which input files represent which streams, the Encoding Service uses the settings in the MediaMappings section. There are three layers of settings which enable more and more focused filtering of the input files.
First, regular expressions can be used to filter the files which represent the video/audio/subtitle/caption streams.
{
"VideoStreamExpression": "^video.(mp4|avi|mov)$",
"AudioFileLanguageExpression": "^audio-([a-zA-Z0-9\\-]+).mp3$",
"SubtitleFileLanguageExpression": "^subtitle-([a-zA-Z0-9\\-]+).(vtt|ttml|srt)$",
"CaptionFileLanguageExpression": "^caption-([a-zA-Z0-9\\-]+).(vtt|ttml|srt)$",
}
Files not matched by any of the provided regular expressions will not be used
at all. Only a single file is expected with a video stream. All the other
streams can be specified separately for every language. Use a regular
expression group to match the language - the first matched group will be
treated as the language code. For example, the file audio-DEU.mp3
will be
interpreted as an audio track for the language "DEU" (German).
See Languages in the Axinom Encoding Overview article for details on how the Encoding Service handles languages.
Second, if the file names do not clearly indicate a language, more generic patterns can be used to match all audio/subtitles/captions files and then a specific mapping can be used to map a file to a language, e.g.:
{
"AudioStreams": [
{
"Language": "en",
"FileNameExpression": "audio-en.mp3"
},
{
"Language": "fr",
"FileNameExpression": "audio-fr.mp3"
}
]
}
Finally, the list of languages to be used can be further limited:
{
"AudioLanguages": ["fr"]
}
Note
|
Even though two audio streams were found - English and French, only the one in French (audio-fr.mp3) will be used for encoding. |
Revision History
The table below lists the document versions and any changes to them.
Version | Date | Description |
---|---|---|
1.0 |
April 19, 2021 |
|