Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fastest way to add -movflags +faststart to an MP4 using FFMPEG, leaving everything else as-is

Tags:

ffmpeg

mp4

I want to add -movflags +faststart to an mp4 file. Basically that is all I want to do, nothing else should be changed. I am using ffmpeg.

What's the fastest way to do this? Do I have to re-encode the whole video? Or is there a better/easier way?

like image 863
Jonas Kaufmann Avatar asked Jun 18 '18 17:06

Jonas Kaufmann


People also ask

What is FFmpeg transcoding?

ffmpeg. FFmpeg is a software, which uses all formats for media you may need – H. 264, H. 265, Apple ProRes, Avid DNxHD etc, even also used for images like PNG and others – support all type of platform you're on. It is a command-line tool, it is quicker than some other tools which are available for transcoding.

Does FFmpeg support mp4?

FFmpeg can input most container formats natively, including MP4, . ts, MOV, AVI, Y4M, MKV, and many others.

What is Avconv?

Description. avconv is a very fast video and audio converter that can also grab from a live audio/video source. It can also convert between arbitrary sample rates and resize video on the fly with a high quality polyphase filter.


1 Answers

As simple as:

ffmpeg -i in.mp4 -c copy -map 0 -movflags +faststart out.mp4

Or if you can compile FFmpeg from source, make the tool qt-faststart in the tools/ directory and run it:

qt-faststart in.mp4 out.mp4

You can also use mp4box, which lets you move the MOOV atom to the start via this command:

mp4box -inter 0 in.mp4 -out out.mp4

Or if you want to fully optimize for streaming by also interleaving the audio/video data so that the file can be easily streamed in realtime:

mp4box -inter 500 in.mp4 -out out.mp4
like image 200
Gyan Avatar answered Oct 12 '22 12:10

Gyan