You can use the following sample code to publish any format video to flash flv, mp4, vp8 webm, ogg vorbis, grab thumb in one step using ASP.NET Media Handler Pro.
Note: You need to download latest ffmpeg build with support of VP8 codec
Sample Code:
[quote]
_mhandler.InputPath = RootPath + "\\contents\\original";
_mhandler.OutputPath = RootPath + "\\contents\\output";
VideoInfo info = new VideoInfo();
_mhandler.FileName = "sample.wmv";
_mhandler.OutputFileName = "sample";
//***************************************
//FLV Encoding
//***************************************
_mhandler.OutputExtension = ".flv";
_mhandler.Video_Bitrate = 500;
_mhandler.Audio_Bitrate = 128;
_mhandler.Audio_SamplingRate = 44100;
_mhandler.Force = "flv";
info = _mhandler.Process();
if (info.ErrorCode > 0)
{
Response.Write("Error occured while processing flv video");
return;
}
_mhandler.Force = "";<
complete story
Everyone who has visited YouTube.com in the past four years knows that you can embed video in a web page. But prior to HTML5, there was no standards-based way to do this. Every video you've watched on the web has been funneled through a third party plugin (QuickTime, RealPlayer, Flash).
HTML5 defines a standard way to embed video in a web page, using a <video> element. Support for the <video> element is still evolving, which is a polite way of saying it doesn’t work yet. At least, it doesn’t work everywhere. But don’t despair! There are alternatives and fallbacks and options.
Video Codecs:
There are tons of video codecs. The three most relevant codecs are H.264, Theora, and VP8.
i
H.264 is also known as “MPEG-4 part 10,” a.k.a. “MPEG-4 AVC,” a.k.a. “MPEG-4 Advanced Video Coding.” H.264 was also developed by the MPEG group and standardized in 2003. It aims to provide a single codec for low-bandwidth, low-CPU devices (cell phones); high-bandwidth, high-CPU devices (modern desktop computers); and everything in between. To accomplish this, the H.264 standard is split into “profiles,” which each define a set of optional features that trade complexity for file size. Higher profiles use more optional features, offer better visual quality at smaller file sizes, take longer to encode, and require more CPU power to decode in real-time.
ii:
Theora evolved from the VP3 codec and has subsequently been developed by the Xiph.org Foundation. Theora is a royalty-free codec and is not encumbered by any known patents other than the original VP3 patents, which have been licensed royalty-free. Although the standard has been “frozen” since 2004, the Theora project (which includes an open source reference encoder and decoder) only released version 1.0 in November 2008 and version 1.1 in September 2009.
Theora video c
complete story
You can use the following code through
ASP.NET Media Handler Pro
component to extract all frames of video into jpg images.
Extracting Frames:
_mhandler.InputPath = RootPath + "\\contents\\original";
_mhandler.OutputPath = RootPath + "\\contents\\thumbs";
_mhandler.FileName = "xmen-origins-wolverine.mp4";
_mhandler.OutputFileName = "sample_";
_mhandler.OutputExtension = "%010d.jpg";
_mhandler.Force = "image2";
VideoInfo info = _mhandler.Process();
Re Encoding Frames / Images into Video:
Example below will encode all jpg frames into flash flv video, you can
encode it in any format.
_mhandler.InputPath = RootPath + "\\contents\\thumbs";
_mhandler.OutputPath = RootPath + "\\contents\\flv";
_mhandler.FileName = "sample_.%010d.jpg";
_mhandler.OutputFileName = "sample_img_vid";
_mhandler.OutputExtension = "flv";
_mhandler.Force = "flv";
// _mhandler.MaxQuality = true;
_mhandler.Audio_Bitrate = 32;
_mhandler.Audio_SamplingRate = 22050;
VideoInfo info = _mhandler.Process();
If you receive Error Code 101, you can request updated MHP through our
support email.
complete story