Skip to content

Instantly share code, notes, and snippets.

@macfanr
Last active July 2, 2017 11:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save macfanr/6aa06a79144ad454fa0d9546a970064d to your computer and use it in GitHub Desktop.
Save macfanr/6aa06a79144ad454fa0d9546a970064d to your computer and use it in GitHub Desktop.
remove logo with ffmpeg
#!/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