Saving frame data to a video file

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

zwang135

  • Posts: 4
  • Joined: Fri May 04, 2018 1:30 am
  • Real Name: Zicheng Wang

Saving frame data to a video file

PostFri May 04, 2018 8:09 am

Hello friends!

I'm currently working on extending the CapturePreviewCSharp example from the newest version of SDK, to get rid of some UI bugs of the Media Express. I want it to save the captured videos to local, just like Media Express does; however, after spending couple hours learning SDK, I still couldn't figure out how.

Basically my problem is idk how to deal with the frame data that I get from calling GetBytes() under VideoInputFrameArrived(). How do I convert them to a video file? Can someone help me? Maybe providing me a short example? I appreciated it!
Offline

zwang135

  • Posts: 4
  • Joined: Fri May 04, 2018 1:30 am
  • Real Name: Zicheng Wang

Re: Saving frame data to a video file

PostMon May 07, 2018 7:45 am

Can someone tell me what is contained in the data buffer of a video frame? Is it simply the data representing an image? Or it does contain something else? Thanks!
Offline

Tiago Magalhães

  • Posts: 2
  • Joined: Mon Jul 25, 2016 3:14 pm

Re: Saving frame data to a video file

PostMon May 07, 2018 5:52 pm

The buffer you get form GetBytes contains the raw pixel data for that single frame.
Offline

Cameron Nichols

Blackmagic Design

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

Re: Saving frame data to a video file

PostThu May 17, 2018 12:11 am

Hi Zicheng,

The IDeckLinkVideoFrame::GetBytes method provides raw pixel data as per the captured pixel format (See 2.7.4 Pixel Formats in the DeckLink SDK manual).

In the most recent DeckLink SDK 10.10, there is a sample StillsCSharp as an example for using GetBytes to convert captured frame to bitmap.

I hope this is useful to you.

Regards
Cameron
Offline

zwang135

  • Posts: 4
  • Joined: Fri May 04, 2018 1:30 am
  • Real Name: Zicheng Wang

Re: Saving frame data to a video file

PostThu May 17, 2018 2:04 am

Tiago Magalhães wrote:The buffer you get form GetBytes contains the raw pixel data for that single frame.

Thanks Tiago, I spent couple days and finally figured out how to convert those data to correct images.

Cameron Nichols wrote:Hi Zicheng,

The IDeckLinkVideoFrame::GetBytes method provides raw pixel data as per the captured pixel format (See 2.7.4 Pixel Formats in the DeckLink SDK manual).

In the most recent DeckLink SDK 10.10, there is a sample StillsCSharp as an example for using GetBytes to convert captured frame to bitmap.

I hope this is useful to you.

Regards
Cameron

Hi Cameron, I just checked out this example in the new SDK, which is really helpful to me. I will start working on this example, thank you!

Return to Software Developers

Who is online

Users browsing this forum: No registered users and 1 guest