QTIndexSwapper AIR Application for Flash Player H.264 files

Posted on August 22, 2007 | 26 comments

2010.06.16 UPDATE: Get the latest here!

2007.12.28 UPDATE: v1.3 of QTIndexSwapper requires AIR Beta 3

With the release of the Flash Player 9 Update that supports H.264, we can now play a subset of H.264 movie files. The problem is most of the H.264 files have the index at the end of the file which for progressive download means you have to download the whole file before you can start watching any of the video.

In the notes from Tinic Uro, Adobe engineer working on the changes, there is mention of a C application that helps with rearrange the inwards of a movie to put the index at the beginning. Thus help with the progressive download issue. To this end I have create an AIR application which does the index swapping for you.

Its called “QT Index Swapper” (v1.3 using AIR Beta 3 as of 2007.12.28), get it at http://renaun.com/air/QTIndexSwapper.air. And if that isn’t enough I have also made the source available inside the AIR application.

There will probably be some quirks and many files that might not work. But give it a try and let me know what you think. I was converting 500Mb-600Mb movie files that I have in MP4 format to play on my PlayStation 3. The files were being converted in under a minute, just beware that the AIR app might act like it is hanging while reading that much information. Just wait for it to run and watch the new file being created.

  • http://maliboo.pl maliboo

    Great job! Maybe you can switch from sync to async mode on file operations? This could eliminate application “freeze”.

  • Pingback: two forty eight » Blog Archive » 248 Links du Jour - 08/22/06 - Special MovieStar Edition

  • http://abdulqabiz.com/blog/ Abdul Qabiz

    Cool! That shows what all can be doing with AIR, it means, one can port many such C applications to AIR…

    It’s useful, I am gonna use it for all video files I have…



  • http://www.renaun.com Renaun Erickson

    I did think about using the Async file I/O stuff, and most likely it will get rid of the freeze affect. Will have to try it the change sometime.

  • http://www.renaun.com Renaun Erickson

    @abdul Good point, it was surprising pretty easy to port. Did it in about one work day, of course I didn’t spend time optimizing and/or testing a bunch of files. But I agree AIR can now be a good alternative to many small C apps.

  • http://multimedia.cx/eggs/ Mike Melanson


    I wrote the qt-faststart.c utility from which QTIndexSwapper is ported. Good stuff; gives me a good point of reference for reviewing some ActionScript techniques. A few things on stream reading:

    You probably want to use the readUnsignedInt() method vs. readInt(). You don’t want to restrict this to files under 2 GB (or risk strange behavior beyond that limit).

    When patching a 64-bit chunk offset atom (co64), the readDouble() method does not do what you think it does. That method construes the next 8 bytes in the stream as an IEEE double-precision floating point number, not a 64-bit integer.

    Or maybe it does work and I don’t recognize why. Have you tested on files with co64 atoms yet?

  • http://www.renaun.com Renaun Erickson

    Hey Mike,

    Now the 64 bit was left with some bugs, I don’t have any co64 files. I did think about the sign/unsigned issue but just wanted to get something that half way worked. Basically I did a port not really understand complete what it was doing.

    Do you have some test files I can use to test the co64 atoms?

  • Hurry

    It does not work with mp4 files encoded with the MainConcept mp4 encoder. The ouputted files do not play locally in QuickTime neither int he beta Flash player on the web.

    Original file:

    Converted file by your QTIS: http://www.mediafire.com/?1v0duedtf9y

    The original files plays perfectly in beta Flash player but only after downloading fully. Adobe has\ve used the MainConcept decoder so I think my original file would be one most compatible files with flash beta since it is encoded my the mainconcept encoder. I hope you fix this bug. Thanks.

  • Hurry

    QTIS asked me for confirmation whether it was a quicktime file but in the output it said 0 bytes for the final file though the final file was the around the same size.

  • http://www.renaun.com Renaun Erickson

    The QT Index Swapper only work with files using the QuickTime format. It should stop, and not create the output (final) file if it does not think its a QT formated file, so thats a bug.

  • Pingback: RealEyes Media - David Hassoun » I always wanted to be a MovieStar! (Flash and HD [H.264] video is probably the closest I’ll get)

  • Corben9

    x264 encoded content muxed in mp4box…

    Ok since i have a large file id like to have progressivly streamed and the option in MP4box didnt exactly work i treid the QT swapper and it did swap the atom . My file is a 4Mbith High Profile 720p file.. u can find it here > http://www.studioc9.com/CevapiSession/CevapiSession.mp4

    and the flash html> http://www.studioc9.com/CevapiSession/HD.html

    Now oddly even after the moov atom is in front it doesnt start playing … it loads to oblivion eating up a horendes amout of virtual memory *more then 2 gigs* until the datatransfer just stops… now it could be becouse of the 64 bit atoms … sicne the filesize is more them 600 MB .. anyone have any expirience .. the file hower does stream directly in VLC if u add enough prebuffer and the site with the file works perfectly localy…

    Is this kind of behaviour a limitation in Flashes h264 impelmentation or does it really only progressive downlaod with files made in Quicktime ?

    I know im taxin the entier thing by puting a 4 Mbit file on the web but i wanted to test if its possible to use any sort of standard high profile content …

  • http://www.renaun.com Renaun Erickson

    The QT Index Swapper does not work correctly with 64 bit atoms. I need a file to test with. If the file worked with out it going through the QT Index Swapper on the web then its most likely mixed up the indexes.

  • Jim Waterwash

    Mainconcept encoder is used in Vegas Video. so it would be great if this app could work with those files. I have many files that take over 8 hours each to encode.

  • http://renaun.com Renaun Erickson

    This QT index swapper only supports QuickTime formatted files. What does that really mean? I am not quite sure, i just ported the original C app.

  • Pingback: Flash Player 9 Update 3 Beta 2 « klarblau ::: weblog

  • Neil Brown


    I just downloaded the latest version of AIR and it says your app won’t work with it, any ideas?

  • http://www.renaun.com Renaun Erickson

    the app needs to be updated to beta 2. I’ll get to it some time.

  • Pingback: Breaking Eggs And Making Omelettes » Blog Archive » Improving qt-faststart

  • Dewey

    You rock, sir. Wanted to serve some h.264 files created from home movies on dvd via simple embedded html tags and the quicktime plugin, but of course, the plugin was downloading the entire file before playing. Thanks to your QT Index swapper, this now works as I hoped it would. Thanks!

  • http://www.renaun.com Renaun Erickson

    version 1.3 is available now, it requires Beta 3 and I’ll post more about the updates later.

  • Pingback: Why is my progressive H.264 video not playing until the entire file is downloaded.

  • Andy G

    How do I install this utility and where? Where do I have to include this file to work my videos? In quicktime..or in Flash CS3…where??
    Please help me out!

  • Pingback: :: reykroona.com :: » Blog Archive » After Effects and H.264 MP4s for the Web

  • Colin Britton

    How are would it be to make this process a whole folder. That would be a great enhancement.

  • Pingback: Renaun Erickson » AIR application QTIndexSwapper v1.3 update

  • Denis

    Thanks for the applicaiton, but it does not work for me.
    I have .mp4 (.h264) file, made from Premiere CS3, I run you application. I can play the output file, but still no fast start.
    If anybody have any ideas, please let me know…
    p/s/ QT Pro doesn’t work as well : just can’t do Save As, it fails and do nothing…

  • Pingback: Marlon Valenzuela » Blog Archive » Streaming H.264 Video Files

  • WSTO Media Services

    we use this program to make our shows more available on our video site (www.wsto-online.com) however in trying to convert a 700ish mb video I keep getting an “ERROR: Error 1000″ and an “ERROR: Error 2029″

    What do these mean?

  • Toni Collins

    Hi. I tried your app on a .mov file that I exported from a .vob using Adobe Premiere Elements. At the end of the conversion, I received an error message that said something like, “The moov atom was not at the end of the file. Either your file will progressively download or it is an incompatible file.”

    Any tips? I’d appreciate all advice you can send my way.

  • Andre

    Hi Renaun, thanks for your work. Is the source code still accessible somewhere? I want to learn how you translated C to AS, so your application will be a great help. Thanks.

  • http://www.renaun.com Renaun Erickson

    The AIR source is in the application it self, just open up the application and right click to get the context menu, then there will be view source.

    The C application source is here (link in post above):

  • Marc

    I would like use your product QTindex Swaper
    When I try to convert a 700ish mb video I keep getting an “ERROR: Error 1000″ and an “ERROR: Error 2029″.
    If I choose smaller files, I don’t have problem. Have you release of your product with solve that. I think it is big size of convert file is not supported.
    Thank you for all; regards

  • Wayne


    Does your program work with Vista 64 bit OS?

    When I run your program, it simply says: Error, is this a H.264 file?

    It is, of course.



  • Pingback: My MP4 h.264 Files Won’t Load Immediately!

  • Pingback: ESA HD Media Player – Flash CS4/AS3 Tutorials » Troubleshooting Common Problems

  • Pingback: Benjamin Carl - PHP continuous-integration test-driven-development qualitätssicherung software-architektur - » HTTP-Pseudostreaming von H264-kodierten (H264-Video + AAC-Audio) MP4-Videodateien

  • Pingback: MP4 Atom Moov and H.264 HTTP Progressive Download « No Free Time