[FFmpeg-user] Any way to estimate moov_size in mov/mp4?

Stefan Oltmanns stefan-oltmanns at gmx.net
Fri Feb 10 12:40:40 EET 2023


ffmpeg allows to set a reserved space for the moov at the beginning of
the file using the "-moov_size" option.
This will waste some space, but prevent the (in some cases very
time-consuming) second pass of "-movflags faststart" if you want to have
the moov atom at the beginning of the file.

If the reserved space is too small the moov atom gets written at the end
from my testing (the documentation seems to be wrong here, it states
muxing will fail, or why could the produced mov file still be played?).

Is there any way to properly estimate the moov size? In my use case it
should be rather simple: PCM audio, DNXHD codec (all-I frames, almost
CBR), known number of frames.
As the produced files are very big anyway I don't mind wasting a few MB
by overestimating.

Best regards

More information about the ffmpeg-user mailing list