Last active
July 2, 2017 11:40
-
-
Save macfanr/6aa06a79144ad454fa0d9546a970064d to your computer and use it in GitHub Desktop.
remove logo with ffmpeg
This file contains hidden or 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/sh | |
if [ $# != 2 ]; then | |
echo "usage: videoshot.sh /Users/danny/MyVideoDir /Users/danny/MyOutputDir" | |
exit -1 | |
fi | |
inputDir=$1 | |
outputDir=$2 | |
binaryEXE=./ffmpeg | |
fixImageDir=$outputDir/myVideos | |
if [ ! -f "$binaryEXE" ]; then | |
echo "sorry, not found ffmpeg command line tool" | |
exit | |
fi | |
if [ ! -x "$fixImageDir" ]; then | |
mkdir "$fixImageDir" | |
fi | |
for file in $inputDir/*.mp4 | |
do | |
name="${file##*/}" | |
videoName=$fixImageDir/$name | |
$binaryEXE -y -hide_banner -i "${file}" -vf "delogo=x=850:y=506:w=100:h=30:band=2" -c:v hwaenc -apenc libapenc.dylib -f mp4 "${videoName}" | |
done; | |
open -R "$fixImageDir" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment