Skip to content

Transcoder

Overview

Transcoder is a module within mcaster that provides video stream transcoding for various broadcasting scenarios. The module supports both DVB-compatible CBR (Constant Bit Rate) quality generation and multibitrate (MBR) encoding for OTT (Over-The-Top) services.

Transcoded stream

Module Application

Main Usage Scenarios

Connecting SDI and Compressed Video

  • Problem: Need to transmit SDI signal in compressed format
  • Solution: Transcoding SDI to H.264/H.265 for digital broadcasting
  • Result: Compatibility with modern delivery systems

Bitrate Reduction

  • Problem: High bitrate of incoming stream
  • Solution: Transcoding with bitrate optimization
  • Result: Network bandwidth savings

DVB and OTT Integration

  • Problem: Different quality requirements for DVB and internet broadcasting
  • Solution: Creating separate streams with different settings
  • Result: Optimal quality for each delivery type

Transmitting Unknown Quality Stream to DVB

  • Problem: Unstable quality of incoming stream
  • Solution: Normalization and stabilization of parameters
  • Result: Guaranteed quality for DVB broadcasting

Operating Modes

DVB CBR (Constant Bit Rate)

DVB transcode configuration

Purpose

Mode designed for digital television broadcasting with fixed bitrate, ensuring stable transmission quality.

Configuration

stream ort {
  input udp://239.0.0.1:1234;
  transcoder external=false gop=28 hw=cpu vb=6100k bframes=3 vcodec=h264 b-pyramid=strict bufsize=6000k rc-lookahead=30 x264opts=videoformat=component:no-scenecut:force-cfr:colorprim=bt470bg:transfer=bt470bg:colormatrix=bt470bg:weightb=0 interlace=true open_gop=true preset=fast refs=4 size=1920x1080:scale ab=192k acodec=mp2a atrack=1;
}

Key DVB Parameters

Parameter Description Value
vb Video bitrate 6100k
size Resolution 1920x1080
gop Group of pictures size 28
bframes Number of B-frames 3
interlace Interlaced scanning true
ab Audio bitrate 192k
acodec Audio codec mp2a

OTT MBR (Multi-Bitrate)

Purpose

Mode designed for internet broadcasting with adaptive bitrate, ensuring optimal quality for various network conditions.

Configuration

stream ort {
  input udp://239.0.0.1:1234;
  transcoder vb=600k size=x360 vb=2000k size=x720 vb=5000k size=x2180;
}

Key OTT Parameters

Parameter Description Value
vb Video bitrate 600k, 2000k, 5000k
size Resolution x360, x720, x2180

Detailed Configuration Parameters

Video Parameters

Basic Settings

  • external=false — use built-in transcoder
  • hw=cpu — hardware acceleration (cpu/gpu)
  • vcodec=h264 — video codec (h264/h265)
  • size=1920x1080 — output video resolution

Quality Parameters

  • vb=6100k — video bitrate
  • bufsize=6000k — encoding buffer size
  • rc-lookahead=30 — bitrate control analysis depth
  • preset=fast — encoding preset (fast/medium/slow)

GOP Parameters

  • gop=28 — group of pictures size
  • bframes=3 — number of B-frames
  • b-pyramid=strict — B-frame pyramid
  • open_gop=true — open GOP structure
  • refs=4 — number of reference frames

Audio Parameters

  • ab=192k — audio bitrate
  • acodec=mp2a — audio codec (mp2a/aac)
  • atrack=1 — number of audio tracks

DVB-Specific Parameters

  • interlace=true — interlaced scanning
  • x264opts=videoformat=component — video format
  • colorprim=bt470bg — color space
  • transfer=bt470bg — gamma correction
  • colormatrix=bt470bg — color matrix

Limitations and Features

Mode Incompatibility

Important: It's impossible to prepare a stream simultaneously for DVB and OTT. It's necessary to create two separate streams:

# DVB stream
stream dvb_channel {
  input udp://239.0.0.1:1234;
  transcoder vb=6100k size=1920x1080 gop=28 interlace=true;
  output udp://239.0.0.2:1234;
}

