View Single Post
Old 5th July 2015, 15:10   #3  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
You can think of the moov atom is something like the global "index table" of the MP4 file. It can be located at the beginning of the file (before mdat atom) or at the end of the file (after mdat atom).

For local file playback it doesn't matter much, but for streaming (progressive download) you want to have the moov atom at the beginning of the file - for obvious reasons.

However, x264 will append the frames to the MP4 file as they are encoded. And, since the exact size of each frame cannot be known before they have actually been encoded, the index (moov atom) will be written last, at the end of the file.

So you cannot make x264 output an MP4 file with moov atom at the beginning. At least not directly. But you can achieve this easily with a tool like MP4Box or AtomicParsley!

Code:
mp4box.exe -add c:\Temp\input.mp4 c:\Temp\output.mp4
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊

Last edited by LoRd_MuldeR; 5th July 2015 at 15:23.
LoRd_MuldeR is offline   Reply With Quote