- Posts: 1
- Joined: Wed Dec 14, 2016 8:14 am
Hello Seowoo,
I would recommend the Windows CapturePreview sample (Win\Samples\CapturePreview\) as a starting point to capture an image.
In the CapturePreview sample, file DeckLinkDevice.cpp, please see function DeckLinkDevice::VideoInputFrameArrived [1] which is the callback which receives captured video frames.
The IDeckLinkVideoInputFrame parameter to the callback is a reference to the captured video frame. The GetBytes [2] method of the videoFrame parameter can be used to obtain access to the raw video buffer.
To get an overall understanding of the process, see SDK Manual section "2.4.1 Capture" for a high level overview of the steps required to perform a capture operation.
Please see SDK Manual section "2.7.4 Pixel Formats", and the other methods in the IDeckLinkVideoFrame interface (GetHeight, GetRowBytes, etc.) for the information required to interpret the raw video buffer.
Regarding capturing an image as BMP or JPG, please note that the DeckLink SDK provides access to the raw video data, but does not include interfaces for file IO, video codecs or image file formats. Writing the captured video frames to disc is an application concern.
Your application will then need to implement / integrate code to store the raw video buffer in the required file format (BMP/JPG).
Could you please share the code snippet where you are calling the IDeckLinkVideoFrame->GetBytes() method?
Regards
Waqqas
[1] 2.5.10.1 IDeckLinkInputCallback::VideoInputFrameArrived method
[2] 2.5.5.6 IDeckLinkVideoFrame::GetBytes method