Home > Blogs > Tags > Html5 Blog Posts

With iPhone OS 3 update came the ability to do live streaming. There are a few types of streaming and each requires a certain encoding and segmentation. In this example i am building stream using asp.net media handler pro, open source ffmpeg and segmenter utility.

Requirements

i: asp.net media handler pro

ii: open source ffmpeg utility

iii: segmenter

Steps

Publish video to iphone device

Supported Settings For Iphone

The supported bitrates for streaming are: 100 Kbps to 1.6 Mbps

The suggested bitrates for streaming are*: Low – 96 Kbps video, 64 Kbps audio

Medium – 256 Kbps video, 64 Kbps audio

High – 800 Kbps video, 64 Kbps audio

The iPhone screen size is: 480×320

Suggested ffmpeg command for encoding iphone video

ffmpeg -i <in file> -f mpegts -acodec libmp3lame -ar 48000 -ab 64k -s 320×240 -vcodec libx264 -b 96k -flags +loop -cmp +chroma -partitions +parti4x4+partp8x8+partb8x8 -subq 5 -trellis 1 -refs 1 -coder 0 -me_range 16 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -bt 200k -maxrate 96k -bufsize 96k -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -level 30 -aspect 320:240 -g 30 -async 2 <output file>

Segment Video For Http Streaming

Now you have a complete video but you don't want to toss the entire thing up or you wouldn't be reading about HTTP streaming. What you need is a way to segment the video stream into smaller chunks. You can download Apple's segmenter 

Publishing Iphone .TS Video and Making Playlist Segment via ASP.NET Media Handler Pro

Below sample code will help you to publish .ts (video/MP2T) video and create .m3u8 (application/x-mpegURL) segments via segmenter tool.

[code]MediaHandler media = new MediaHandler();

&
complete story

Posted on July 24, 2010 0:21 AM by Moderator. Tags: html5 , webm , asp.net vp8 , asp.net video encoding
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
Posted in Media Handler Pro ,
Posted on July 24, 2010 0:5 AM by Moderator. Tags: html 5 , asp.net , webm encoding , asp.net vp8 , asp.net video , asp.net html5
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
Posted in Media Handler Pro ,
© 2007 - 2012, mediasoftpro.com  | Site Map | Privacy Policy | Terms of Use