Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
|
![]() |
|
Thread Tools | Search this Thread | Display Modes |
![]() |
#1 | Link | |
Registered User
Join Date: Nov 2012
Posts: 10
|
[x /H264]: moov atom at the front of the file (Fast Start)
Hi all,
I am working with Avisynth, megui, and h264 to create the ultimate quality presets for YouTube. YouTube's suggestion is to put Quote:
Please assist if there is a command line I can use in h264 / x264 to put moove atom to the front of file. Thank you. |
|
![]() |
![]() |
![]() |
#2 | Link |
Registered User
Join Date: Dec 2002
Posts: 5,565
|
That's usually done at the muxing stage. Did you confirm that MeGUI isn't doing this already?
http://forum.doom9.org/showthread.php?t=168601 |
![]() |
![]() |
![]() |
#3 | Link |
Software Developer
![]() Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,262
|
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. |
![]() |
![]() |
![]() |
#4 | Link |
Registered User
Join Date: Nov 2012
Posts: 10
|
Thanks for helping me out sneaker_ger and LoRd_MuldeR.
As it stands I am using Sony Vegas to output a .avi with Debugmode frameserver. Then I grab that .avi Megui and create an AVS for it and put the same .avi as the audio input. Then MeGUI muxes the two together into an mp4 - and it already puts moov atom to front! I never attempted to put moov atom to front so I figured it wasn't. By using mp4box.exe -info I was able to find that it is. I will post back here in a month or two with a guide for the ultimate presets once I am certain they are complete ![]() |
![]() |
![]() |
![]() |
#5 | Link | |
Moderator
![]() Join Date: Jan 2006
Location: Portland, OR
Posts: 4,984
|
Quote:
Which is dangerous, because the file might look like it's fine with some server/player combinations, and work horribly with others. Making Fast Start all the more important, since just having the file work in progressive download doesn't mean it'll always work. This was such a huge problem 5-20 years ago. Fortunately we now have adaptive streaming with fragmented mp4 and moof headers for commercial content delivery. |
|
![]() |
![]() |
![]() |
#6 | Link |
Registered User
Join Date: Feb 2025
Posts: 3
|
You're on the right track with optimizing H.264/x264 for YouTube. By default, x264 doesn’t place the moov atom at the front, but you can fix this with tools like MP4Box or FFmpeg after encoding. A quick solution is to use MP4Box or FFmpeg with the right flags to move the moov atom for fast start streaming. If you need a step-by-step guide, check out this article https://www.handyrecovery.com/moov-atom-not-found/ let us know how it goes
Last edited by jenny; 3rd March 2025 at 22:04. |
![]() |
![]() |
![]() |
#7 | Link |
Registered User
Join Date: Aug 2024
Posts: 457
|
I saw your another post about rescuing an unfinalized mp4, this topic is completely different.
"Fast start" usually means to move the moov atom from file end to front, after the file had finalized. If this is what you want to do, you can easily achieve it by setting "-movflags +faststart" in FFmpeg. MP4 is kinda "hard to work with", to be honest. |
![]() |
![]() |
![]() |
Tags |
h264, x264 |
Thread Tools | Search this Thread |
Display Modes | |
|
|