Converter for streaming mp4 videos

Progressive downloading needs H.264/AAC format and the MOOV atom set to the beginning of the file to stream videos over the net.

Usually, the MOOV atom is set to the end of the file after encoding it to mp4. In the first step, convert the video to H.264/AAC using ffmpeg

ffmpeg -i input.avi -c:v libx264 -c:a aac -c:s copy input.mp4

Then set the MOOV atom to the beginning of the file in a second work step:

ffmpeg -y -i input.mp4 -c copy -movflags +faststart output.mp4

Of course this can be done also in a single command.

Convert all files in the current directory including subfolders

Delete all existing metadata, copy video stream, convert 2 audio streams 5.1 to AAC, set language for audio streams to german and english, put MOOV atom to the beginning of the file.

find . -type f -print0 | xargs -0 -I file ffmpeg -y -i file -hide_banner -map 0:0 -map 0:1 -map 0:2 -map_metadata -1 -c:v copy -c:a:0 aac -b:a:0 384k -c:a:1 aac -b:a:1 384k -metadata:s:a:0 language=ger -metadata:s:a:1 language=eng -movflags +faststart file.mp4

See also