Using ffmpeg to cut and crop a movie file

Here are the commands to issue in order to crop and/or cut a movie file with ffmpeg:

# cutting:
ffmpeg -i [input_file] -qscale 0 -ss [start_seconds] -t [duration_seconds] [output_file]
# so for example:
ffmpeg -i BSX234.avi -qscale 0 -ss 00:00:30.0 -t 00:00:10.0 cut-BSX234.avi

# cropping:
ffmpeg -i [input_file] -vf crop=[w:h:x:y] -b 600k -r 10 -vcodec mpeg4 [output_file]
# so for example:
ffmpeg -i [input_file] -vf crop=320:480:160:0 -b 600k -r 10 -vcodec mpeg4 [output_file]

# combined cutting and cropping:
ffmpeg -i [input_file] -qscale 0 -ss [start_seconds] -t [duration_seconds] -vf crop=[w:h:x:y] [output_file]

# Here are some other useful commands:
# or
ffmpeg -ss 00:00:30.0 -t 00:00:10.0 -i [input_file] -acodec copy -vcodec copy -async 1 output.wmv

Resources

Comments