webcamstudio playlist plist generator howto

Amend this script for your own needs

Note that it converts filenames to lowercase and replaces spaces with _

The playlist is saved as playlist.plist

You may need to install efixtool if it is not included in your distro:
sudo apt-get install libimage-exiftool-perl

Here’s the script, enjoy.
p=$(pwd)

for i in *flv
do
OLDNAME="$i"
NEWNAME=`echo "$i" | tr ' ' '_' | tr A-Z a-z | sed s/_-_/-/g`
if [ "$NEWNAME" != "$OLDNAME" ]
then
TMPNAME="$i"_TMP
mv -v -- "$OLDNAME" "$TMPNAME"
mv -v -- "$TMPNAME" "$NEWNAME"
fi
if [ -d "$NEWNAME" ]
then
echo Recursing lowercase for directory "$NEWNAME"
$0 "$NEWNAME"
fi
done

for i in *flv
do
echo Scanning $i
x=$(exiftool "$i" | grep Totalduration | awk '{print $3}')
x=${x%%.*}
let x=x+1
echo $i is ${x%%.*} seconds long.
f=$p/$i
echo LOAD $f >> playlist.plist
echo SIZE 160x120 >> playlist.plist
echo LOOP >> playlist.plist
echo OPACITY 100 >> playlist.plist
echo POSITION 0,0 >> playlist.plist
echo PLAY $f,$x >> playlist.plist
echo >> playlist.plist
done

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

CommentLuv badge