#!/bin/bash ################################################# # WHAT is dvd2wav ? # Script to convert DVD audio chapters to wav. Ideal for concerts DVD. ################################################# # INFO # Authors : yeKcim - yeknan@yahoo.fr - http://yeknan.free.fr # Bobousse + Taliesin + Philippe (http://forum.ubuntu-fr.org/viewtopic.php?id=25000) # Licence : GNU GPL # Dependency # zenity # mplayer (mplayer-nogui if you don't want to install user interface) # Based on # WOM_audioconverter # NIS # http://www.letare.net/linux/install_system.html#rippSonDvd # History # 15.01.2006 : v0.1 : First public version # Install # Put on ~/.gnome2/nautilus-scripts/ # In a console : chmod u+x ~/.gnome2/nautilus-scripts/dvd2wav version="0.1" ################################################# # TRADUCTIONS ###### Default = English ##### title="dvd2wav "$version"" nobin="Program mplayer is not installed, please install !" titlechoice="Title to convert ?" chapdebchoice="First chapter to convert ?" chapfinchoice="Last chapter to convert ?" bepatient="Work in progress" case $LANG in ######## Français ######## fr* ) title="dvd2wav "$version"" nobin="Le programme mplayer n'est pas installé, veuillez l'installer !" titlechoice="Titre à convertir ?" chapdebchoice="Premier chapitre à convertir ?" chapfinchoice="Dernier chapitre à convertir ?" bepatient="Travail en cours" ;; esac ################################################# # PROGRAMME ######### Test dépendance ########## which mplayer 2>/dev/null if [ $? != 0 ] then zenity --error --title="$title" --text="$nobin" exit 0 fi #### Titre ? ##### while [ ! "$titre" ] # Réafficher la fenêtre tant que l'utilisateur n'a pas fait de choix do titre=`zenity --entry --title "$title" --text "$titlechoice" --entry-text "1"` ###### Choix -> Sortie boucle ###### if [ $? != 0 ]; then exit 1 fi [ $? -ne 0 ] && exit 2 # Annulation done #### Chapitre de début ? ##### while [ ! "$chapdeb" ] # Réafficher la fenêtre tant que l'utilisateur n'a pas fait de choix do chapdeb=`zenity --entry --title "$title" --text "$chapdebchoice" --entry-text "1"` ###### Choix -> Sortie boucle ###### if [ $? != 0 ]; then exit 1 fi [ $? -ne 0 ] && exit 2 # Annulation done #### Chapitre de fin ? ##### while [ ! "$chapfin" ] # Réafficher la fenêtre tant que l'utilisateur n'a pas fait de choix do chapfin=`zenity --entry --title "$title" --text "$chapfinchoice" --entry-text "2"` ###### Choix -> Sortie boucle ###### if [ $? != 0 ]; then exit 1 fi [ $? -ne 0 ] && exit 2 # Annulation done ############ Programme ############# folder=~/dvd2wav mkdir $folder nbchap=$[$chapfin-$chapdeb+1] chap=$chapdeb compteur=0 (while [ $chap -le $chapfin ];do let "compteur += 1" echo "# $bepatient : $compteur / $nbchap" mplayer -vo null -ao pcm:file=$folder\/$titre-$chap\.wav -chapter $chap\-$chap dvd://$titre 1>/dev/null chap=$[$chap+1] let "progress = compteur*100/nbchap" echo $progress done)| zenity --progress --auto-close --title="$title" --percentage=0