Thursday, February 10, 2011

HTML 5 : Video

Boulder Java User group meeting. Presentation by Scott Davis : look at source of google.com apple.com they use html5

when working with public facing web site, idea of video is a very big deal. 

animated gifs : first time moving pictures on the web circa 95
interlaced jpegs, interleaved gifs, progressive downloads same to interbet for downloading on modem

now progressive downloading in movies : first by apple : moved meta data to the front of file (it was the at the end of the file). enabled streaming with quicktime circa 97

netflix moving to html5 (currently supported on ps3 & )
html5 is big on mobile

the big battle on html5 will be on TV set.

web video increased to 54% in oct2010 from 10% in jan2010. but on mobile html5 is almost exclusive,

    <video>
    container/codec
    html5 streaming

    <video src='file.ext' width='300' height='200'>

    similar to 
    <img src='file.ext' width='300' height='200'>


    <video width='300' ...   preload autoplay controls>
        <source src=".....ogv" type="video/ogg;codec=..>
        <source src=".....ogv" type="video/mp4;codec=..>
        <object> .... for flash
        <p> downlaad from    < dislay a message to user to download it
    </video>

    tries to play  first source if it cant tries second etc.... the object. if everything fails download message is displayed

Video containers video files are containers that contain video track, auto track meta data etc. popular container are mpeg4 (.mp4 .m4v), flash (.flv) ogg (.ogv) webm () AVI ()

    mp4 : patent for encoders/decoder
    flash : cpu/memory hungry, no silicon encoder/decoder
    ogg : no patent encumberance like mp4
    webM  : not open standard, just google, google own patents

    flash plugin supports mp4
    quicktime pligin supports ogg
    webM :  also supports  ogg

encoders when we watch video 1. interpreting the metadata 2. decoding video 3. decoding ideo

    3 codecs : h.264, Theora, VP8

    mpeg4 = h.264
    ogg  vorbis=audio, theora=video   (no patents)
    vp8 = webM  (brand new, no onchip container)

    h.264 : both low bandwidth (mobile) high bandwidth (blue ray eyc)

HTTP live streaming (HLS) invented buy Apple submitted to IETF.

    A big file say 30 mins file into small 10 sec segments
       => can be served up by simple apache server
    .m3u stores index file, .tm file are file segments

    files can be encoded different bit stream, so if mobile app moved from wifi to 3g, it can ask for lower bitstream

    Mediasegmenter takes in the original file and segments it

No comments:

Post a Comment