Transcoders¶
Transcoders re-encode the video and the audio of a stream: they lower the bitrate for OTT or for a multiplex, change the codec and the resolution, and prepare the renditions of adaptive bundles. Each transcoder runs as a separate node process; the “one-to-many” arrangement is supported — a single decoder can feed several output streams with different encoding settings. Transcoding is available for SPTS streams only; the source stream must contain both video and audio.
Transcoder architecture: one decoder (shared) and N independent “processing + encoder” branches; the audio tracks are processed separately from the video, subtitles and teletext pass through.¶
Connection¶
A transcoder connects two or more streams:
On the source stream an output of type transcoder is added — this is the decoder. Its settings select the transcoding backend (see below).
On the resulting stream an input of type transcoder is added — this is the encoder. Its settings select the running source decoder (the Decoder field).
Step 2 is repeated for every additional rendition — all of them use the shared decoder.
From that point on the resulting stream is an ordinary SPTS stream: it can be delivered over OTT, recorded to DVR, or fed to a multiplexer.
Backends and codecs¶
The backend is selected on the decoder (the Transcoder backend field; the values are as in the interface):
- Video pass-through
The video passes through without re-encoding, only the audio is transcoded. The mode is executed by the software transcoder — the software transcoding package must be installed (Transcoders).
- Software (CPU)
Software transcoding on the CPU.
- NVidia (GPU)
Hardware transcoding on NVIDIA GPUs.
- Intel VPL (GPU)
Hardware transcoding on Intel GPUs.
For the GPU backends the device is selected with the GPU device selector field (an advanced setting) — relevant on servers with several cards. The transcoder packages are installed separately (Transcoders); the installed backends, their versions and the detected devices are shown on the “About” screen (About).
Decoder codecs — MPEG-2, H.264, HEVC; audio — MPEG (Layer 1–3), AAC, AC-3. Encoder codecs — H.264 and HEVC (the NVIDIA encoder does not support MPEG-2; MPEG-2 is encoded by the Software and Intel VPL backends); audio — MPEG Layer II and AAC.
Decoder specifics:
interlaced (interlace) streams are supported both on the input and on the output; for H.264 and HEVC the interlace alternate format (separate fields) is converted to interleaved;
for HEVC the Main10 profile with BT.709 (SDR) and BT.2020 (HDR) is supported; the HEVC encoder always uses the Main profile with BT.709;
a variable frame rate (VFR) is converted to a constant one;
streams without IDR frames are supported.
Decoder settings¶
They are set on the output of type transcoder of the source stream (the names are as in the interface; all of the settings listed below are advanced settings):
- Fix PAR (N/D), Fix framerate (N/D)
Hints for correcting the data of the input stream — they do not transform the stream, they correct the parameters when the source does not report them or reports them incorrectly. Fix PAR — the pixel aspect ratio as a fraction (for example, 16/9 for Wide SD); Fix framerate — the frame rate as a fraction, if it is absent from the stream (PAL — 25/1, NTSC — 30000/1001, film — 24/1).
- Convert to BT.709
Conversion of the SD colour formats (BT.470-2 PAL, SMPTE 170M NTSC) to BT.709.
- Watchdog timeout
The watchdog restart timeout of the transcoder process.
The transcoder process always keeps a detailed log — a separate trace setting is not required (Monitoring).
Encoder settings¶
They are set on the input of type transcoder of the resulting stream:
- Encoder
The video codec: MPEG-2, H.264 (default) or HEVC.
- Video profile (H.264)
The H.264 encoding profile: Main or High.
- Video bitrate (kbps)
The video bitrate. Encoding is always performed in CBR mode; the total bitrate of the stream will be higher because of the audio tracks.
- Resize
Resizing of the picture: proportional downscaling by a factor of 2 or 4; conversion to SD — the SD, SD PAL and SD NTSC options, all with the 16:9 widescreen aspect ratio; upscaling of SD to HD; setting the width or the height (the other side is recalculated proportionally). An arbitrary size is not supported — it would distort the aspect ratio.
- Deinterlace
Conversion of interlaced video to progressive (enabled by default; applied automatically when SD is upscaled to HD).
Quality and stream structure settings (advanced settings):
- GOP interval
The key frame interval, in frames. The default is 25 — one second for 25p; recommended when players join the stream at an arbitrary moment.
- B-frames, Lookahead
They improve the encoding quality; the recommended values are 3 and 20–50 frames respectively.
- Speed preset
The encoding speed preset, from 1 to 7: the lower the value, the higher the quality and the higher the load. The default is 4.
- Framerate resample
Decimation of the frame rate by a factor of 2 or 4.
- Encoder PMT PID, PAT/PMT interval (90kHz)
The PID of the PMT table and the repetition interval of the PAT/PMT tables in the output stream — for cases when the stream has to fit the network plan.
Incompatible combinations of parameters are possible — the errors are visible in the transcoder log (Monitoring).
Audio processing¶
By default all audio tracks pass from the input to the output without re-encoding. Superfluous tracks are removed by the PID filters on the stream input (MPEG-TS filtering).
Audio re-encoding is configured by rules, separately for each source codec (advanced settings): a track can be passed through unchanged, re-encoded (MPEG — to AAC; AAC — to MPEG Layer II; AC-3 — to MPEG Layer II or AAC) or removed (the Skip value). In addition, the audio bitrate (Audio bitrate, 128 kbps by default) and the 5.1 downmix volume (5.1 downmix volume) are set. If no audio track is left in the output stream after the rules have been applied, the encoder reports an error in the log.
PCR and the bitrate of the output stream¶
The transcoder multiplexer generates new, consistent PCR stamps. By default the output stream is VBR: the total bitrate follows the actual video and audio bitrate, and PCR accuracy per TR 101 290 is not guaranteed on the receiving side. If the transcoded stream is intended for DVB broadcasting, enable CBR mode on the receiving stream — stuffing will level the bitrate and recalculate the PCR (Bitrate control).
Monitoring¶
The “Transcoders” screen (Transcoders) shows all instances: each row is a separate instance (a decoder and the encoders connected to it) with its state, backend type, uptime, CPU load and memory. The “Transcoder instance” window (Transcoder instance) expands the source, the list of encoders with the parameters of the output video, the process resources and the logs of the current and the previous run — the first place to look when diagnosing problems.
The load of the GPU devices is shown on the “System Monitor” screen (System Monitor). Exceeding the CPU, memory and GPU load thresholds, as well as unavailability of the configured backend, raise alerts (Alert code catalog).