Live Chat with Operator
Home >  Media Handler Pro >  ASP.NET Encoding Guides > Setting MP4 Meta Information

Setting MP4 Meta Information Using ASP.NET Media Handler Pro

MP4 video published or encoded by tools ffmpeg or other open source utilities using libx264 codecs pack is in non streameable format. Means if you want to play it on HTML5 or Flash Players on the web. It will need to be downloaded completely before start playing.

In order to stream mp4 video properly using HTML5 or Flash Players via any streaming protocol (http, server scripting, rtmp) you need to set its meta information.

ASP.NET Media Handler Pro uses mp4box to set meta information for mp4 videos once publishing or encoding completes.

ASP.NET Media Handler Pro can be used to publish or encode any video format to .webm format on the fly in real time in order to play it on HTML5 compatible browsers and devices (ipad, iphone etc).

Sample Code for Setting Meta Information to MP4 Video

Below is the sample code which can be used to set meta information to mp4 videos in order to stream properly on HTML5 or Flash players on the web.

// Set non streamable mp4 video path
string _mp4_org_path = "\"" + this.OutputPath + "\\Sample.mp4";
// Set mp4box path
_mhandler.MP4BoxPath = RootPath + "\\mp4box\\mp4box.exe";
// Prepare mp4box meta information parameters
_mhandler.Parameters = "-isma -hint -add " + _mp4_org_path + "";
// Set final mp4 video path
_mhandler.FileName = "Sample_Final.mp4";
// Set path of folder where final mp4 video will store
_mhandler.InputPath = this.OutputPath;
// Start mp4 meta information process
_mhandler.Set_MP4_Buffering();

Once video generated properly, just upload it on live server and test it while playing on HTML5 or Flash Player. You will see progressive downloading, buffering of mp4 video while streaming.

If you like this article, please recommend this to google.
© 2007 - 2012, mediasoftpro.com  | Site Map | Privacy Policy | Terms of Use