[FFmpeg-user] ffmpeg and input bursty video frames

Shane Warren shanew at innovsys.com
Thu Dec 2 18:53:42 EET 2021

I am using ffmpeg to live transcode multicast transport streams. I am trying to transcode some music channels that only send out video frames like every 10 seconds or so, and play audio constantly.

When ffmpeg uses the video from that stream (mpeg2) and the audio from that stream (AC3) ffmpeg seems to only send out packets based on video packets being received. I have tried many things, but no combination of ffmpeg filters or commands seem to stop this behavior. I have analyzed the transport stream and it appears video pes packets are only sent every 6 seconds or so, and that appears to be the period at which ffmpeg is outputting packets, so like every 6 seconds. The bursty packets mostly cause issues with audio playback as players starve for audio before they get the next burst of packets.

Ideally even if the input multicast video was only sending frames every 10 seconds ffmpeg would duplicate any frames it finds at the framerate I specify for the output.

Here is my command I'm using to try transcode this stream:

ffmpeg -y -loglevel verbose -fflags +genpts -i "udp://@" -i "udp://@" -map 0:a -map 1:v -vsync 1 -af "aresample=async=1:min_hard_comp=0.100000:first_pts=0"  -max_interleave_delta 1  -c:v h264_nvenc -cbr 1 -b:v 500K -r:v 30000/1001 -c:a aac -b:a 128k -ac:a 2 -ar:a 48000 -flush_packets 1 -f mpegts -muxrate 1.2M  "udp://@"

More information about the ffmpeg-user mailing list