continuous improvement | Home | Services | FAQs | Notes | Contact Us |
The following command will copy the H.264 stream in a Quicktime movie file to a mp4 container file without re-encoding the video stream with FFMPEG. This is good for keeping file size the same as the original file, and it's quicker than encoding. The other benefit is that the output mp4 file works with the HTML 5 video element on Safari, Chrome, Firefox and IE(11) at the time of writing. The output files reside in the same folder as the source and do not contain an audio stream.
$ ffmpeg -i <inputfile>.mov -c:v copy -an -sn <outputfile>.mp4
Copy video stream -c:v copy
Disable audio stream -an
Disable subtitle stream -sn
There is also a -f mp4
option that specifies the output format. This can be automatically determined by the output file type.
#!/bin/bash
find "$1" -name '*.mov' -execdir sh -c '~/ffmpeg -i "$0" -c:v copy -an "${0%%.mov}.mp4"' {} /;
The $1
is the source folder containing the movie files and is passed as a parameter to the script.
Path to the ffmpeg binary ~/ffmpeg
. This one is in the user's home folder.
http://blog.superuser.com/2012/02/24/ffmpeg-the-ultimate-video-and-audio-manipulation-tool/