Transcoder is a powerful tool for rescaling video materials. Storm uses open-source FFMPEG for all tasks related to transcoding. If FFMPEG is not installed on your system, transcoding will not be possible. In order to check if FFMPEG is present, please try this command line:
ffmpeg -version
(For Windows-based operating systems you can use PowerShell)Below you’ll find a sample configuration for preferences.xml file. First part contains a single preset set for transcoding source material to 720p. The second allows for more precise FFMPEG tuning, in case you wish to change default x264 encoder.
<Transcoder>
<FFMPEGSettings>
<Path>/usr/bin/ffmpeg</Path>
<Command>-re -nostdin -i ${SOURCE_INPUT} -vcodec libx264 -preset:v ${CPU_USAGE_PRESET} -vf scale=${OUTPUT_WIDTH}:${OUTPUT_HEIGHT} -tune ${TUNE} -g 30 -fflags nobuffer -acodec aac -async 1 -f flv ${STREAM_OUTPUT}</Command>
</FFMPEGSettings>
<PresetList>
<Preset name="720p" suffix="_720p">
<Resolution width="1280" height="720" />
<Bitrate video="2500" audio="50" />
<KeyFrameInterval>1</KeyFrameInterval>
<CPUUsagePreset>ultrafast</CPUUsagePreset>
<Profile>main</Profile>
<Tune>zerolatency</Tune>
</Preset>
</PresetList>
</Transcoder>
TranscodingPreset:name | A name for your transcoder preset. This name will have to be applied to TranscodingSettings within an Application. |
TranscodingPreset:appending | Appending defines how stream name will be modified (by adding a new segment). |
Resolution:width | Width of a transcoded video. If this attribute is not provided, video width will be calculated based on source material aspect ratio! |
Resolution:height | Height of a transcoded video. |
Bitrate:video | Bitrate for video data. |
Bitrate:audio | Bitrate for audio data. |
KeyFrameInterval | Interval at which key-frames will be added. For best latency we advise to keep this value to 1. |
CPUUSagePreset | This value defines CPU usage for transcoding task. Possible values: ultrafast, superfast, veryfast, fast, medium, slow, slower, veryslow, placebo. |
Profile | Defines a profile for H.264 encoder. Possible values: high, main, baseline. |
Tune | Type of tuning for the encoder. We highly advice to keep this value to “zerolatency”. |
A direct path to FFMPEG binaries. For most Linux distributions it should be: /usr/bin/ffmpeg.
Storm performs transcoding by controlling individual FFMPEG processes. You may want to tune your FFMPEG configuration by changing default encoder (for example to NVENC). This command line is being used to execute commands and can be modified.
Variables:
${SOURCE_INPUT} | Source of the stream (an address to rtmp stream) |
${STREAM_OUTPUT} | Address at which transcoded stream will be transferred to |
${CPU_USAGE_PRESET} | CPU Usage Preset |
${OUTPUT_WIDTH} | Width of a transcoded stream in pixels |
${OUTPUT_HEIGHT} | Height of a transcoded stream in pixels |
$(OUTPUT_VIDEO_BITRATE) | Bitrate for transcoded video data |
$(OUTPUT_AUDIO_BITRATE) | Bitrate for transcoded audio data |
$(TUNE) | Transcoder tune. e.g. zerolatency |