Very high latency (0.7 sec.) with DeckLink Duo and ffmpeg

Ask software engineering and SDK questions for developers working on Mac OS X, Windows or Linux.
  • Author
  • Message
Offline

LukaszLazarecki

  • Posts: 7
  • Joined: Mon Feb 10, 2020 10:28 am
  • Real Name: Lukasz Lazarecki

Very high latency (0.7 sec.) with DeckLink Duo and ffmpeg

PostMon Feb 10, 2020 10:46 am

I'm observing about 0.7 sec. latency when capturing video from one of Duo's inputs and simultaneously outputting it to one of its outputs, like so:

Reading from input:
Code: Select all
ffmpeg -y -f decklink -i "DeckLink Duo (1)" -vf "yadif=deint=interlaced, scale=1920:1080, fps=fps=30" -vcodec rawvideo -pix_fmt bgr24 -f nut /tmp/test_pipe

Writing to output:
Code: Select all
ffmpeg -v debug -f nut -i /tmp/test_pipe -vf "scale=1280:720, fps=fps=60" -preroll 2/60 -pix_fmt uyvy422 -an -f decklink "DeckLink Duo (3)

With the above latency is about ~0.7 sec. However, if I change output to sdl local preview, like so:
Code: Select all
ffmpeg -f nut -i /tmp/test_pipe -vf "scale=1280:720, fps=fps=60" -an -vcodec rawvideo -preroll 2/60 -pix_fmt yuv420p -f sdl Preview


Latency drops to ~0.2 sec. (which is still very high, but for some reason not as high as when outputting to the card).

I really have no idea what is going on. I was expecting 2-3 frames of latency at most, but what I'm getting is insane. Is there anything wrong with how ffmpeg is launched (params missing?)?

A few words of explanation:
- I'm streaming through pipe, because there's (obviously) another app between input and output doing the processing, however it does not create any additional latency and numbers stay the same with the app in between or without it
- video filters used do not introduce any additional latency, I tested with and without them
Offline

LukaszLazarecki

  • Posts: 7
  • Joined: Mon Feb 10, 2020 10:28 am
  • Real Name: Lukasz Lazarecki

Re: Very high latency (0.7 sec.) with DeckLink Duo and ffmpe

PostTue Feb 11, 2020 3:30 pm

I had some time to test this since I posted the original question. I replaced the ffmpeg with bmdplay, which looks super straightforward. However, the delay is still there, about 0.5 sec. more than when not streaming from the card and just previewing in ffmpeg/ffplay.

Return to Software Developers

Who is online

Users browsing this forum: No registered users and 26 guests