UDP Streaming on CasparCG 2.3.0 server


please help:
I am using this command
ADD 1 STREAM udp://IP:5000 -codec:v libx264 -preset:v faster -codec:a aac -strict -2 -b:a 128k -ar:a 48000 -b:v 6000k -filter:v format=pix_fmts=yuv420p,fps=25 -filter:a pan=stereo|c0=c0|c1=c1 -format mpegts

caspar shows this before command is executed

[2020-10-06 15:36:10.748] [info]    ffmpeg[udp://IP:5000] Initialized.
[2020-10-06 15:36:10.751] [info]    [ffmpeg] [libx264 @ 00000225C13CC000] using SAR=1/1
[2020-10-06 15:36:10.751] [info]
[2020-10-06 15:36:10.751] [info]    [ffmpeg] [libx264 @ 00000225C13CC000] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
[2020-10-06 15:36:10.751] [info]
[2020-10-06 15:36:10.756] [info]    [ffmpeg] [libx264 @ 00000225C13CC000] profile High, level 4.0, 4:2:0, 8-bit
[2020-10-06 15:36:10.756] [info]
[2020-10-06 15:36:10.757] [info]    [ffmpeg] [Parsed_pan_0 @ 00000225C13F43C0] Pure channel mapping detected:
[2020-10-06 15:36:10.757] [info]    [ffmpeg]  0
[2020-10-06 15:36:10.757] [info]    [ffmpeg]  1
[2020-10-06 15:36:10.757] [info]    [ffmpeg]
[2020-10-06 15:36:10.757] [info]

I am playing mp4 file full HD 1080I50

when i put my ip to vlc no image showing but sound comes with delay and strobes. please help

Are you sure, that you can send h264 as an MPEG-TS stream? I am a nob on this streaming stuff, that’s why I ask. :slight_smile:

IIRC teradek encoders can work that way. Either rtmp, rtsp or ts. Could be up to the decoder to know what to decode.

1 Like

I am not sure. :slight_smile:
What format should I use to stream?

Hi, I had problems with udp streaming in CasparCG too. I didn’t have these problems with tcp tho.
If you are going to try it with tcp, just be aware you need something listening on that port first and then you can start streaming. Also, you need to re-start the stream whenever you lose the connection.
H264 should be perfectly fine according to my basic knowledge of this.

It works fine with 2.3.0. In vlc use, udp://@IP:5000 or simply udp://@:5000

Try This Command:
ADD 1 STREAM udp:// -preset:v fast -qp:v 0 -filter:v format=pix_fmts=yuv420p -codec:v libx264 -bufsize:v 6M -minrate:v 2.5M -maxrate:v 2.5M -x264opts:v keyint=24:min-keyint=24:scenecut=0:bframes=2:b-adapt=0:open-gop=0 -x264opts:v bitrate=3000:vbv-maxrate=3000:vbv-bufsize=400:ratetol=200:bitrate=3000:vbv-init=800 -codec:a aac -filter:a pan=stereo|c0=c0|c1=c1 -strict -2 -b:a 128k -flags:v cgop+ilme -format mpegts

//////////////// This ffmpeg Command tuned For Casparcg 2.2 And Above…


Thank you, it really works good.