Audio and video capture timestamps drift apart

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

Christophe Massiot

  • Posts: 3
  • Joined: Tue Oct 04, 2016 7:57 pm

Audio and video capture timestamps drift apart

PostFri Jan 20, 2017 10:51 pm

Hi,

I have a customer complaining of audio/video drift when capturing HD-SDI with a Duo 2 (but I suspect other customers experience it with other DeckLink cards). The drift happens when there is a discontinuity on the SDI link : probably a video frame goes missing, and there are extra audio samples. At first it is not noticeable, but if you have one discontinuity a day for several weeks, the audio is delayed by several seconds.

In that state, VideoFrame->GetStreamTime returns timestamp t, and in the same callback AudioFrame->GetPacketTime returns timestamp t + 4 seconds. Should I assume that within the same callback, VideoFrame and AudioFrame should have the same presentation timestamp?

Best regards,
Offline
User avatar

nicodato

  • Posts: 4
  • Joined: Mon Mar 19, 2018 5:53 pm
  • Location: Argentina
  • Real Name: Nicolas Dato

Re: Audio and video capture timestamps drift apart

PostMon Mar 19, 2018 5:57 pm

Hello there,
I'm having the same issue. In my case I'm using DeckLink Mini Recorder capturing 2 HDMI inputs.

Adding more information to the original post.
In my case I see a discontinuity (flag bmdFrameHasNoInputSource) and the difference sometimes is positive and sometimes is negative. If I continue getting bmdFrameHasNoInputSource, this differences can get bigger or smaller.

I tried calling IDeckLinkInput->FlushStreams when I have a new frame after bmdFrameHasNoInputSource but it didn't restored the difference. I called FlushStreams from outside the callback (from an external thread)

Any thoughts?

Thanks.
3Way Solutions S.A.
http://www.3way.com.ar
Offline
User avatar

nicodato

  • Posts: 4
  • Joined: Mon Mar 19, 2018 5:53 pm
  • Location: Argentina
  • Real Name: Nicolas Dato

Re: Audio and video capture timestamps drift apart

PostWed Mar 21, 2018 2:43 pm

I found a workarround

Doing:
Code: Select all
IDeckLinkInput->StopStreams();
IDeckLinkInput->FlushStreams();
IDeckLinkInput->StartStreams();

The timestamps difference restores to 0 (or near 0) and the synchronization is kept.

I do it after the signal comes back, when receiving a valid frame after a bmdFrameHasNoInputSource. Perhaps this could be done during the signal cut. And I'm not sure FlushStreams() is needed.

Anyway, I'll wait for an answer from Blackmagic and I'll keep this topic updated if I found something new.

Regards.
3Way Solutions S.A.
http://www.3way.com.ar
Offline
User avatar

nicodato

  • Posts: 4
  • Joined: Mon Mar 19, 2018 5:53 pm
  • Location: Argentina
  • Real Name: Nicolas Dato

Re: Audio and video capture timestamps drift apart

PostMon Apr 09, 2018 1:09 pm

I contacted bmd's developer support and this was the reply:

This is a pre-existing issue to be addressed in a future release.
In the meantime, the recommended workaround is to do as you are doing currently (i.e. stop streams(), flush streams() and startstreams()) in the event of signal interruption/discontinuity.
3Way Solutions S.A.
http://www.3way.com.ar
Offline
User avatar

nicodato

  • Posts: 4
  • Joined: Mon Mar 19, 2018 5:53 pm
  • Location: Argentina
  • Real Name: Nicolas Dato

Re: Audio and video capture timestamps drift apart

PostWed May 16, 2018 11:50 pm

I have been contacted by Blackmagic informing me that this issue has been fixed on version 10.10 (which has been released today).

Thanks to blackmagic developers for fixing this and keep me up to date!
3Way Solutions S.A.
http://www.3way.com.ar

Return to Software Developers

Who is online

Users browsing this forum: No registered users and 3 guests