How to display frames received from VideoInputFrameArrived

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

Giovanni Russo

  • Posts: 2
  • Joined: Fri Jul 21, 2017 5:28 pm

How to display frames received from VideoInputFrameArrived

PostMon Jul 24, 2017 4:44 pm

Hi,

I bought a decklink mini recorder and I'm trying to create an application in WPF - C# (.NET) (vs2013 s.o. windows 10)

My application has two preview sections called "preview hdmi" and "preview sdi" and 2 buttons called "hdmi in" and "sdi in".
When I click on the "hdmi in" button (connected external camera with 1920i60 resolution) I reproduce the video in input in the "preview hdmi" section.
When I click on the "sdi in" button (connected external camera with 1920i60 resolution) I play the video in input in the "preview sdi" section.

I'd like to get something similar to the CapturePreview example, but unfortunately I do not know the C++ language

I helped with the only example in C# SignalGenCSharp

I have read Chapter 2.4.1 Capture Manual and relying on the SignalGenCSharp project have been able to receive calls to IDeckLinkInputCallback::VideoInputFrameArrived with video frame and corresponding audio packet.

In the next steps I have difficulty understanding how to display (on monitor) frames received from callback VideoInputFrameArrived


Seeing the CapturePreview project within the VideoInputFrameArrived method calls the GetAncillaryDataFromFrame Method 5 times by referencing frame timecodes and userbits and after calling the UpdateAncillaryData method.
 
My problem is I do not know how to translate these 2 methods into C# and also i do not know which element to use to preview (mediaelement? PictureBox?) (I've read Chapter 2.4.7 Ancillary Data Functionality and VANC Capture, but unfortunately I did not help much)

Thanks in advance for the help.
Offline

Giovanni Russo

  • Posts: 2
  • Joined: Fri Jul 21, 2017 5:28 pm

Re: How to display frames received from VideoInputFrameArriv

PostWed Aug 02, 2017 7:44 am

Good morning,

After 10 days no one can give me an answer.

The question is not clear?

Thanks in advance.
Offline

Jules Davis

  • Posts: 7
  • Joined: Wed Apr 12, 2017 9:14 am
  • Location: Surrey, UK

Re: How to display frames received from VideoInputFrameArriv

PostFri Aug 04, 2017 4:31 pm

The challenge with your question is that it covers such a lot of ground, it is difficult to answer quickly. I can attempt to summarise and then you could refine the question.

IDeckLinkInputCallback::VideoInputFrameArrived delivers you a IDeckLinkVideoInputFrame object.

This frame object has GetRowBytes to retrieve a pointer to the raw pixel data and a GetStreamTime method to retrieve the timecode.

The pixel data is an array of pixels in whatever pixel format you selected arranged as an array of width x height x sizeof of a pixel in bytes.

In principal you then point your display method at the raw pixel data and then it copies it somewhere for display. Alternatively you create a bitmap, copy and transform the pixel format of the input to the bitmap format.

Once you have copied the pixels, you return from the arrived function.

Some other thread then has to display the copy on the screen.
--
Jules Davis
CTO Focal Point VR Ltd

Return to Software Developers

Who is online

Users browsing this forum: No registered users and 1 guest