LoopThroughwithOpenGlCompositing playout latency

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

Uddipan Mukherjee

  • Posts: 2
  • Joined: Sat Oct 22, 2016 11:43 pm

LoopThroughwithOpenGlCompositing playout latency

PostSat Oct 22, 2016 11:48 pm

Hello,

I have a decklink duo 2 card and I was trying out the sample applications. The application LoopThroughWithOpenglCompositing shows a latency of about 200ms when I use it to capture from a live camera and play out on an external samsung tv. The opengl window on screen (the native host computer with the card) does not show this latency. This latency exists even without any OpenGL overlay drawn on top. How can this latency be removed? I am working on a live broadcast scenario and this latency is unacceptable. Interestingly, the Mediaexpress application does not show this latency. So I am assuming there must be something that can be done in the sample code to avoid this ? Please help.

Thanks
U.
Offline

Ian Morrish

  • Posts: 591
  • Joined: Sun Jan 18, 2015 9:24 pm
  • Location: New Zealand

Re: LoopThroughwithOpenGlCompositing playout latency

PostFri Oct 28, 2016 4:27 am

Loopthrough implies that the input signal is passed directly through to the output and the cards internal keyer is used to superimpose the OpenGL graphics on top.
This gives you 1 frame delay between input and output. I use this in CasparCG to display template content on top of the video. This is how you would do it in broadcast.

When you say "external samsung tv", is that connected to the SDI output of the Decklink card (using an SDI to HDMI converter) or just connected to the computer and just seeing the preview window(which would not be the "broadcast" way of doing it)?
Regards,
Ian Morrish
Video Integrated Scripting Environment
(Windows PowerShell with ATEM driver + more)
https://ianmorrish.wordpress.com
Offline

Dave Johnstone

  • Posts: 223
  • Joined: Mon Dec 08, 2014 11:12 am
  • Location: Adelaide

Re: LoopThroughwithOpenGlCompositing playout latency

PostFri Oct 28, 2016 9:56 pm

I believe this sample captures the input, overlays the scene then sends to the output (I remember it required 2 cards in the old half-duplex card days) which probably accounts for some of the latency. I agree with Ian - the correct way to do it is to use the built-in keyer. A small modification can be made to the OpenGLOutput sample enabling the keyer, then a 32bit GL scene will key over your incoming video.

Regards,

Dave.
Freelance Television Broadcast Engineer
and Software Programmer.
Offline

Uddipan Mukherjee

  • Posts: 2
  • Joined: Sat Oct 22, 2016 11:43 pm

Re: LoopThroughwithOpenGlCompositing playout latency

PostThu Nov 03, 2016 3:09 pm

Thanks a lot. Isn't the sample app LoopThroughWithOpenGLCompositing using the internal keyer? If not, how do I use it explicitly?
Yes, I am using the card's SDI output to feed in to the monitor through a SDI to HDMI converter. I also tried a SONY 3D monitor which takes SDI input and I feed the cards output directly to it, but seeing the same latency.
Offline

Ian Morrish

  • Posts: 591
  • Joined: Sun Jan 18, 2015 9:24 pm
  • Location: New Zealand

Re: LoopThroughwithOpenGlCompositing playout latency

PostTue Nov 08, 2016 1:09 am

CasparCG works well if the SDI 4K card is configured for internal key mode.
I measured 1 frame delay.
Video showing computer screen on right and output with overlay on left
Regards,
Ian Morrish
Video Integrated Scripting Environment
(Windows PowerShell with ATEM driver + more)
https://ianmorrish.wordpress.com
Offline

Dave Johnstone

  • Posts: 223
  • Joined: Mon Dec 08, 2014 11:12 am
  • Location: Adelaide

Re: LoopThroughwithOpenGlCompositing playout latency

PostTue Nov 08, 2016 11:59 am

Looking through the sample code, the keyer is never enabled. The sample captures video from the input channel, renders it on a cube then sends this to the output. It needs input and output channels (2x half-duplex cards or 1x 4k card) and the capture/render/blitting/outputting will be introducing the latency you observe. If you need the overlay with minimum latency - use the internal keyer (most cards have this built in) or use a card with key/fill capability and key your graphics with a vision mixer.

If this is your workflow, use the OpenGLOutput sample, enabling the card's keyer as I suggested earlier.

Screenshot from 2016-11-08 22-21-58.png
Decklink SDK Manual - Keyer Interface
Screenshot from 2016-11-08 22-21-58.png (40.72 KiB) Viewed 3150 times

Or, as Ian suggests, use CasparCG.

Regards,

Dave.
Freelance Television Broadcast Engineer
and Software Programmer.

Return to Software Developers

Who is online

Users browsing this forum: No registered users and 6 guests