# OTT stream
stream ott_channel {
  input udp://239.0.0.1:1234;
  transcoder vb=600k size=x360 vb=2000k size=x720 vb=5000k size=x2180;
  output hls:///var/www/hls/ott;
}

Transcoder Adaptability

The module efficiently handles:

  • Source switching — automatic adaptation to new source
  • Resolution changes — dynamic encoding parameter adjustment
  • Codec changes — automatic switching between formats
  • Output stability — maintaining fixed output parameters

Configuration Examples

HD DVB Broadcasting

stream hd_dvb {
  input udp://239.0.0.1:1234;
  transcoder external=false gop=28 hw=cpu vb=8000k bframes=3 vcodec=h264 b-pyramid=strict bufsize=8000k rc-lookahead=30 x264opts=videoformat=component:no-scenecut:force-cfr:colorprim=bt709:transfer=bt709:colormatrix=bt709:weightb=0 interlace=false open_gop=true preset=fast refs=4 size=1920x1080:scale ab=256k acodec=mp2a atrack=2;
  push udp://239.0.0.2:1234;
}

OTT Multibitrate

stream ott_multibitrate {
  input udp://239.0.0.1:1234;
  transcoder vb=400k size=x240 vb=800k size=x360 vb=1500k size=x480 vb=2500k size=x720 vb=4000k size=x1080;
}

SD DVB Broadcasting

stream sd_dvb {
  input udp://239.0.0.1:1234;
  transcoder external=false gop=25 hw=cpu vb=4000k bframes=2 vcodec=h264 b-pyramid=strict bufsize=4000k rc-lookahead=25 x264opts=videoformat=component:no-scenecut:force-cfr:colorprim=bt470bg:transfer=bt470bg:colormatrix=bt470bg:weightb=0 interlace=true open_gop=true preset=fast refs=3 size=720x576:scale ab=128k acodec=mp2a atrack=1;
  push udp://239.0.0.3:1234;
}

LSI Integration

stream resilient_dvb {
  input copy://primary_source source_timeout=10;
  input copy://backup_source;
  title "Resilient DVB Channel";

  transcoder external=false gop=28 hw=cpu vb=6000k bframes=3 vcodec=h264 b-pyramid=strict bufsize=6000k rc-lookahead=30 x264opts=videoformat=component:no-scenecut:force-cfr:colorprim=bt709:transfer=bt709:colormatrix=bt709:weightb=0 interlace=false open_gop=true preset=fast refs=4 size=1920x1080:scale ab=192k acodec=mp2a atrack=1;

  push udp://239.0.0.4:1234;
}

Troubleshooting

Quality Issues

Low Output Stream Quality

  1. Increase bitrate (vb) for better quality
  2. Check quality of incoming stream
  3. Optimize encoding settings
  4. Monitor quality metrics

Unstable Bitrate

  1. Check settings for bufsize and rc-lookahead
  2. Ensure stability of incoming stream
  3. Check system load
  4. Optimize encoding preset

Performance Issues

High CPU Load

  1. Enable hardware acceleration (hw=gpu)
  2. Simplify encoding settings
  3. Use faster preset (preset=veryfast)
  4. Reduce resolution or bitrate

Encoding Delays

  1. Reduce rc-lookahead to decrease delay
  2. Optimize GOP size for quality and delay balance
  3. Check system performance
  4. Consider using external transcoder

Configuration Recommendations

DVB Optimization

  • Use CBR for stable bitrate
  • Configure correct color spaces for standard
  • Optimize GOP for decoder compatibility
  • Check compliance with DVB standards

OTT Optimization

  • Create multiple bitrates for adaptability
  • Use progressive scanning for web players
  • Optimize for mobile devices (low bitrates)
  • Test on various devices

General Recommendations

  • Monitor quality in real-time
  • Optimize settings for specific content
  • Use hardware acceleration when possible
  • Plan redundancy for critical streams

Conclusion

The Transcoder module provides flexible and efficient video stream transcoding for various broadcasting scenarios. Support for both DVB CBR and OTT MBR modes makes it a universal solution for modern broadcasting systems. Adaptability to incoming stream changes and stability of output parameters ensure reliable operation in complex broadcasting conditions.