3GP Video

3GP is a simplified version of the MPEG-4(MP4) container format, designed to decrease storage and bandwidth requirements in order to accommodate mobile phones. It stores video streams as MPEG-4 or H.263, and audio streams as AMR-NB, AMR-WB, AMR-WB+ or ACC-LC. It also contains descriptions of image sizes and bitrate.

Media Handler Pro can be used to create 3GP video files in order to play video on mobile phones, view examples below or contact us for more help.

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

Sample Code: Encode video to 3gp Video

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";

// start processing video

string output = _mhandler.Encode_3GP();

// validate output with error codes in order to make sure 3gp video is published successfully.

©2007 - 2008, MediaSoft Pro Inc  | Site Map