2017-12-25

HOWTO: optimize MP4 video for fast loading with FFmpeg

MP4 video loading can be accelerated (e. g., allowing playback of partially downloaded videos for end users) by moving the metadata (the "moov atom") to the beginning of the file. And that's a lossless procedure (no video, audio or subtitle data gets lost; may alter some metadata though)!
  1. Can be performed very fast and easily with the qt-faststart utility (targeted primarily at Apple QuickTime MOV files, but should work for most MP4 base media files too); you can find that utility in your favorite FFmpeg distribution.
    $ qt-faststart in01.mov out01.mov
    $ qt-faststart in02.mp4 out02.mp4
  2. More thorough (but a little bit slower) method involves the universal ffmpeg program to remux the original video:
    $ ffmpeg -i in10.mp4 -codec copy -movflags faststart out10.mp4
Reference:
---
Last updated: 2018-03-01

No comments:

Post a Comment