Image to Video

Image to Video

Media Handler Pro 5.0 or later supports converting a sequence of images to video format.

Requirements:
  • Images must be in sequence e.g sample_001.jpg, sample_002.jpg ...
  • Images must be in .jpg format.
  • See sample code for publishing thumbs to the video file below.
Sample Code thumbs to video conversion


MediaHandler _mhandler = new MediaHandler();
string RootPath = Server.MapPath(Request.ApplicationPath);
_mhandler.FFMPEGPath = HttpContext.Current.Server.MapPath("~\\ffmpeg\\ffmpeg.exe");
_mhandler.InputPath = RootPath + "\\contents\\source";
_mhandler.OutputPath = RootPath + "\\contents\\output";
_mhandler.FileName = "sample_"; // represent sample_001.jpg, sample_002.jpg etc.
_mhandler.OutputFileName = "sample";
_mhandler.OutputExtension = ".flv";
// Call method to process parameters
VideoInfo info = _mhandler.ImagesToVideo();
if (info.ErrorCode > 0)
{
       Response.Write("Error occured: Error Code: " + info.ErrorCode + "<br />Error Message: " + info.ErrorMessage);
       return;
}