Flash CS3 (9.0.2) Supports New Video and Audio Codecs; FLVPlayback Works, But …
If you want to be able to deliver non-FLV video in Flash (how cool is that?!), head over to the Adobe Flash Support Center and download the Adobe Flash Player Update for Flash CS3 Professional (9.0.2). The result? At runtime, you’ll be able to load MOV and MP4 files encoded in the H.264 hi-def codec. This is in addition to the usual FLV, and we’re talking Flash Player 9 only (specifically, version 9.0.115.0 or higher). You’ll also be able to load M4A audio instead of only MP3. The upgrade to the IDE allows you to view such content as you test and debug SWFs right in the authoring environment. I’ve already installed and tested, and the update works … but I have seen one stumbling block. You can work around it — in fact, you can work right through it — but it isn’t especially obvious.
Using the FLVPlayback component
If you’re coding up your video content with a Video object and NetConnection/NetStream, you won’t see any issues, but if you’re a fan of FLVPlayback, you’ll have to fly blind during a few steps that are normally straightforward. Here’s what happens for me in Windows XP (and perhaps your mileage may vary):
I drag an instance of FLVPlayback from the Components panel to the Stage. I select the Parameters tab of the Property inspector and double-click source so I can browse to one of the new video file types. This opens a Content Path dialog with a button that browses for files. I click that button to locate an MP4 file, which opens a Browse for FLV file dialog, but nothing shows — even though I’m in the folder that has such files. The reason nothing shows is because the Files of type list box in this dialog only has an entry for *.flv files. To get around that, I type *.* into the File name field and hit Enter. Now I can see my MP4s (and every other file type in that folder). I double click my MP4.
Flash chews on that for a while. Honestly … maybe a minute and a half. Finally, Flash tells me “Failed to load FLV: [name of file].” This surprises me, because, well, I didn’t browse for an FLV.
But I forged ahead anyway and clicked OK. I selected Control > Test Movie to see if the association succeeded anyway. It did.
So it does work. But Flash plays a bit of hide-and-seek with you while it gets you there. My take on it is, roll with the flow.
It’s too bad that the manual association doesn’t seem to realize the new possibilities, but if it really gets on your nerves, you can always just set that source parameter via ActionScript 3.0: just give your FLVPlayback component an instance name in the Property inspector, such as videoPlayer, and set its FLVPlayback.source property:
videoPlayer.source = "coolNewFormat.mp4";
December 18th, 2007 at 10:37 am
Thank you for posting this. I also was very confused because the FLVPlayback component didn’t appear to have changed.
Unfortunately the “*.*” trick doesn’t work on a Mac. While it was possible before the update, now there is no way to select anything other than .flv. I hope Adobe will give us this possibility some day.
Somewhere on Adobes website I found a solution. It works well with manually selecting the source of the FLVPlayback component and it is simple. Just rename the .mp4 file to .flv!
December 18th, 2007 at 2:13 pm
Martin,
Oh wow! Good find! Thanks for sharing this. That makes sense, too: it’s the codec that matters. The file extension doesn’t necessarily mean anything.
December 20th, 2007 at 3:36 pm
This is a great tip… it does work on a Mac as well, you just have to specify the name manually because the OS dialog box will not let you do *.*
So, don’t even bother browsing, just type the path in.
Much easier then the action scrip stuff..!
December 20th, 2007 at 4:29 pm
Tinic Uro says that there will be new file extensions registered for new FLV containers: http://www.kaourantin.net/2007/10/new-file-extensions-and-mime-types.html
I didn’t do the update yet, so can you say if .f4v works? Might have been overlooked in the update, though, if it’s only looking for .flv.
December 31st, 2007 at 11:36 am
To Scott …
Glad it’s working for you!
To Michael …
I haven’t tried the F4V extension yet, but thanks for that link! I find Tinic’s blog entries to be very useful, and this one is a keeper.
January 5th, 2008 at 12:05 pm
To Michael
You can easily rename your mp4 to f4v and the FLVPlayback component will still be able to playback the file.
To David
When I select my file, all the ones I’ve selected until now are below 5minutes of playtime, the dialogbox goes away instantly and plays out correctly. Maybe there’s something else in the way..
January 7th, 2008 at 9:10 am
Tiago,
Thanks for the input!
In my tests, the duration of the video file has little bearing on the dialog box delay. Curious, eh?
January 7th, 2008 at 6:10 pm
Hey David, I’m sort of in a pickle with this. For some reason, my FLVPlayback isn’t accepting the mp4s.. I’ve created a Drag and Drop app with AIR, and I’m in process of updating to Beta 3. I figured as I was doing that, I’d add support for H.264 encoded media, might as well right. So I get this error when the mp4 gets dropped into the app
VideoError: 1005: Invalid xml: URL: “file:///Users/dedmonds/Desktop/chaplin.mp4″ No root node found; if url is for an flv it must have .flv extension and take no parameters
at fl.video::SMILManager/http://www.adobe.com/2007/flash/flvplayback/internal::xmlLoadEventHandler()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/onComplete()
When it talks about ‘url’ it’s referring to the way I’m accepting the media on the drop… You think this is just not possible with AIR yet? I don’t see why not though…
dz
January 13th, 2008 at 1:08 pm
dz,
I think I have an answer, but unfortunately, it’s only partly an answer. Tom Green, Adam Thomas, and I have been collaborating on a new book (I’m tech reviewer, this time). As you might expect, the book addresses the new H.264 support, and we’ve all been experimenting with it — but have run into a few snags. The good news is that Adobe is working with us (they’re always good like that!), but until everything gets finalized, it only makes sense not to steer anyone the wrong way. Out of respect, we’re holding off on conveying anything that might be subject to change.
I imagine there might be a TechNote on the subject, but I don’t know for sure. As soon as I have anything useful, I’ll write up a new blog on it and try to remember to link from the comments on this one.
January 30th, 2008 at 5:47 pm
David,
I am getting the same error as DZ/ My encode is from Sorenson Squeeze (latest version).
I am loading the movie into the FLVPlayback component via AS3:
videoContainer.tourVideo.load(”TESTa.mp4″);
Any ideas?
January 30th, 2008 at 9:38 pm
Brian,
For better or worse, I’ve got to give you the same reply as I did dz. Until a resolution has been made “official” or public (i.e. with the publication of the book), the writing team has been asked to keep mum.
February 1st, 2008 at 5:56 pm
Hi,
I’ve also made a try by downloading the following file supposed to be h264 encoded :
http://blacksharkfr.free.fr/tm/Island_Tour_h264.avi
I am loading the movie into the FLVPlayback and set the contentPath to Island_Tour_h264.avi, and I get a blank screen.. Strange, maybe it is not h264 video content.
I tried with another movie found on http://www.osnews.com/story/19019/Theora_vs._h.264
It works.
In fact, I get the impression that some are working, some not….
February 1st, 2008 at 6:00 pm
By the way, Is there any way to test whether the video is valid h264 one ?
February 1st, 2008 at 8:29 pm
Pascal,
I’m seeing the same thing — some work and some don’t — and as soon as I get the green light on sharing some of the answers turned up by our research, I’ll be sure to share!
I’m really not trying to be cagey about it … it’s just that this book isn’t really “mine.”
February 2nd, 2008 at 4:26 am
I understand !

If I find something on my site, I will let you know
Thanks David.
February 2nd, 2008 at 8:40 pm
Pascal,
Sure thing.
February 3rd, 2008 at 4:31 am
David,
here I found a link who may help :
http://www.adobe.com/devnet/flashplayer/articles/hd_video_flash_player.html
especially the paragraph telling that Flash player doesn’t support h264 video encoded with alpha channel. Maybe it was the case with tha video which wasn’t working ….
February 14th, 2008 at 5:43 pm
If you get into some errors, like 1005;
try to handle your php/asp flv-rendering-source in Flash like:
your-path-way/to/heaven/ STREAM-HANDLER . php / anything-here.flv
.php COULD be .asp here, :-p
Flash adds ?xxxx to the file, so faking an extension in any other way won’t work.
February 16th, 2008 at 6:47 pm
Robin,
Thanks!