Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
ffmpeg commands
# Convert input.avi to out.mp4
ffmpeg -i input.avi -c:v libx264 -crf 19 -preset slow -c:a aac -b:a 192k -ac 2 out.mp4
# Clip using ffmpeg
## no reencode
ffmpeg -i in.mp4 -ss [start] -t [duration] -c copy out.mp4
ffmpeg -i in.mp4 -ss [start] -to [end] -c copy out.mp4
## yes reencode
ffmpeg -ss [start] -i in.mp4 -t [duration] -c:v libx264 -c:a aac -strict experimental -b:a 128k out.mp4
## crop reencode
ffmpeg -i in.mp4 -ss [start] -to [end] -c:v libx264 -strict experimental -filter:v "crop=256:180:1023:138" out.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.