[FFmpeg-user] Continuity issues with multiple UDP output streams.

Marton Balint cus at passwd.hu
Tue Nov 12 22:22:35 EET 2019

On Tue, 12 Nov 2019, James E. Baird wrote:

> To add to this, I did some further testing and it would seem the lower 
> the bitrate I make the streams from the transmitter, the more streams I 
> can have without continuity errors on the receiver side. I did a 
> resolution change from 1080p to 480p and dropped the bitrate on my 
> streams from 12000-14000K to 1500K (mpeg2 to mpeg2) and I could add 7 
> processes before I started seeing the streams having issues.
> Using this command:
> ffmpeg -i 'udp://@' -s 864x486 -b:v 1000000 -acodec copy -f mpegts 'udp://@'
> Not sure if this helps anyone have a eureka moment.

If you are only copying streams, then I suggest you use another tool, like 
socat to relay streams.

Not that you can't make ffmpeg work to some degree. First you have to make 
sure you are not dropping packets on the input side. I suggest you use 0 
as fifo size and 512000 as buffer size (see the docs for these options). 
In order to be able to set this you have to tune linux kernel parameters 
(net.core.rmem_max) as well.

Then you have to make sure your output is not bursting too much. You 
should limit the output bitrate using the bitrate option. Make sure your 
processes can still operate at realtime speed, otherwise packets will 
queue up or get dropped. Even if you do this, depending on your receiver 
device it might still not work, because ffmpeg mpegts muxer does not 
honor TS buffering requirements, so the generated TS will not be standard 


More information about the ffmpeg-user mailing list