Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Few Thoughts on Web Video

DZone's Guide to

Few Thoughts on Web Video

· Web Dev Zone
Free Resource

Start coding today to experience the powerful engine that drives data application’s development, brought to you in partnership with Qlik.

On Air


It’s really full of video sharing websites out there, but in fact almost all of them use Flash player to display their video files. This is the reality now, but with the coming of HTML5, perhaps the things are changing a bit!

First of all if you start dealing with video sharing platforms the first thing to do maybe is to find a good Flash (.flv) player and to convert all your video content in FLV.

Few things to know with Flash video players:

  1. The user can play those videos only after installing the Flash Plugin to his browser;
  2. The video must be encoded either in FLV (or FLash Video) or in MPEG-4 with h.264 codec. Only than the Flash player can play it;

The HTML5, which can be described as variety of new “things” in the HTML comes with a native <video> tag. Something like the <img> tag where you can just point the source of the image in the src attribute.

First Question – How Does it Look Like?

To get more fluent with the <video> tag you must simply thing of it as a “complex” <img> tag. You just point to the video and the browser will do the rest. To be more exact let me send you to the w3schools page, but the important thing as they say:

Until now, there has never been a standard for showing video on a web page.


However to start from somewhere here’s a little snippet showing you the basic, but very basic usage of the HTML5 video tag:

<video src="path_to_the_video" controls="controls"></video>


Second Question – Is Every Video Playable?

But of course not! There are different browser – different video formats. Currently there are three formats, supported by the different browsers.

  1. H.264
  2. VP8
  3. Theora

Note that these are video codecs and a video files does not consists of only a video codec, but also of an audio codec. This makes the video file a container of several things. As you may know already H.264 is used with MPEG-4 video format, which results in .mp4 extended files, Theora is used in OGG, which are all those .ogg files out in the web, and finaly VP8 is used in WebM … or in .webm videos.

First thing to know FLV files (.flv) can also be encoded with H.264. Actually Flash player has a h.264 decoder so this makes it possible to play both .mp4 and .flv files encoded with H.264.

Second thing to notice – where are those .webm files? I’ve never seen them!

Third Question – What is WebM and VP8?

Behind WebM and VP8 is Google. This is a new video format based again on Theora. Actually it pretends to be as good in compressing as H.264, which by the way is meant to be the best. But let me take a look at Nettuts+:

VP8, a relatively new codec, is the brainchild of On2 — the same guys behind Theora. Google acquired On2 in 2010, and opened up all the underlying patents for the codec into the public domain.

WebM, the container of choice for most current browsers, utilizes VP8 for compressing its video content and Vorbis for its audio. It produces content similar in quality to H.264.

It is completely royalty free, now and for the future. On the downside, though, it has limited hardware decoding support as well as third party device/mobile support.


Final Question – How Can I Convert a Video in WebM?

This answer is given by this article, where as it is said after having the ffmpeg version >= 0.6 you simply can use this command:

ffmpeg -i girltalk.mp4 -f webm -vcodec libvpx -acodec libvorbis -aq 90 -ac 2 girltalk.webm

Conclusion

It’s interesting to see what will happen one day. There is going to be either a harmonious life in the web video field or the codecs/formats will be as much as the browser? Who knows?

Create data driven applications in Qlik’s free and easy to use coding environment, brought to you in partnership with Qlik.

Topics:

Published at DZone with permission of Stoimen Popov, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}