AVI Video

Media Handler Pro can be used to create AVI video files. View examples below or contact us for more help.

Example shown below is related with Media Handler Pro version 3.0 or later.

Sample Code: Encode video to AVI Video - C#

Sample code for encoding video to .avi video using Media Handler Pro version 3.0.
Using Encode_AVI() function default options

// Sample code for encoding any format video to avi format.
MediaHandler _mhandler = new MediaHandler();

// required properties

string RootPath = Server.MapPath(Request.ApplicationPath);

_mhandler.FFMPEGPath = HttpContext.Current.Server.MapPath("~\\ffmpeg\\ffmpeg.exe");
_mhandler.InputPath = RootPath + "\\contents\\video";
_mhandler.OutputPath = RootPath + "\\contents\\avi";
_mhandler.FileName = "sample.mpg";

// optional output filename

_mhandler.OutputFileName = "sample.avi";

// loading automatic video and audio settings for avi video. view detail about TargetFileType in documentation.

_mhandler.TargetFileType = "pal-vcd";

// optional video width and height settings

_mhandler.Width = 320;
_mhandler.Height = 240;

// posting watermark on avi video, view detail in watermark section
_mhandler.WaterMarkPath = RootPath + "\\contents\\watermark";
_mhandler.WaterMarkImage = "watermark.gif";

// Encode AVI Video using Media Handler Pro version 3.0

string output = _mhandler.Encode_AVI();

// Encode AVI Video using Media Handler Pro version 4.0 or later

VideoInfo info = _mhandler.Encode_AVI();

// Check for errors
if (info.ErrorCode > 0)
{
Response.Write("Video processing failed, Error code " + info.ErrorCode + " generated");
return;
}

// Retrieve output information from VideoInfo Object. View Detail


©2007 - 2009, MediaSoft Pro Inc  | Site Map