[FFmpeg-user] Duplicated frames when streaming to decklink

Marton Balint cus at passwd.hu
Thu Oct 17 23:32:13 EEST 2019



On Thu, 17 Oct 2019, Valentin Schweitzer wrote:

> Hi,
>
> I am trying to stream audio and video in an endless loop from a file to
> a DeckLink Duo 2 on Windows 10. When streaming in this loop,
> ffmpeg reports duplicated frames approximately at the time
> the loop starts anew. The command I'm using is the following:
> .\ffmpeg.exe -loglevel verbose -re -stream_loop -1 -i trailer_stereo.mp4
> -pix_fmt uyvy422 -f decklink "81:4108a8c0:00000000"  2>stereo.log
> where trailer_stereo.mp4 is a file containing a h264 stream at 25fps
> and a resolution of 1920x1080 and an aac stream at 48000Hz.
>
> The trailer_stereo.mp4 file was created by converting the
> original (see 1.) from 5.1 audio to stereo with
> .\ffmpeg.exe -i .\trailer_1080p.mov -vcodec copy -acodec aac -ac 2
> trailer_stereo.mp4
>
> After approximately every loop there seems to be a buffer underrun
> for both video and audio and a few frames are duplicated.
> When running this for a longer time period
> the decklink stream becomes unusable.
>
> As the audio and video streams do not appear to be equal in length,
> I then tried to cut the file down to the length of the shortest stream.
> The file was truncated using -shortest (again, starting from the
> file linked below (see 1.)) with this command:
> .\ffmpeg.exe -i .\trailer_1080p.mov -vcodec copy -acodec aac -ac 2
> -shortest trailer_stereo_shortest.mp4
>
> Now, duplicate frames still appear, but no buffer underrun is reported
> (at least not this early on), when streaming it with:
> .\ffmpeg.exe -loglevel verbose -re -stream_loop -1 -i
> trailer_stereo_shortest.mp4 -pix_fmt uyvy422 -f decklink
> "81:4108a8c0:00000000" 2> shortest.log

-re should not be used here. Also you should try this with uncompressed 
audio. AAC has priming at the start and at the end which is usually not 
discarded properly by ffmpeg causing audio/video length differences.

Regards,
Marton


More information about the ffmpeg-user mailing list