Transcoders

Transcoders are implemented as separate executable binaries that are run from pstreamer as separate processes.

Configuration of type 1toN are supported, so you can get several streams with different encoder settings from the one decoder.

Video and audio must be present in the source stream. The options without video or without audio are not supported.

Codecs are implemented:

  • Video SW decoder: mpeg2, h.264, hevc (h.265)

  • Video NW decoder: mpeg2, h.264, hevc (h.265)

  • Video SW encoder: mpeg2, h.264, hevc (h.265)

  • Video NW encoder: h.264, hevc (h.265)

Поддерживается interlaced stream на входе и выходе.

Для H.264 и HEVC decoder поддерживается формат interlace alternate (два отдельных поля в потоке). Он преобразуется в interlace interleaved.

Для HEVC decoder поддерживается профиль Main10 с bt.709 (SDR) и bt.2020 (HDR). Encoder для HEVC всегда использует профиль Main c bt.709.

Для H.264 и HEVC decoder поддерживается формат VBR (Variable Frame Rate), он преобразуется в постоянный frame rate.

  • Audio decoder - mpeg (layer 1,2,3), aac, ac3

  • Audio encoder - mpeg (layer 2), aac

Есть режим транскодирования Video Passthrough - без транскодирования видео, транскодируется только звук. Используется транскодер SW.

Note

Для транскодирования необходимо сконфигурировать два или более стрима, с output (decoder) и c input (encoder).

To configure transcoder instance:

  • Source - add stream output type transcoder (decoder). Select SW, NV or Video Passthrough type option.

  • Destination - add input type transcoder (encoder). Select corresponding decoder source in options.

  • Repeat this to configure several transcoder outputs for one decoder.

Настройки output transcoder (decoder)

  • Convert colors to BT.709 - конвертация форматов SD BT.470-2 (PAL) и SMPTE 170M (NTSC) в BT.709

  • Trace - включить для дигностики подробный лог транскодера.

For correct transcoder operation, the source stream must meet certain requirements, and in some cases, this can be corrected. These settings do not convert the stream; they work as hints for correct transcoder operation.

Для коррекции данных входного потока имеются настройки:

  • Fix PAR - fix Pixel Aspect Ratio. Set as a fractional number in N/D format. For example, for Wide SD it is 16/9.

  • Fix Framerate - explicitly specify framerate. In some streams, the framerate in SPS may be missing, and the corresponding error will be in the transcoder log. In these cases, you need to explicitly specify the framerate. Set as a fractional number in N/D format.

Examples of framerate values:

  • PAL - 25/1

  • NTCS - 30/1 or 30000/1001

  • Cinema - 24/1 or 24000/1001

Transcoder input (encoder) options

  • Encoder Type - video codec.

  • Align Total Bitrate - stream stuffing bitrate (filling with null packets). It is important to set this if the stream will be used for DVB broadcasting. The bitrate must be guaranteed to be higher than the video bitrate and all audio tracks.

  • Video Profile - for H.264 you can select encoding profile.

  • Video Bitrate - video stream bitrate, kbps. Encoding always use CBR mode. Summary bitrate will be some higher due to audio tracks.

  • Speed Preset - encoding options preset, values 1 - 7. Less value - better quality and more resources consuming. Default: 4.

  • GOP Interval - GOP interval in frames (related to Key Frame Interval). Default: 25 (1 sec for 25p), it is recommended for players with random start.

  • BFrame - select for better quality. Recommended value: 3.

  • Lookahead - configure for better quality. Recommended value is 20 - 50 frames.

  • Resize - picture resize.

  • Deinterlace - преобразует interlace в progressive.

Crop insert (empty padding around the picture) is not supported. Setting an arbitrary image size is not supported, as this may distort the proportions.

Resize options available:

  • Reduce the size by 2 and 4 times proportionally.

  • Сделать формат Wide SD 16:9, будет задан нужный Aspect Ratio.

  • Upscale SD->HD. Применяется для источника формата SD PAL/NTSC. Interlace не поддерживается, применяется при необходимости deintelace.

  • Set the width. The height will be recalculated proportionally.

  • Set the height. The width will be recalculated proportionally.

Some parameters can be unsupported by selected transcoder. You can observe errors in transcoders logs.

Audio processing

By default, all audio tracks are transmitted from input to output without processing. Unnecessary tracks can be removed by configuring the PID filters in the stream.

If you need to transcode audio, you can set up the rules separately for each audio codec. The skip option is to remove the audio track with this codec.

If there are no audio tracks in the output stream, there will be an error, see the transcoder logs.

Формирование PCR и TR 101 290.

MPEG-TS мультиплексор формирует новый PCR. Если правильно задать Align Total Bitrate (более чем сумма битрейтов видео и звука), то PCR должен пройти проверку по стандарту TR 101 290.

Это также можно использовать для случаев, когда надо устранить проблемы PCR в потоках без транскодирования. Для этого надо настроить транскодер в режиме Video Passthrough без транскодирования звука.

Transcoders processing status

If there are problems with the transcoder (there is no output stream from the encoder), you need to look at the logs in the Transcoders section, a list of instances is displayed here (each line is a separate transcoder instance, decoder + N encoders) and, when you click on the desired instance, the logs status dialog opens. The current log and the log from the previous launch are displayed. For a detailed log, enable trace in the output (decoder) settings.