Media Handler Pro Version 4.0

Documentation of Media Handler Pro version 4.0 component.

Note: Please update your component if you are using older version of Media Handler Pro component.

what's new:

New features have been added and existing features are upgraded in this version of Media Handler Pro component. Detail is below:
  • Splitting video in small clips.
  • Grabbing multiple thumbs in more improved way.
  • Additions of new properties, padding videos, cropping videos, controlling video processing time and lots of new improvements.
  • Return video information in proper videoinfo object rather than string value which requires lots of code while parsing values.
  • More effective control on handling errors while processing videos or parsing video information.

Media Handler Pro required properties:

You must setup these properties if you use any function of Media Handler Pro to encode video, extract audio grab thumbs and post watermark on videos.
Properties Type Detail Information
FFMPEGPath
string FFMPEGPath is used to setup ffmpeg.exe file path.
FLVToolPath
string Its required property if you want to use Set_Buffering() function and is used to setup flvtool2.exe file path, normally it is located in flvtool folder.
InputPath
string InputPath is used to setup folder path where source video exist. The path of video that need to be encoded.
OutputPath
string OutputPath is used to setup folder path where destination video will be stored. Encoded video, audio and thumbnail will be stored here.
FileName
string FileName is used to setup filename of destination video. The name of video or audio file which need to be encoded to another format.

Media Handler Pro video and audio related properties:

Properties defined below can be used to customize settings of encoded video.
Properties Type Detail Information
ExitProcess
new
int Default : 30000 milliseconds. It controls the processing of video and exit if processing takes more time than is set through this parameter. It controls deadlock and server crash issues.
OutputFileName
string OutputFileName is used to setup output filename, if its not provided then same video name will be setup as source video with different video extensions. (optional)
Width
int Set width of encoded video. You must supply height of video also and make sure width is multiple of 2. Be default width and height of encoded video is same as source video width and height. (optional)
Height
int Set height of encoded video. You must supply width of video also and make sure height is multiple of 2. Be default width and height of encoded video is same as source video width and height. (optional)
Video_Bitrate
double Set video bitrate of encoded video in kbps. By default video bitrate will be same as source video or higher in case of MaxQuality property is true. (optional)
Audio_Bitrate
double Set audio bitrate of encoded video in kbps. By default audio bitrate will be same as source video. (optional)
Audio_SamplingRate
int Set audio sampling rate of encoded video in kbps. By default audio bitrate will be same as source video. (optional)
FrameRate
double Set video frame rate per seconds. By default it will be same as source video.
OutputExtension
string Set custom extension for output video. e.g "mp2" will set and encode output video accoding to "mp2" audio format.
Duration
string Duration in seconds or in "hh:mm:ss" format used to limit any video to certain limit. By Default complete video will be encoded. If you want to limit video to 2 minites then pass 120 to Duration property.
Start_Position
new
string Start_Position set the starting point of video encoding. It must be in seconds or in "hh:mm:ss" format. e.g '10' or '00:00:10' will force video encoding to be started from 10th of second.
Deinterlace
bool Setting value to true will enable deinterlace option for encoded video. Default value is false.
MaxQuality
bool Setting value to true will generate highest quality video. If you enable MaxQuality option then video bitrate will no longer work.
VCodec
string Set video codec, default value depends on type of video to be encoded.
ACodec
string Set audio codec, default value depends on type of video to be encoded.
Force
new
string It force encoded video to be generated in same format as specified, e.g in case of flv video their value should be like Force ='flv';
DisableAudio
bool Disable audio in encoded video.
DisableVideo
bool Disable video in encoded video. It is used to extract audio from any video file or from audio files.
Channel
int Set audio channgel. Default is 1.
AspectRatio
double Set video aspect ratio for encoded video, e.g 1.3333, 1.7777
TargetFileType
string Set default video and audio options for encoded video, it is used when you encode video to .mpg and .avi format. typical values are "vcd", "svcd", "dvd", "dv", "dv50", "pal-vcd", "ntsc-svcd". Default value is "pal-vcd".
CustomCommand
string It is used to excute your own custom ffmpeg command.
Parameters
new
string

Through Parameters property you can pass advance parameter for video processing commands. e.g for mp4 video encoding sometime you can pass some advance parameters like

Parameters = "-mbd 2 -cmp 2 -subcmp 2";

PadTop
new
int

Set top padding of video in pixels

PadBottom
new
int

Set bottom padding of video in pixels

PadLeft
new
int

Set left padding of video in pixels

PadRight
new
int

Set right padding of video in pixels

PadColor
new
string

Set padding color in hexa decimal format e.g for white background its value should be like PadColor='ffffff';

CropTop
new
int

Crop top portion of video in pixels

CropBottom
new
int

Crop bottom portion of video in pixels

CropLeft
new
int

Crop left portion of video in pixels

CropRight
new
int

Crop right portion of video in pixels

Gop_Size
new
int

Set the group of picture size. Mainly used to insert keyframes in videos.

Bitrate_Tolerance
new
int

Set video bitrate tolerance (in bits, default 4000k). Has a minimum value of: (target_bitrate/target_framerate). Lowering tolerance too much has an adverse effect on quality.

Limit_File_Size
new
int

Set the file size limit.

MaxRate
new
int

Set max video bitrate (in bit/s). Requires BufferSize to be set.

MinRate
new
int

Set max video bitrate (in bit/s). Requires BufferSize to be set.

BufferSize
new
int

Set video buffer verifier buffer size (in bits).

Pass
new
int

Select the pass number (1 or 2). It is used to do two-pass video encoding.

Scale_Quality
new
int

To have a constant quality (but a variable bitrate), use the option Scale_Quality and its value is between 1 (excellent quality) and 31 (worst quality).

Media Handler Pro image related properties:

Properties defined below can be used to grab thumbnails from video.
Properties Type Detail Information
Frame_Time
string Time in seconds or "hh:mm:ss" in video from where you want to capture thumbnail
ImageName
string Name of thumbnail if you want to set, Default value will be same as source video.
Image_Format
string Image Format in which you want to save thumbnail like "jpg", "png"
No_Of_Thumbs
int No of thumbs you want to capture from video. Work if "Multiple_Thumbs" property enable.
Multiple_Thumbs
bool Default "false", it shows whether multiple thumbs are enable.
Thumb_Transition_Time
int Time between two thumbs in seconds, default is "1". If Auto_Transition_Time enable, it will be automatically calculated.
Thumb_Start_Position
int Start Position of thumbs to be capture from video in seconds.
Auto_Transition_Time
bool Default "false", Setting this value to "true" will calculate "Thumb_Transition_Time" according to video duration and will grab thumbs properly.

Media Handler Pro watermark related properties:

Properties defined below can be used to post watermark on videos.
Properties Type Detail Information
WaterMarkPath
string Path of folder where watermark image resides. It is required property if you want to post watermark on video
WaterMarkImage
string WaterMarkImage name sets name of watermark image that will be posted on video as watermark. Note it must be transparent and in gif format.

Media Handler Pro Methods:

Method Detail Information
isAudio()
isAudio function can be used to check whether specified video is in audio or video format
return type is string.
Detail
Encode_FLV()
Encode any format video to flv format, now in one step you can encode video to flv format, post watermark on video and customize lots of flv attributes by using properties describe above.
Detail
Encode_MPG()
Encode any format video to mpg format and post watermark on it.
Detail
Encode_AVI()
Encode any format video to avi format and post watermark on it.
Detail
Encode_3GP()
Encode any format video to 3gp format. Note watermark feature is not available for .3gp videos
Detail
Encode_WMV()
Encode any format video to wmv video format and post watermark on it.
Detail
Encode_MOV()
Encode any format video to mov video format and post watermark on it.
Detail
Encode_MP4()
Encode_M4V()
Encode_M4A()
Encode any format video to mp4, m4v and m4a video and audio format and post watermark on it except mpa.
Detail
Encode_MP3()
Encode any format video to mp3 audio file. Note while generating mp3 audio file video properties will be excluded.
Detail
Encode_WMA()
Encode any format video to wma audio file. Note while generating wma audio file video properties will be excluded.
Detail
Grab_Thumb()
Grab single thumbnail image from video at any specified time interval and in any image format.
Detail
Get_Info()
Get useful information from any format video. Information included video filename, video bitrate, audio bitrate, audio sampling rate etc.
Detail
Execute_FFMPEG()
Execute your own FFMPEG command, available in full version of Media Handler Pro
Detail
Set_Buffering()
Set Meta-Information for flv videos
Detail
Split_Video()
Split videos in many clips, available only in full version of Media Handler Pro component.
Detail
©2007 - 2009, MediaSoft Pro Inc  | Site Map