Last active
December 24, 2015 09:18
-
-
Save AleksandrT/6775908 to your computer and use it in GitHub Desktop.
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
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