Skip to content

Instantly share code, notes, and snippets.

@t27
Created March 26, 2020 19:36
Show Gist options
  • Save t27/6ceb602fc1c36ae578f639e7b92c036f to your computer and use it in GitHub Desktop.
Save t27/6ceb602fc1c36ae578f639e7b92c036f to your computer and use it in GitHub Desktop.
Crop video visually using ffmpeg - https://linuxhint.com/crop_videos_linux/
# Got this from https://linuxhint.com/crop_videos_linux/
ffmpeg -i in.mp4 -filter:v "crop=out_w:out_h:x:y" out.mp4
# Where:
# “in.mp4” refers to the input file to be converted
# “out.mp4” is the name of the output file to be saved after conversion
# out_w is the width of your desired output rectangle to which the original video’s width will be reduced
# out_h is the height of your output rectangle to which the original video’s height will be reduced
# x and y are the position coordinates for the top left corner of your desired output rectangle
# If you want to crop a 1280×720 rectangle from a 1920×1080 resolution video with a starting rectangle position of 10, 10; your command would be:
ffmpeg -i in.mp4 -filter:v "crop=1280:720:10:10" out.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment