dvd_menu () { local FILE_SRC="$1" local FILE_DST="$2" local VIDEO_FPS="$3" local VIDEO_GEOMETRY="$4" local MPEG_TO_ENC_N="" # touch $TEMPORARY # if [ "$VIDEO_FPS" = "25" ] then MPEG_TO_ENC_N="p" else MPEG_TO_ENC_N="n" fi # # Reduce the source picture to two colors: should be # black ink on white background. # convert -geometry $VIDEO_GEOMETRY! \ -posterize 2 $FILE_SRC $TEMPORARY.background.jpg # # Reduce the source picture to two colors and set white to # transparent. # convert -geometry $VIDEO_GEOMETRY! \ -transparent white \ -posterize 2 $FILE_SRC $TEMPORARY.black.png # # Make a copy with blue color (instead of black). # convert -fill blue \ -colorize 100% \ $TEMPORARY.black.png $TEMPORARY.blue.png # # Make a copy with red color (instead of black). # convert -fill red \ -colorize 100% \ $TEMPORARY.black.png $TEMPORARY.red.png # # Make a copy with green color (instead of black). # convert -fill green \ -colorize 100% \ $TEMPORARY.black.png $TEMPORARY.green.png # # Make a movie with the menu. # jpeg2yuv -n 50 -I p -f $VIDEO_FPS -j $TEMPORARY.background.jpg | \ mpeg2enc -n $MPEG_TO_ENC_N -f 3 -b 200 -o $TEMPORARY.m2v # # Make a silent sound track. # dd if="/dev/zero" bs=4 count=1600 | \ toolame -b 128 -s 48 /dev/stdin $TEMPORARY.mp2 # # Multiplex # mplex -f 8 -o $TEMPORARY.vob $TEMPORARY.m2v $TEMPORARY.mp2 # # Prepare the Spumux XML file. # printf "" > $TEMPORARY.spumux echo "" >> $TEMPORARY.spumux echo " " >> $TEMPORARY.spumux echo " > $TEMPORARY.spumux echo " image=\"$TEMPORARY.black.png\"" >> $TEMPORARY.spumux echo " select=\"$TEMPORARY.green.png\"" >> $TEMPORARY.spumux echo " highlight=\"$TEMPORARY.red.png\"" >> $TEMPORARY.spumux echo " force=\"yes\"" >> $TEMPORARY.spumux echo " autooutline=\"infer\"" >> $TEMPORARY.spumux echo " outlinewidth=\"15\"" >> $TEMPORARY.spumux echo " autoorder=\"rows\">" >> $TEMPORARY.spumux echo " " >> $TEMPORARY.spumux echo " " >> $TEMPORARY.spumux echo "" >> $TEMPORARY.spumux # # Run Spumux. # spumux $TEMPORARY.spumux < $TEMPORARY.mpg > $TEMPORARY.vob # # Remove temporary files. # rm -f $TEMPORARY* }