views:

153

answers:

2

Hi,

sometimes i feel like such a beginner... I want so serve some video's on my site. They are available as .MP4 files, gotten from a FlipShare camera.

Now i tried converting them to WMV (which succeeded, but when embedded in html in a <object id='mediaPlayer' width='320' height='285' classid='CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95' etc' tag, users have to install an addon and the user experience of 10 windows media players on the site isn't just so good.)

So then i look at youtube and wonder how they do it, but i can't figure out what format they convert the video to.

So my question is: what format do i have to convert my video to, to show it in a player which does not need to be installed in the users browser, what tool do i need and what is the html code to embed such a video?

As you can see: starting from scratch.

ps. I often hear: this or that file extension is just a container, there can be anything inside. If you're using this in your answer, can you explain this to me, because i never understood this. For me a .cs is a c# file and a .doc a Word file, and not 'a container'.

+3  A: 

I'd say the most popular solution at the moment - utilized by YouTube and other major video portals - is H.264 encoded Flash-based Video. Flash can play Video since... I think Version 8 or 9, and has since gained significant market share.

My personal favourite Flash player is LongTail Player, but it isn't free for commercial use.

Here's a SO question with a list of Flash based players including open source ones.

Flash won't play on iPhone and iPad, though.

If you want to support computers with Flash Player 9 (I've seen some around, but I don't have any hard numbers) you will need to encode FLV files (which use a codec named Sorenson I think).

The upcoming alternative is HTML 5 Video but suport for that in browsers is nowhere near a major market share.

Pekka
Thanks, the link to the other SO question also helped a lot.Do you by any chance know the difference between the .SWF and the .FLV format, and how to convert my .MP4 files to that format?
Michel
I'm no expert in Video processing, you may have more luck on Superuser.com for that. Anyway, AFAIK, FLV uses Sorenson, a less performant codec than MP4 is (SWF is just the Flash container format, not a video format). If you can require your users to have Flash 10, consider using MP4. Anyway, `ffmpeg` is a very powerful open-source tool, should be able to encode both FLV and MP4 but is very advanced and requires a lot of video knowledge; `Avidemux` comes with a GUI: http://en.wikipedia.org/wiki/Avidemux but can't encode FLV (just MP4) My favourite commercial product is Ulead/Corel VideoStudio.
Pekka
+2  A: 

This isn't an easy question. The basic answer is that you need to use a format that the user's computer already supports. There is no one answer to this question. YouTube encodes videos as MP4 and embeds them in the page with a Flash-based movie player, and Flash is pretty widely supported, but you'll notice that Flash isn't available on a lot of mobile platforms — so anybody using an iPhone is shut out if you go the Flash route.

HTML5 introduces the video tag, which is meant to solve this problem once and for all, but there's still a hiccup even there — most HTML5-enabled browsers support h.264-encoded video, but Mozilla supports Ogg Theora instead. YouTube is currently experimenting with a <video>-based player, so this does seem like the future.

I believe the current best practice to support the most people possible is to encode as h.264, try to serve as a <video> element, and have a Flash-based player as a fallback if that doesn't work (which can play the same h.264 file).

Chuck
ouch, sometimes you hope for an easy answer, but on a 'not so easy question' most of the times that won't happen :-)I'll think about this one...
Michel