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, you can help support this site and get something for yourself by signing up for any of the services listed below through the provided links.

The following links are part of affiliate programs, and I will receive a referral payment from any of the services you sign-up for.

  • Get Faster Shipping: Perhaps you're about to order some stuff on 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.
  • Start Investing Now: Are you looking to start investing some of your disposable saved income? Get started by opening an account with Webull, where upon sign-up and opening a brokerage account with an initial deposit of at least $100 you will receive 1 stock valued (subject to change based on normal market movement) between $8 and $1600.

Thanks for reading and take care.