Skip to content

Instantly share code, notes, and snippets.

@AleksandrT
Last active December 24, 2015 09:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AleksandrT/6775908 to your computer and use it in GitHub Desktop.
Save AleksandrT/6775908 to your computer and use it in GitHub Desktop.
SOURCE="/../flv/1"
DESTINATION="/../wiki/1"
if [[ ! -d $SOURCE ]]; then
echo "$SOURCE doest exist"
exit
fi
if [[ ! -d $DESTINATION ]]; then
echo "'$DESTIANTION' doest exists!"
exit
fi
cd "$SOURCE"
NUM_FILES=`ls | wc -l`
COUNT=0
read -p "Are you sure you want to re-encode $NUM_FILES from '$SOURCE' to '$DESTINATION'? [y/N] " PROMPT
if [[ "$PROMPT" != "y" ]]; then
echo "Aborting."
exit
fi
for i in *.flv; do
((COUNT++))
/usr/bin/ffmpeg -i $i -vf drawtext="fontfile=/usr/share/fonts/DejaVuSerif.ttf:text='spreadthesign':\
x=(main_w-text_w): y=10: fontsize=14: fontcolor=white@0.8" $DESTINATION/${i%.*}.ogv
done
echo -e "\033[0;32mRe-encoding of $NUM_FILES files complete!\033[0m"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment