Converted mp4 h264 baseline format loads long time

后端 未结 1 1107
自闭症患者
自闭症患者 2021-01-24 09:50

I have converted my video to mp4 x264 baseline format and it works fine with all pc/mobile phones , the problem is it takes long time to load the video while googling came to kn

1条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-24 10:25

    You have several options to relocate the moov atom so the video can begin playback before it is completely downloaded by the client.

    -movflags faststart

    The easiest is the option -movflags faststart when re-encoding:

    ffmpeg -i input -c:v libx264 -profile:v baseline -movflags faststart output.mp4
    

    If you already encoded your .mp4 file, but simply want to move the atom:

    ffmpeg -i input.mp4 -codec copy -movflags faststart output.mp4
    

    You may need to get a more recent ffmpeg version to use this option. See the FFmpeg download page for links to ffmpeg builds for Linux, OS X, and Windows, or you can follow a step-by-step guide to compile ffmpeg.

    qt-faststart

    Alternatively you can use the qt-faststart tool that comes with the ffmpeg source:

    cd ~/ffmpeg/tools
    make qt-faststart
    ./qt-faststart input.mp4 output.mp4
    

    MP4Box

    Or you could use MP4Box (usually provided by the gpac package depending on your distro):

    MP4Box -add input.mp4 output.mp4
    

    Also See

    • FFmpeg and x264 Encoding Guide
    • FFmpeg and AAC Audio Encoding Guide

    0 讨论(0)
提交回复
热议问题