Convert Video to Image and Save

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

vijay.meganathan

  • Posts: 4
  • Joined: Thu Feb 16, 2017 4:22 pm

Convert Video to Image and Save

PostThu Feb 16, 2017 4:25 pm

Could you please help me how do I convert the video frame received in call back method to an image of JPEG format.


These are my settings


_BMDDisplayModeSupport displayModeSupport;
IDeckLinkDisplayMode displayMode = null;

_BMDDisplayMode setDisplayMode = _BMDDisplayMode.bmdModeHD720p50;
_BMDPixelFormat setPixelFormat = _BMDPixelFormat.bmdFormat8BitYUV;
_BMDVideoInputFlags setInputFlag = _BMDVideoInputFlags.bmdVideoInputFlagDefault;


public void VideoInputFrameArrived(IDeckLinkVideoInputFrame video, IDeckLinkAudioInputPacket audio)
{
try
{

//get image data
IntPtr pData;
video.GetBytes(out pData);


}
catch (Exception em)
{
MessageBox.Show("deck link init failed: " + em.Message);
}
}
Offline

Dave Johnstone

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

Re: Convert Video to Image and Save

PostSat Feb 18, 2017 7:31 am

You could use libjpeg, this has the capability to perform the compression (colourspace conversion, if required) and file handling. Take a look at the docs here: https://www.freedesktop.org/wiki/Software/libjpeg/

Regards,

Dave.
Freelance Television Broadcast Engineer
and Software Programmer.
Offline

vijay.meganathan

  • Posts: 4
  • Joined: Thu Feb 16, 2017 4:22 pm

Re: Convert Video to Image and Save

PostMon Feb 20, 2017 3:18 pm

I need a c# example

Return to Software Developers

Who is online

Users browsing this forum: No registered users and 19 guests