Extracting Frames from video and Re encoding images into video using Media Handler Pro.

4 views
Skip to first unread message

shane

unread,
Jul 9, 2010, 6:28:26 AM7/9/10
to mediasoftpro
Hi,

You can use the following code through ASP.NET Media Handler Pro
component to extract all frames of video into jpg images.

Extracting Frames:

_mhandler.InputPath = RootPath + "\\contents\\original";
_mhandler.OutputPath = RootPath + "\\contents\\thumbs";
_mhandler.FileName = "xmen-origins-wolverine.mp4";
_mhandler.OutputFileName = "sample_";
_mhandler.OutputExtension = "%010d.jpg";
_mhandler.Force = "image2";
VideoInfo info = _mhandler.Process();

Re Encoding Frames / Images into Video:

Example below will encode all jpg frames into flash flv video, you can
encode it in any format.

_mhandler.InputPath = RootPath + "\\contents\\thumbs";
_mhandler.OutputPath = RootPath + "\\contents\\flv";
_mhandler.FileName = "sample_.%010d.jpg";
_mhandler.OutputFileName = "sample_img_vid";
_mhandler.OutputExtension = "flv";
_mhandler.Force = "flv";
// _mhandler.MaxQuality = true;
_mhandler.Audio_Bitrate = 32;
_mhandler.Audio_SamplingRate = 22050;
VideoInfo info = _mhandler.Process();

If you receive Error Code 101, you can request updated MHP through our
support email.

Regards.
Reply all
Reply to author
Forward
0 new messages