[FFmpeg-user] ffmpeg and input bursty video frames
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://@126.96.36.199:2000?fifo_size=2485760&buffer_size=851968&timeout=800000&overrun_nonfatal=1" -i "udp://@188.8.131.52:2000?fifo_size=2485760&buffer_size=851968&timeout=800000&overrun_nonfatal=1" -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://@184.108.40.206:10102?pkt_size=1316&fifo_size=1242880&buffer_size=932160&timeout=800000&overrun_nonfatal=1&bitrate=1200000"
More information about the ffmpeg-user