FFmpeg + Decklink latency/delay of 1s

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

skrmm1

  • Posts: 6
  • Joined: Fri May 24, 2019 8:07 pm
  • Real Name: Askar Mamutov

FFmpeg + Decklink latency/delay of 1s

PostFri May 31, 2019 9:43 am

Ok, so we are capturing a stream from Decklink Duo 2 with ffmpeg with this command:

Code: Select all
ffmpeg -y -f decklink -i 'DeckLink Duo (4)@5' -vcodec h264_qsv -b:v 600k -maxrate 1200K -s 1920x1080 -aspect 16:9 -preset medium -maxrate 500K -g 50 -strict -2 -c:a aac -b:a 96k -ar 44100 -threads 0 -an output_test.mp4


And there's a 1 second delay at the beginning of each video(color bars), then everything is ok. FFmpeg says this right after entering command above:

[decklink @ 0x78b180] Found Decklink mode 1920 x 1080 with rate 25.00
[decklink @ 0x78b180] Frame received (#1) - No input signal detected - Frames dropped 1
Guessed Channel Layout for Input Stream #0.0 : stereo
....................................................................................
[decklink @ 0x78b180] Frame received (#12) - Input returned - Frames dropped 2


What can cause that 1s delay, cabling?
Offline

skrmm1

  • Posts: 6
  • Joined: Fri May 24, 2019 8:07 pm
  • Real Name: Askar Mamutov

Re: FFmpeg + Decklink latency/delay of 1s

PostSat Jun 01, 2019 8:19 am

I tried to capture the stream with one of Blackmagic samples with this command:
./Capture -d 3 -m 4 -p 0 -t serial -v output.raw


And it drops first frames too:
./Capture -d 3 -m 4 -p 0 -t serial -v output.raw
Capturing with the following configuration:
- Capture device: DeckLink Duo 2
- Video mode: 1080p25
- Pixel format: 8 bit YUV (4:2:2)
- Audio channels: 2
- Audio sample depth: 16 bit
Frame received (#0) - No input signal detected
Frame received (#1) - No input signal detected
Frame received (#2) - No input signal detected
Frame received (#3) - No input signal detected
Frame received (#4) - No input signal detected
Frame received (#5) - No input signal detected
Frame received (#6) - No input signal detected
Frame received (#7) - No input signal detected
Frame received (#8) - No input signal detected
Frame received (#9) - No input signal detected
Frame received (#10) [No timecode] - Valid Frame - Size: 4147200 bytes
Frame received (#11) [No timecode] - Valid Frame - Size: 4147200 bytes
Frame received (#12) [No timecode] - Valid Frame - Size: 4147200 bytes
Frame received (#13) [No timecode] - Valid Frame - Size: 4147200 bytes
Frame received (#14) [No timecode] - Valid Frame - Size: 4147200 bytes


As we can see here, first 10 frames are lost, that's around 1s of delay at the beginning, is it normal behavior?
Offline

skrmm1

  • Posts: 6
  • Joined: Fri May 24, 2019 8:07 pm
  • Real Name: Askar Mamutov

Re: FFmpeg + Decklink latency/delay of 1s

PostWed Jun 12, 2019 11:20 pm

Anyone? I think it's not a way to go, 1s delay!
Offline

Cameron Nichols

Blackmagic Design

  • Posts: 179
  • Joined: Mon Sep 04, 2017 4:05 am

Re: FFmpeg + Decklink latency/delay of 1s

PostFri Jun 14, 2019 5:30 am

Hi Askar,

Is the target DeckLink Duo 2 device configured as a half-duplex (device can operate either as capture of playback)? If so, then there will be slight delay as the connector is configured for input and then lock to incoming signal.

You may want to modify the Capture code to test incoming frames for transition from invalid to valid signal. Details can be found at the Developer FAQ page at https://www.blackmagicdesign.com/support/faq/59024 under heading Audio / Video stream time offset when capturing with DeckLink Duo 2 / Quad 2 in Half Duplex.

Regards
Cameron

Return to Software Developers

Who is online

Users browsing this forum: No registered users and 4 guests