Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am developing a tube site, and currently having issues with h264 format . By looking at youtube, I noticed they are putting their hi-def videos into mp4 container, so logically I did the same.

Next, I installed mod_h264_streaming for lighttpd to make streaming and timeline-scrubbing work.

Problem is, that large files (500mb+ at somewhat high resolution) take for EVER to even start buffering ( I read the flowplayer or other flash players need to download metadata first) . I moved the xmov atom to the front of the file with MP4Box (i tried qt-quickstart too) , and the problem didn't go away.

Next I read online I need to interleave audio tracks, so I did that too. No change in slowness.

So I tried putting the same exact h264 movie into an FLV container, and the playback buffering starts almost instantly - no slowness.

So what am I missing here? Why would I choose MP4 container with mod_264_streaming module , which seems super-slow over a regular FLV container with lighttpd's built-in mod_flv_streaming ?

Obviously many websites pick mp4 container , but I fail to understand why ?

And as a side question - I tried using HTML5's VIDEO tag to try the same h264 MP4 movie, and the scrubbing is LIGHTING FAST! I looked into lighttpd's log file, and i noticed taht Flash Players append video.mp4?start=234 each time timeline is scrubbed, wheres HTML5's video tag does no such thing . Is this some sort of limitations of Flash ? Why Can't flash streaming be same fast as HTML5 streaming?

Thanks to ALL who can help. I very much appreciate this community.

share|improve this question
add comment

2 Answers

TL;DR: MP4 is used when the video site stores more metadata in the video than FLV supports, or uses an audio codec that FLV doesn't support. FLV's simplicity and for-streaming design makes it a good choice if you don't have a good reason to use MP4.

As for flash's timeline scrubbing, I have no idea why it does that since I never coded flash, but it's possible that it's a knob it uses, or something that works specifically with adobe's streaming server in order to seek in the file. It also works as a way to stop the pesky user from keeping the file on his disk.


Some stuff you already knew:

There are fundamental differences between the FLV and MP4 (aka isomedia) containers. FLV was devised by Adobe from the start as a streaming container, and it's really damn simple. All it does is send a video packet, then audio packet, then video packet... However, it only supports very few codecs, and no metadata other than timestamps in miliseconds. Unless you need MP4-specific features, you would do just fine with FLV.

ISO media, on the other hand, is based on Apple's MOV container. It's separated in atoms, and there is a particular atom, moov, that needs to be decoded before any other atoms can be read. The issue you're having with MP4 is because the moov atom is written at the end of file, which is a lot easier to do for encoding programs. There are tools, such as qtfaststart, which will do the necessary munging to put the moov atom at the beginning of the file. Thus, the file will start playback as soon as it has data, instead of needing to be fully downloaded before starting.

share|improve this answer
add comment

If you use a mov container, it streams out of the box with no need to install modules or place into a flv container and use a module. Just my thoughts. Use mov and add the appropriate mime type - done.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.