LA Flash and Flex Developer
23 Jan
Now that H.264 video is supported in Flash Player 9.0.115 and FMS 3 is on the horizon we are getting ready to flip on the HD switch in our video player. We have been lucky enough to try out a few beta releases of FMS 3 and have had great success with streaming H.264 video without too many changes to our core video player component (both AS2 and AS3). However, I ran into an issue yesterday with progressively downloaded H.264 video. The video would play but it was not progressively downloading, it would download the entire file before it began playing. Not the user experience we were looking for. The files played fine in Quicktime, and they played fine in Flash when streamed from FMS 3, just not progressively.
Time to hit Google. I found a few postings, not many, probably not too many people using H.264 yet (so I thought). Turns out the problem lies within the encoding of the file and where the “moov atom” is stored. The moov atom is essentially the header information of the file. To progressively play a file this data is needed before the first frame of video can play. This data contains the appropriate meta data the NetStream class looks at when determining the length, size, etc of the video. The moov data in my .mov files were stored at the end of my videos and that is why the video wouldn’t play until the entire file was downloaded. The moov data needs to be at the beginning of the file in order to progressively stream video.
I figured others must have run into this issue and someone must have wrote a utility to move the header bytes from the end of the file to the beginning. Byte manipulation isn’t rocket science, close, but not quite. While searching I found an interesting tech note on the Adobe site and it turns out Adobe’s own video editing software is to blame for this. The quote below is pulled directly from the tech note explains the issue.
“One important thing about playing an H.264 video file as progressive download is that the moov atom needs to be located at the beginning of the file, or else the entire file will have to be downloaded before it begins playing. The moov atom is a part of the file that holds index information for the whole file. Unfortunately, tools such as Adobe Premiere and After Effects place this information at the end of the file, but Adobe is working to fix this in a future update to the CS3 video production tools. This isn’t an issue for streaming the H.264 video files, however, so Flash Media Server users can breathe easy.“
Why didn’t Adobe address this issue? Obviously they rushed this feature to market, Silverlight supported H.264 video and everyone was raving about it. I don’t know if Silverlight progressively streams H.264 video when the moov atom is at the end of the file or not. Can anyone confirm? Or maybe this was some sick marketers ploy to entice users to buy FMS 3, i doubt that but conspiracy theories are so much fun.
Scouring the web I did find a utility that moves the moov atom to the start of the file. Renaun Erickson ported a C app to AIR that moves the moov atom and resaves the file. Very impressive! Unfortunately it didn’t fix my issues, Renaun’s app only works with .mp4 files and the files I was working with are .mov files. Using Quicktime Pro I exported one of the .mov files to a .mp4 to see if Renaun’s app would then move the moov atom. Still no luck. As a last resort I tried a simple Save As from Quicktime to see if it would restructure the bytes so the moov atom was at the beginning of the file. Guess what, it worked! My progressive downloads now worked. I created a simple batch and saved out all my progressive videos using Quicktime.
It baffles me that Adobe would not have put more thought into this problem especially when their own software is the culprit. They talk about CS3 suite integration and this is the furthest thing from that. Adobe mentions that they will be releasing a CS3 update to address the issue, hopefully sooner than later, unfortunately this does not help people (like me/us) who already have hundreds of H.264 assets with the moov atom at the end of the file. Re-encoding the video would be a huge process, we are already using the video assets for other streaming services, now that Flash supports H.264 we were hoping for an easy switch to our Flash video player. Most of our video is streamed, and that works great, unfortunately the progressively downloaded video wasn’t an easy switch.
In the end, the video looks great! Watching 1.2mb and 3mb fullscreen video in Flash is unreal. Now if we could just get support for variable bitrates!!
17 Responses for "Why is my progressive H.264 video not playing until the entire file is downloaded."
Tink did mention that Adobe’s product’s where not setup to create progressive files, nor most other applications. Its because its easier to put it at the end when you are constantly editing files.
As for the QTIndexSwapper app not working, was there an error? Can you send me a sample .mov file that didn’t work that I can look at. Thanks
Hi Scott,
nice post.
I had the same problem with the mov atoom and i found a new streaming server, called vcs from a germany start Up company called Onlinelib (www.onlinelib.de).
I had the luck that i was able to test a beta which supports h.264 streaming for flash. The VCS Software has a progressive download modus and a real streaming modus. In both modies it was possible to play the mov or mp4 files at the beginning. I asked the development support and they told me that it is not important for vcs where the atoms were saved.
I heard that they will release the software in feb. 2008. They released yesterday a fl3 streaming demo inkl. swf for mobiles.
Maybe you can ask onlinelib what vcs makes so specially .
Thanks!
Tim, Belgium
@Renaun Unfortunately I can’t send you the video as it hasn’t been released yet and the mouse would get upset if I sent it to you. The error I get happens at 50% and reads “ERROR: The MOOV atom is not located at the end of the file, the file is ready for progressive download or it is a invalid file”
scott: I have the exact same problem - with all files I’m testing ( exported from ae, downloaded from the internet and encoded in ffmpeg).
Hi,
There’s also a pseudo streaming solution available (MP4 playback starts immediately and you can seek in the files). It runs as a Lighttpd plugin. For more details see: http://h264.code-shop.com/trac
I’ve found that Visual Hub will properly encode h.264 mp4 with the atom at the head of he file. This allows the h.264 file to be progressively downloaded.
The good news: is that visual hub costs a mere $24.00. And it will do batch encoding. The downside is that it’s mac only.
Here’s how:
1. In Visual Hub, click “Mp4″
2. check “H.264″
3. check “Hint for Streaming”
4. press start
That’s it.
Lets hope they fix this. The player (Netstream layers) simply need to start supporting http 1.1’s range-requests, this will allow random seeking within even very large files (without having to download), and, lends itself to asking the web server for the tail of the file (the moov atoms) when they aren’t detected in the head. For reference, VLC player already supports/does this over http, and pre-fetches the tail moov atoms when they dont exist at the head of a mp4..
Eric, I downloaded your air app and it didn’t work for me either. I was using .mov files from Final Cut and your app told me the moov atom was not at the end, yet the movie still needed to be fully downloaded to play.
Scott, the simple “save as” from quicktime did it!! Would never have thought to try that.
Howdy Scott.
What are you using to encode the videos to progressive H.264 FLVs?
Rhozet
[…]
Hi all! Well, this app didn’t work for me either - tells me the moov atom is not at the end. But it doesn’t progressively download anyway… So yeah, I will try to figure out how to move it…
Hai
I Have solved Progressive Download Problem And It IS Working Fine i Just Need Another Tool To Move Moov from Back Site to Front Like qt-faststart.c
Because this tool has some limitations.
can any one suggest a proper Tool For shifting Moon From Back side to Front of a video?
Thanks
Vijay Patidar
ya CHEER WE HAVE DONE IT …………………..
http://atomicparsley.sourceforge.net/
This information was very helpful in solving this issue. On a side note I found it odd that there was not more. There were plenty of articles about the fact it was possible but no help, so a big thank you for posting it.
I am able to play the QT.mov back through the flash player on my Mac, but another cannot on a PC. What would be the reason for this? I even tried it out on a PC myself with no luck. It’s almost like it can’t find the QT.mov.
thanks for everyone’s help here!!!! found a better solution though for encoding files to h.264 so they will progressive download and best of all its FREE!!! its called MPEG STREAMCLIP and can be found here…….
http://www.squared5.com/
hope this helps someone as i’ve spent 3 weeks trying to get my head round this one!!! check out our website in a week or so as everything will be streaming full res or HD from now on!!! my test file can be found here http://www.preamptive.com/showreel2.html
Leave a reply