Skip to content

Instantly share code, notes, and snippets.

@somoso
Created January 8, 2020 09:22
Show Gist options
  • Save somoso/986d123663af161c6fbd67973186c721 to your computer and use it in GitHub Desktop.
Save somoso/986d123663af161c6fbd67973186c721 to your computer and use it in GitHub Desktop.
Cropping black bars out of a video using ffmpeg
#!/bin/bash
# First argument is the video file with the black borders that need to be removed
# Second argument is the resulting video
ffmpeg -i $1 -vf "$(ffmpeg -i $1 -t 1 -vf cropdetect -f null - 2>&1 | awk '/crop/ { print $NF }' | tail -1)" $2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment