Created
March 27, 2015 11:05
-
-
Save schocco/21981bc00c37c851e3ca to your computer and use it in GitHub Desktop.
remove letterbox border with ffmpeg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# autodetect crop size | |
crop=`ffmpeg -i $1 -t 1 -vf cropdetect -f null - 2>&1 | awk '/crop/ { print $NF }' | tail -1` | |
# cut string from "crop=1280:528:0:0" to "crop=1280:528" | |
crop=`echo "${crop%:*}"` | |
crop=`echo "${crop%:*}"` | |
echo "detected crop fromat: $crop" | |
echo "input: $1" | |
echo "output: $2" | |
date ; read -t 5 -p "Hit ENTER or wait five seconds" ; date | |
ffmpeg -i $1 -crf 13 -acodec copy -vf $crop -y $2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment