Get information from video:

In order to display video on the web properly and for further processing, both online and offline you require lots of video information. Video information is necessary both for web applications and desktop applications for its internal use. You can use MediaHandlerPro component to get lots of video information from any video format. Video information includes get duration, audio bitrate, video bitrate, audio sampling rate from videos.

You can also use MediaHandlerPro to check whether current video is in audio format and video format.

Media Handler Pro Version 3.0 Example.

You can use Media Handler Pro version 3.0 to get useful information from video. Note for older version please view examples below.

Check whether current source video is in audio format and video format.

MediaHandler _mhandler = new MediaHandler();
_mhandler.InputPath = RootPath + "\\contents\\videos";

string file = _mhandler.isAudio();
if (file == "audio")
Response.Write("Current file is in audio format");
else
Response.Write("Current file is in video format");

 

Get Video information

MediaHandler _mhandler = new MediaHandler();
_mhandler.InputPath = RootPath + "\\contents\\videos";

string file = _mhandler.Get_Info();

string[] _arrstr;
_arrstr = file.ToString().Split(char.Parse(","));
// Get Video Duration
string duration = _arrstr[0].Remove(0, _arrstr[0].IndexOf(":") + 1);

// You can get more video information by incrementing array value [0],[1], etc.

Sample Codes.

View some samples and examples below to check how to get video information and check whether video is in audio or video format.
Check whether current source video is in audio format and video format.

 

string file = _mhandler.is_Audio(filename, _ffmpegpath, InputPath);
if (file == "audio")
Response.Write("Current file is in audio format");
else
Response.Write("Current file is in video format");

 

Get Video information

string file = _mhandler.Get_Video_Information(filename, _ffmpegpath, InputPath);
string[] _arrstr;
_arrstr = file.ToString().Split(char.Parse(","));
// Get Video Duration
string duration = _arrstr[0].Remove(0, _arrstr[0].IndexOf(":") + 1);

// You can get more video information by incrementing array value [0],[1], etc.

©2007 - 2008, MediaSoft Pro Inc  | Site Map