video seek test¶
presentation.mp4¶
% ffmpeg -i presentation.mp4 -movflags faststart -c copy presentation-movflags_faststart.mp4.mp4
presentation-movflags_faststart.mp4¶
Note
-movflags faststart is an option used in ffmpeg to make MP4 videos streamable and seekable, especially when hosted online.
By default, MP4 files store metadata (specifically the “moov atom”) at the end of the file. This metadata contains index information that tells the video player how to navigate the video file (e.g., for seeking to different timestamps).
However, when the metadata is at the end: - Browsers must download the entire video before they can play or seek it. - This causes issues with streaming and seeking, especially over HTTP.
The -movflags faststart flag fixes this by moving the moov atom to the beginning of the file. This allows the browser or video player to: - Start playback immediately - Allow seeking to any point in the video without downloading the entire file