Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save lucasrizoli/b034a1913d768ba25f8947a85bda6d89 to your computer and use it in GitHub Desktop.
Save lucasrizoli/b034a1913d768ba25f8947a85bda6d89 to your computer and use it in GitHub Desktop.
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