3GP Video

ASP.NET Media Handler Pro can be use to encode any format video to .3gp foramt in order to play on mobile phones via quicktime player or any other compatible players.

Sample codes and detail about encoding or publishing videos to .3gp format is available below.

All examples available is compatible with ASP.NET Media Handler Pro version 3.0 or later. If you need more information conntact us.

Sample Code: Encode video to 3gp format - C#

Sample code for encoding video to .3gp video using Media Handler Pro version 3.0.
Using Encode_3GP() function default options

// Sample code for encoding any format video to .3gp 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\\3gp";
_mhandler.FileName = "sample.mpg";

// optional output filename

_mhandler.OutputFileName = "sample.3gp";

// publish video to .3gp format with default options.

string output = _mhandler.Encode_3GP();

// this will generate .3gp video with default options. if you want to customize values then set values as shown below.

// setting video related properties

_mhandler.Video_Bitrate = 100;
_mhandler.Audio_Bitrate = 12.2;
_mhandler.Audio_SamplingRate = 8000;

// optional video width and height settings

_mhandler.Width = 176;
_mhandler.Height = 144;

// optional video and audio codec settings, make sure it is compatible with 3gp video otherwise result in failure of video encoding.

_mhandler.ACodec = "libamr_nb";
_mhandler.VCodec = "h263";

// view more options in component documentation.

// Encode 3GP Video using Media Handler Pro version 3.0

string output = _mhandler.Encode_3GP();

// Encode 3GP Video using Media Handler Pro version 4.0 or later

VideoInfo info = _mhandler.Encode_3GP();

// 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