4

I run a web application which provides a few videos on it. Those videos are being displayed with a flash-video-player.

Unfortunately, the index of those container-files is at the end of the file, so the whole 2GB video has to be loaded until the playback can start.

Q: Is there a way with FFMpeg to swap the MP4-Container-index to the front of the file?

1 Answer 1

7

You want to move the moov atom to the beginning. While encoding you can use:

ffmpeg -i inputfile [other parameters] -movflags +faststart outputfile.mp4

If they have been encoded already, you can simply copy streams without re-encoding:

ffmpeg -i input.mp4 -codec copy -map 0 -movflags +faststart output.mp4

You can also use the qt-fasstart tool. This needs to be compiled in the tools directory of ffmpeg. The command is simply:

qt-faststart inputfile.mp4 outputfile.mp4

There are windows binaries available.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .