ThorneLabs

ffmpeg Commands Cheat Sheet

• Updated March 17, 2019


ffmpeg is the swiss army knife of video and audio processing tools.

This post will be an ever growing list of ffmpeg commands I have found useful.

Get Info About Audio/Video File

ffmpeg -i INPUT

Convert from MOV to MP4 Container

Assuming the source video codec is compatible with the MP4 container, no re-encoding will be necessary. There won’t be any loss in quality.

ffmpeg -i INPUT.mov -c:v copy -c:a copy OUTPUT.mp4

Convert Video to DVD Compatible MPEG

ffmpeg -i INPUT -target ntsc-dvd OUTPUT.mp4

Add faststart Flags to Video File

Adding faststart flags to a video file will allow the video file to begin playing as soon as possible instead of waiting for the entire video file to download in a compatible web browser.

ffmpeg -i INPUT -c:a libfaac -c:v copy -movflags faststart OUTPUT

Extract Audio Only from Video File

ffmpeg -i INPUT -vn -c:a copy OUTPUT

Extract Video Only from Video File

ffmpeg -i INPUT -an -c:v copy OUTPUT

Transpose and/or Flip a Video File

Refer to post: Correct Smartphone Video Orientation and How To Rotate iOS and Android Videos with ffmpeg.

References

If you found this post useful and would like to help support this site - and get something for yourself - sign up for any of the services listed below through the provided affiliate links. I will receive a referral payment from any of the services you sign-up for.

Get faster shipping and more with Amazon Prime: About to order something from Amazon but want to get more value out of the money you would normally pay for shipping? Sign-up for a free 30-day trial of Amazon Prime to get free two-day shipping, access to thousands of movies and TV shows, and more.

Thanks for reading and take care.