Skip to content

Instantly share code, notes, and snippets.

@amaranter
Last active December 6, 2016 01:20
Show Gist options
  • Save amaranter/bdb4a87beeef023dac16 to your computer and use it in GitHub Desktop.
Save amaranter/bdb4a87beeef023dac16 to your computer and use it in GitHub Desktop.
FFmpeg Tips

#FFmpeg Tips

##Table of Contents

###Convert .mov to .mp4 Command:
ffmpeg -i video_vivo.mov -qscale 0 -pix_fmt yuv420p output.mp4

###Convert .mp4 to .ogv Command:
ffmpeg -i inputFile.mp4 -acodec libvorbis -ac 2 -ab 128k -ar 44100 -b:v 1200k -s 730x525 outputFile.ogv

###Convert .mp4 to .webm Command:
ffmpeg -i input.mp4 -vcodec libvpx -acodec libvorbis -aq 5 -ac 2 -qmax 25 -b 900 output.webm

-acodec libvorbis for encoding with Vorbis audio codec
-aq 5 audio quality(0-10) with a higher number for better quality channel
-qmax 25 is maximum quantizer with lower value for better quality
-b 614400 specifies the bitrate ( 600 kbps video,600 x 1024 = 614400)
-s 1280x720 specifies the size in terms of width by height

###Convert .avi to mp4 Command:
ffmpeg -i input_file.avi -codec:v libx264 -profile:v high -preset slow -b:v 1236k -maxrate 900k -bufsize 1000k -threads 0 -codec:a libfdk_aac -b:a 128k output_file.mp4

Optimize mp4

Command:
ffmpeg -i input_file.mp4 -codec:v libx264 -profile:v high -preset slow -b:v 1236k -maxrate 900k -bufsize 1000k -threads 0 -codec:a libfdk_aac -b:a 128k output_file.mp4

Scalling (Resize)

Parameters:
-vf scale=884:502

Create thumbnail from first video frame

Command:
ffmpeg -i input.flv -ss 00:00:00 -vframes 1 out.png

EOF: https://trac.ffmpeg.org/wiki/Create%20a%20thumbnail%20image%20every%20X%20seconds%20of%20the%20video

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment