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
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