ffmpeg comes with a tool to re-order the MP4 “atoms” (Seriously don’t ask what are MP4 atoms it’s geek for the sake of geek).

find the file in ffmpeg_src/tools/qt-faststart.c

compile with gcc

1
gcc qt-faststart.c -o qt-faststart

And run.

1
/path/to/qt-faststart /path/to/src_vid.mp4 /path/to/output.mp4

NOTE: This only seems to work for h264 encoded videos (libx264).

Tags: ,
5 Responses to “ffmpeg MP4 does not stream qt-faststart”
  1. Stephen Dewey says:

    Actually, you should probably use make to compile this, rather than invoking gcc directly. Here is the header from qt-faststart.c :

    /*
    * qt-faststart.c, v0.1
    * by Mike Melanson (HIDDEN EMAIL)
    * This file is placed in the public domain. Use the program however you
    * see fit.
    *
    * This utility rearranges a Quicktime file such that the moov atom
    * is in front of the data, thus facilitating network streaming.
    *
    * To compile this program, start from the base directory from which you
    * are building FFmpeg and type:
    * make tools/qt-faststart
    * The qt-faststart program will be built in the tools/ directory. If you
    * do not build the program in this manner, correct results are not
    * guaranteed, particularly on 64-bit platforms.
    * Invoke the program with:
    * qt-faststart
    *
    * Notes: Quicktime files can come in many configurations of top-level
    * atoms. This utility stipulates that the very last atom in the file needs
    * to be a moov atom. When given such a file, this utility will rearrange
    * the top-level atoms by shifting the moov atom from the back of the file
    * to the front, and patch the chunk offsets along the way. This utility
    * presently only operates on uncompressed moov atoms.
    */

  2. Thanks for that Stephen, I will certainly check this out once I get my new server online :-)

    Cheers

    Buzz

  3. I compiled it via GCC and it ended up crashing my server or it just did nothing that way
    installing it via
    make tools/qt-faststart
    did the trick ^^

  4. Hi Saiweb,

    We have developed a website with great potential. Since you are good at FFMPEG with Redhat Linux we would like to discuss some of the requirements we are having. Of course it’s mutually rewarding. If you are interested in such thing please send me an email.

    Following is the brief requirement,
    Convert different media files into FLV format with good quality audio and video.
    Types of media files to be converted
    • .WMV
    • .3GP (cell phones)
    • .AVI (windows – various codecs)
    • .MOV (MAC)
    • .MP4 (iPod/ PSP)
    • .MPEG
    • .SWF (shockwave flash)
    • .MKV (h.264)

    What we need
    1. Install FFMPEG with necessary packages, codec’s and libraries in order to convert above media file types into FLV. Current environment – Operating system is RedHat Linux Enterprise Server 5.0
    2. Install FFSERVER (Multimedia streaming server for live broadcasts) in order to stream all converted FLV files via internet.
    3. Install libswscale – Is a library performing highly optimized image scaling and color space/pixel format conversion operations.
    4. Once installed work with our developers to integrate all services in to our web application and perform testing.

    Thanks
    Nalinda

  5. [...] Qt-fastart (FFMpeg alternative), another post [...]

Leave a Reply

Creative Commons License