#!/bin/bash # Make a DVD slideshow # Install dependencies DEPS= if [ ! -f /usr/bin/mkisofs ]; then DEPS=$DEPS mkisofs fi if [ ! -f /usr/bin/mpeg2enc ]; then DEPS="$DEPS mjpegtools" fi if [ ! -f /usr/bin/dvdauthor ]; then DEPS="$DEPS dvdauthor" fi if [ ! -f /usr/bin/convert ]; then DEPS="$DEPS imagemagick" fi if [ ! -f /usr/share/doc/gsfonts/README ]; then DEPS="$DEPS gsfonts" fi if [ ! -f /usr/bin/ffmpeg ]; then DEPS="$DEPS ffmpeg" fi if [ ! -f /usr/bin/sox ]; then DEPS="$DEPS sox" fi if [ ! -f /usr/bin/ppmtojpeg ]; then DEPS="$DEPS netpbm" fi if [ ! -f /usr/bin/lame ]; then DEPS="$DEPS lame" fi if [ ! -f /usr/bin/toolame ]; then DEPS="$DEPS toolame" fi if [ ! -f /usr/bin/jhead ]; then DEPS="$DEPS jhead" fi if [ ! -f /usr/bin/svn ]; then DEPS="$DEPS subversion" fi if [ ! -z "$DEPS" ]; then sudo apt-get install $DEPS; fi DFOL=$HOME/sil/dvd-slideshow TFOL=$HOME/sil/tmp mkdir $HOME/sil mkdir $TFOL mkdir $DFOL if [ ! -f $DFOL/dvd-menu ]; then svn co https://dvd-slideshow.svn.sourceforge.net/svnroot/dvd-slideshow $DFOL fi # All dependencies got. # Need to set this somehow FOL="/home/aquarius/Desktop/Olivia Party 2" AUDIO=$(ls -Qm "$FOL"/*.mp3) if [ ! -z "$AUDIO" ]; then $DFOL/dir2slideshow -c 1 -p -o $TFOL -n myslideshow \ -a "$FOL"/*.mp3 "$FOL" else $DFOL/dir2slideshow -c 1 -p -o $TFOL -n myslideshow "$FOL" fi # fix file to remove crossfade-to-fadeout bug python -c "fp=open('$TFOL/myslideshow.txt');data=fp.read();fp.close();fp=open('$TFOL/myslideshow.txt','w');fp.write(data.replace('crossfade:1\nfadeout:1','fadeout:1'))" $DFOL/dvd-slideshow -o $TFOL "$TFOL/myslideshow.txt" # change to Desktop so that the iso gets created there cd $HOME/Desktop $DFOL/dvd-menu -o $TFOL -nomenu -iso \ -f $TFOL/myslideshow.xml rm -rf $TFOL