#!/bin/bash # version 0.65 # Copyleft JOTENAKIS # ce script est sous license GPL # merci à tous les membres de OSA qui m'ont donné un coup de main et en particulier à zeb_ ;-) # TODO : verif presence mplayer, mencoder, transcode,title_infos... # TODO : verif place HDD # TODO : modes --vob # COULEURS COLOROFF="\033[1;0m" # standart color HEADCOLOR="\033[1;32m" # green MAINCOLOR="\033[1;37m" # white SUBCOLOR="\033[1;36m" # blue TABLECOLOR="\033[1;31m" # red INPUTCOLOR="\033[1;35m" # lilac echo -e "${TABLECOLOR}+------------------+" echo -e "|${HEADCOLOR} TUXRIP v0.65 ${TABLECOLOR} |" echo -e "${TABLECOLOR}+------------------+" echo -e "$MAINCOLOR" # Début --- Reprise après extinction if [ -r ~/.tuxripextinction ]; then #on lit les variables nécéssaires dans le log, le txriprc et le tuxripextinction RACINE=`cat ~/.tuxripextinction | awk '{print $1}'` projet=`cat ~/.tuxripextinction | awk '{print $2}'` decalinit=`cat ~/.tuxriprc | grep synchro | awk '{print $4}'` VO=`cat ~/.tuxriprc | grep video | awk '{print $4}'` AO=`cat ~/.tuxriprc | grep "drivers audio" | awk '{print $4}'` tailleCD=`cat $RACINE/$projet/tmp/log | grep bitrate | awk '{print $6}'` echo "-->Le projet $RACINE/$projet s'est terminée précédemment grâce à l'option --extinction." echo "-->Toutes les options de tuxrip sont ignorées." echo "-->On effectue maintenant la dernière étape : mixage et synchronisation A/V." # on finit le projet : mixage echo -e "${TABLECOLOR}+++++++++++++++MIXAGE A/V+++++++++++++++++++++++++++++++++++++++" echo -e "${MAINCOLOR}" pas=300 decal=$decalinit epsi=0 test="notok" until [ "$test" = "ok" ] do echo -e "${HEADCOLOR}Mixage en cours avec un décalage de "$decal "ms" ogmmerge -q -o $RACINE/$projet/video/${projet}.ogm $RACINE/$projet/video/${projet}sans-son.avi -s $decal $RACINE/$projet/audio/son.ogg echo -e "${MAINCOLOR} >>>> Vérifiez la synchronisation puis quittez en pressant ECHAP <<<<" mplayer -vo $VO -ao $AO $RACINE/$projet/video/${projet}.ogm > /dev/null 2>&1 rep="notok" until [ "$rep" = "ok" ] do echo -e -n "${SUBCOLOR}-------> Son en retard (-), en avance (+), ou synchrone (0) ? " echo -e -n "${INPUTCOLOR}> " read test echo epsiold=$epsi case $test in -) epsi=-1 rep="ok" ;; +) epsi=1 rep="ok" ;; 0) test="ok" rep="ok";; *) echo "Erreur de frappe..." rep="notok" ;; esac done depasse=`bc < " $decal >> $RACINE/$projet/tmp/log date >> $RACINE/$projet/tmp/temps.log case $tailleCD in 1300 ) echo -e "${TABLECOLOR}+++++++++++++++DECOUPAGE+++++++++++++++++++++++++++++++++++++" echo -e "${MAINCOLOR}" ogmsplit $RACINE/$projet/video/${projet}.ogm -s 650 mv $RACINE/$projet/video/${projet}-*1.ogm $RACINE/$projet/video/cd1 mv $RACINE/$projet/video/${projet}-*2.ogm $RACINE/$projet/video/cd2;; 1404 ) echo -e "${TABLECOLOR}+++++++++++++++DECOUPAGE+++++++++++++++++++++++++++++++++++++" echo -e "${MAINCOLOR}" ogmsplit $RACINE/$projet/video/${projet}.ogm -s 702 mv $RACINE/$projet/video/${projet}-*1.ogm $RACINE/$projet/video/cd1 mv $RACINE/$projet/video/${projet}-*2.ogm $RACINE/$projet/video/cd2 ;; esac echo -e "${TABLECOLOR}+++++++++++++++INFORMATIONS+++++++++++++++++++++++++++++++++++++" echo -e "${MAINCOLOR}" taillefilm=`bc <Mode test : Seul le 1er chapitre sera rippé/encodé..." shift;; --resume ) resume="OK" echo "-->Mode resume : Un projet existant va être poursuivi..." shift;; --xvid ) xvid="OK" echo "-->Mode xvid : Encodage video en Xvid au lieu de lavc..." shift;; --config ) [ -r ~/.tuxriprc ] && rm -f ~/.tuxriprc touch ~/.tuxriprc echo "-->Mode config : Le fichier de préférence va être généré..." #repertoire de travail exist=notok until [ "$exist" = "OK" ] do echo -n -e "${SUBCOLOR}-------> Répertoire de travail [défaut : /space] ? " echo -n -e "${INPUTCOLOR}> " read RACINE if [ "$RACINE" = "" ] ; then RACINE=/space echo "Choix par défaut : /space" fi if [ -d "$RACINE" ]; then exist=OK else echo -e "${HEADCOLOR}Ce répertoire n'existe pas..." fi done echo "Rep de travail : " $RACINE >> ~/.tuxriprc #device exist=notok until [ "$exist" = "OK" ] do echo -n -e "${SUBCOLOR}-------> Device du DVD [défaut : /dev/dvd] ? " echo -n -e "${INPUTCOLOR}> " read DEVICE if [ "$DEVICE" = "" ] ; then DEVICE=/dev/dvd echo "Choix par défaut : /dev/dvd" fi if [ -r "$DEVICE" ]; then exist=OK else echo -e "${HEADCOLOR}Ce device n'existe pas..." fi done echo "device du dvd : " $DEVICE >> ~/.tuxriprc # decalage initial de synchronisation en ms isnum="" while [ "$isnum" = "" ] do echo -n -e "${SUBCOLOR}-------> Décalage initial A/V pour la synchro en ms [défaut : 0] ? " echo -n -e "${INPUTCOLOR}> " read decalinit if [ "$decalinit" = "" ] ; then decalinit=0 echo "Choix par défaut : 0 ms" fi isnum=`echo $decalinit | grep "^[-0-9][0-9]*$"` if [ "$isnum" = "" ] ; then isnum=`echo $decalinit | grep "^[0-9][0-9]*$"` if [ "$isnum" = "" ] ; then echo "Erreur : le décalage doit être un entier..." fi fi done echo "synchro init : " $decalinit >> ~/.tuxriprc # options libavcodec echo -n -e "${SUBCOLOR}-------> Options d'encodage video libavcodec [défaut : vcodec=mpeg4:vqmin=2:vqmax=20:vmax_b_frames=0:vhq:keyint=250:vme=4:v4mv] ? " echo -n -e "${INPUTCOLOR}> " read LAVCOPT if [ "$LAVCOPT" = "" ] ; then LAVCOPT="vcodec=mpeg4:vqmin=2:vqmax=20:vmax_b_frames=0:vhq:keyint=250:vme=4:v4mv" echo "Choix par défaut..." fi echo "options libavcodec : " $LAVCOPT >> ~/.tuxriprc # options xvid echo -n -e "${SUBCOLOR}-------> Options d'encodage video xvid [défaut : quality=6:min_key_interval=6:max_key_interval=250:keyframe_boost=30] ? " echo -n -e "${INPUTCOLOR}> " read XVIDOPT if [ "$XVIDOPT" = "" ] ; then XVIDOPT="quality=6:min_key_interval=6:max_key_interval=250:keyframe_boost=30" echo "Choix par défaut..." fi echo "options xvid : " $XVIDOPT >> ~/.tuxriprc # normalisation maxi echo -n -e "${SUBCOLOR}-------> Gain maximum utilisé pour la normalisation audio [défaut : 3] ? " echo -n -e "${INPUTCOLOR}> " read gainmax if [ "$gainmax" = "" ] ; then gainmax=3 echo "Choix par défaut : 3" fi echo "gain audio max : " $gainmax >> ~/.tuxriprc # drivers video mplayer verif="notok" while [ "$verif" = "notok" ]; do echo -n -e "${SUBCOLOR}-------> Driver video (x11, xv, sdl) [défaut : xv] ? " echo -n -e "${INPUTCOLOR}> " read VO case $VO in x11 | xv | sdl ) verif="OK" ;; "" ) verif="OK" VO="xv" echo "Choix par défaut : xv" ;; * ) echo "Erreur : seuls (x11, xv, sdl) sont dispos" verif="notok" ;; esac done echo "drivers video : " $VO >> ~/.tuxriprc # drivers audio mplayer verif="notok" while [ "$verif" = "notok" ]; do echo -n -e "${SUBCOLOR}-------> Driver audio (oss, alsa9, sdl) [défaut : oss] ? " echo -n -e "${INPUTCOLOR}> " read AO case $AO in oss | alsa9 | sdl ) verif="OK" ;; "" ) verif="OK" AO="oss" echo "Choix par défaut : oss" ;; * ) echo "Erreur : seuls (oss, alsa9, sdl) sont dispos" verif="notok" ;; esac done echo "drivers audio : " $AO >> ~/.tuxriprc # Chaine SCSI du graveur echo -n -e "${SUBCOLOR}-------> Chaine SCSI du graveur [défaut : 0,3,0] ? " echo -n -e "${INPUTCOLOR}> " read graveur if [ "$graveur" = "" ]; then graveur="0,3,0" echo "Choix par défaut : 0,3,0" fi echo "graveur : " $graveur >> ~/.tuxriprc # Vitesse de gravure isnum="" while [ "$isnum" = "" ] do echo -n -e "${SUBCOLOR}-------> Vitesse de gravure [défaut : 12] ? " echo -n -e "${INPUTCOLOR}> " read vitesse if [ "$vitesse" = "" ] ; then vitesse=12 echo "Choix par défaut : 12X" fi isnum=`echo $vitesse | grep "^[0-9][0-9]*$"` if [ "$isnum" = "" ] ; then echo "Erreur : la vitesse de gravure doit être un entier..." fi done echo "vitesse gravure : " $vitesse >> ~/.tuxriprc echo -e "${MAINCOLOR}" # visualisateur d'images test="notok" until [ "$test" = "ok" ] do echo -n -e "${SUBCOLOR}-------> Visualisateur d'images (gqview, eog, kview, imview, display) [défaut : gqview] ? " echo -n -e "${INPUTCOLOR}> " read visu if [ "$visu" = "" ] ; then visu="gqview" echo "Choix par défaut : gqview" fi case $visu in gqview | eog | kview | imview | display ) test="ok" ;; * ) test="notok" esac done echo "visualisateur : " $visu >> ~/.tuxriprc echo -e "${MAINCOLOR}" exit ;; --verif-prefs ) if [ -r ~/.tuxriprc ] ; then echo "-->Mode verif-prefs : les variables du fichier tuxriprc sont affichées..." RACINE=`cat ~/.tuxriprc | grep travail | awk '{print $5}'` DEVICE=`cat ~/.tuxriprc | grep device | awk '{print $5}'` decalinit=`cat ~/.tuxriprc | grep synchro | awk '{print $4}'` LAVCOPT=`cat ~/.tuxriprc | grep libavcodec | awk '{print $4}'` XVIDOPT=`cat ~/.tuxriprc | grep xvid | awk '{print $4}'` gainmax=`cat ~/.tuxriprc | grep gain | awk '{print $5}'` VO=`cat ~/.tuxriprc | grep video | awk '{print $4}'` AO=`cat ~/.tuxriprc | grep "drivers audio" | awk '{print $4}'` graveur=`cat ~/.tuxriprc | grep "graveur" | awk '{print $3}'` vitesse=`cat ~/.tuxriprc | grep "gravure" | awk '{print $4}'` visu=`cat ~/.tuxriprc | grep "visualisateur" | awk '{print $3}'` echo echo -e "${HEADCOLOR}Répertoire de travail : ${SUBCOLOR}"$RACINE echo -e "${HEADCOLOR}Device du DVD : ${SUBCOLOR}"$DEVICE echo -e "${HEADCOLOR}Décalage A/V initial : ${SUBCOLOR}"$decalinit"${HEADCOLOR} ms" echo -e "${HEADCOLOR}Options libavcodec : ${SUBCOLOR}"$LAVCOPT echo -e "${HEADCOLOR}Options xivd : ${SUBCOLOR}"$XVIDOPT echo -e "${HEADCOLOR}Gain audio maxi : ${SUBCOLOR}"$gainmax echo -e "${HEADCOLOR}Driver vidéo : ${SUBCOLOR}"$VO echo -e "${HEADCOLOR}Driver audio : ${SUBCOLOR}"$AO echo -e "${HEADCOLOR}Graveur : ${SUBCOLOR}"$graveur echo -e "${HEADCOLOR}Vitesse de gravure : ${SUBCOLOR}"$vitesse"${HEADCOLOR}X" echo -e "${HEADCOLOR}Visualisateur : ${SUBCOLOR}"$visu else echo "Fichier de préférences non trouvé : relancer tuxrip en mode --config" fi echo -e "${MAINCOLOR}" exit;; --help ) echo "Mode help : tuxrip peut être lancé avec les options suivantes :" echo " --config : pour générer le fichier de préférences ~/.tuxriprc." echo " --desentrelace : pour forcer le désentrelacement d'une source PAL entrelacée." echo " --extinction : pour éteindre le PC après l'encodage vidéo." echo " --help : pour afficher ce contenu ;-)." #echo " --purge : pour supprimer tous les projets du repertoire de travail." echo " --resume : pour reprendre un encodage déjà effectué partiellement ou totalement." echo " --test : pour ne ripper que le 1er chapitre d'un DVD (permet de tester le script rapidement)." echo " --verif-prefs : pour vérifier le contenu du fichier de préférences." echo " --xvid : pour encoder en xvid à la place de libavcodec (expérimental)." shift exit;; --desentrelace ) echo "-->Mode desentrelace : la video sera desentrelacée pendant l'encodage..." lb="OK" shift;; --extinction ) echo "-->Mode extinction : le PC sera éteint après l'encodage video et le mixage A/V sera effectué au prochain démarrage de tuxrip..." extinction="OK" shift;; # --purge ) echo "-->Mode purge : tous les projets contenu dans le répertoire de travail vont être supprimés..." # RACINE=`cat ~/.tuxriprc | grep travail | awk '{print $5}'` # ls -l $RACINE # shift # exit;; --grave ) echo "-->Mode grave : la vidéo sera gravée à la fin du processus d'encodage..." grave="OK" shift;; * ) echo "Option inconnue : $1, donc ignorée..." shift;; esac done # LECTURE FICHIER DE PREFS------------------------------- if [ -r ~/.tuxriprc ] ; then RACINE=`cat ~/.tuxriprc | grep travail | awk '{print $5}'` DEVICE=`cat ~/.tuxriprc | grep device | awk '{print $5}'` decalinit=`cat ~/.tuxriprc | grep synchro | awk '{print $4}'` LAVCOPT=`cat ~/.tuxriprc | grep libavcodec | awk '{print $4}'` XVIDOPT=`cat ~/.tuxriprc | grep xvid | awk '{print $4}'` gainmax=`cat ~/.tuxriprc | grep gain | awk '{print $5}'` VO=`cat ~/.tuxriprc | grep video | awk '{print $4}'` AO=`cat ~/.tuxriprc | grep "drivers audio" | awk '{print $4}'` graveur=`cat ~/.tuxriprc | grep "graveur" | awk '{print $3}'` vitesse=`cat ~/.tuxriprc | grep "gravure" | awk '{print $4}'` visu=`cat ~/.tuxriprc | grep "visualisateur" | awk '{print $3}'` else echo "Fichier de préférences non trouvé : relancer tuxrip en mode --config" exit fi # CREATION DU PROJET------------------------------- verif=n while [ "$verif" = "n" ] do echo -n -e "${SUBCOLOR}-------> Nom du projet [défaut : DVD] ? " echo -n -e "${INPUTCOLOR}> " read projet if [ "$projet" = "" ] ; then projet=DVD echo "Choix par défaut : DVD" fi echo -e "${MAINCOLOR}" if [ -d $RACINE/$projet ] ; then if [ "$resume" = "OK" ]; then onestou=`awk 'END {print NR}' $RACINE/$projet/tmp/log` echo "Etape(s) effectuée(s) :" case $onestou in 1) echo -e "${SUBCOLOR}-->1)scan du DVD" title=`cat $RACINE/$projet/tmp/log | grep scan | awk '{print $5}'` angle=`cat $RACINE/$projet/tmp/log | grep scan | awk '{print $6}'` index=`cat $RACINE/$projet/tmp/log | grep scan | awk '{print $7}'` pisteaudio=`cat $RACINE/$projet/tmp/log | grep scan | awk '{print $8}'` aspect=`cat $RACINE/$projet/tmp/log | grep scan | awk '{print $9}'` resXdvd=`cat $RACINE/$projet/tmp/log | grep scan | awk '{print $10}'` resYdvd=`cat $RACINE/$projet/tmp/log | grep scan | awk '{print $11}'` fps=`cat $RACINE/$projet/tmp/log | grep scan | awk '{print $12}'` credits=`cat $RACINE/$projet/tmp/log | grep scan | awk '{print $13}'` echo -e "${HEADCOLOR}Titre : "$title echo -e "${HEADCOLOR}Angle : "$angle echo -e "${HEADCOLOR}Piste audio : "$index echo -e "${HEADCOLOR}Langue : "$pisteaudio echo -e "${HEADCOLOR}AR : "$aspect echo -e "${HEADCOLOR}ResXdvd : "$resXdvd echo -e "${HEADCOLOR}ResYdvd : "$resYdvd echo -e "${HEADCOLOR}Framerate : "$fps echo -e "${HEADCOLOR}1ere frame du générique : "$credits ;; 2) echo -e "${SUBCOLOR}-->1)scan du DVD" title=`cat $RACINE/$projet/tmp/log | grep scan | awk '{print $5}'` angle=`cat $RACINE/$projet/tmp/log | grep scan | awk '{print $6}'` index=`cat $RACINE/$projet/tmp/log | grep scan | awk '{print $7}'` pisteaudio=`cat $RACINE/$projet/tmp/log | grep scan | awk '{print $8}'` aspect=`cat $RACINE/$projet/tmp/log | grep scan | awk '{print $9}'` resXdvd=`cat $RACINE/$projet/tmp/log | grep scan | awk '{print $10}'` resYdvd=`cat $RACINE/$projet/tmp/log | grep scan | awk '{print $11}'` fps=`cat $RACINE/$projet/tmp/log | grep scan | awk '{print $12}'` credits=`cat $RACINE/$projet/tmp/log | grep scan | awk '{print $13}'` echo -e "${HEADCOLOR}Titre : "$title echo -e "${HEADCOLOR}Angle : "$angle echo -e "${HEADCOLOR}Piste audio : "$index echo -e "${HEADCOLOR}Langue : "$pisteaudio echo -e "${HEADCOLOR}AR : "$aspect echo -e "${HEADCOLOR}ResXdvd : "$resXdvd echo -e "${HEADCOLOR}ResYdvd : "$resYdvd echo -e "${HEADCOLOR}Framerate : "$fps echo -e "${HEADCOLOR}1ere frame du générique : "$credits echo -e "${SUBCOLOR}-->2)rip du DVD" ;; 3) echo -e "${SUBCOLOR}-->1)scan du DVD" title=`cat $RACINE/$projet/tmp/log | grep scan | awk '{print $5}'` angle=`cat $RACINE/$projet/tmp/log | grep scan | awk '{print $6}'` index=`cat $RACINE/$projet/tmp/log | grep scan | awk '{print $7}'` pisteaudio=`cat $RACINE/$projet/tmp/log | grep scan | awk '{print $8}'` aspect=`cat $RACINE/$projet/tmp/log | grep scan | awk '{print $9}'` resXdvd=`cat $RACINE/$projet/tmp/log | grep scan | awk '{print $10}'` resYdvd=`cat $RACINE/$projet/tmp/log | grep scan | awk '{print $11}'` fps=`cat $RACINE/$projet/tmp/log | grep scan | awk '{print $12}'` credits=`cat $RACINE/$projet/tmp/log | grep scan | awk '{print $13}'` echo -e "${HEADCOLOR}Titre : "$title echo -e "${HEADCOLOR}Angle : "$angle echo -e "${HEADCOLOR}Piste audio : "$index echo -e "${HEADCOLOR}Langue : "$pisteaudio echo -e "${HEADCOLOR}AR : "$aspect echo -e "${HEADCOLOR}ResXdvd : "$resXdvd echo -e "${HEADCOLOR}ResYdvd : "$resYdvd echo -e "${HEADCOLOR}Framerate : "$fps echo -e "${HEADCOLOR}1ere frame du générique : "$credits echo -e "${SUBCOLOR}-->2)rip du DVD" echo -e "${SUBCOLOR}-->3)encodage audio" qualite=`cat $RACINE/$projet/tmp/log | grep audio | awk '{print $4}'` echo -e "${HEADCOLOR}Qualité audio : "$qualite ;; 4) echo -e "${SUBCOLOR}-->1)scan du DVD" title=`cat $RACINE/$projet/tmp/log | grep scan | awk '{print $5}'` angle=`cat $RACINE/$projet/tmp/log | grep scan | awk '{print $6}'` index=`cat $RACINE/$projet/tmp/log | grep scan | awk '{print $7}'` pisteaudio=`cat $RACINE/$projet/tmp/log | grep scan | awk '{print $8}'` aspect=`cat $RACINE/$projet/tmp/log | grep scan | awk '{print $9}'` resXdvd=`cat $RACINE/$projet/tmp/log | grep scan | awk '{print $10}'` resYdvd=`cat $RACINE/$projet/tmp/log | grep scan | awk '{print $11}'` fps=`cat $RACINE/$projet/tmp/log | grep scan | awk '{print $12}'` credits=`cat $RACINE/$projet/tmp/log | grep scan | awk '{print $13}'` echo -e "${HEADCOLOR}Titre : "$title echo -e "${HEADCOLOR}Angle : "$angle echo -e "${HEADCOLOR}Piste audio : "$index echo -e "${HEADCOLOR}Langue : "$pisteaudio echo -e "${HEADCOLOR}AR : "$aspect echo -e "${HEADCOLOR}ResXdvd : "$resXdvd echo -e "${HEADCOLOR}ResYdvd : "$resYdvd echo -e "${HEADCOLOR}Framerate : "$fps echo -e "${HEADCOLOR}1ere frame du générique : "$credits echo -e "${SUBCOLOR}-->2)rip du DVD" echo -e "${SUBCOLOR}-->3)encodage audio" qualite=`cat $RACINE/$projet/tmp/log | grep audio | awk '{print $4}'` echo -e "${HEADCOLOR}Qualité audio : "$qualite echo -e "${SUBCOLOR}-->4)cropping auto" crop=`cat $RACINE/$projet/tmp/log | grep cropping | awk '{print $3}'` haut=`cat $RACINE/$projet/tmp/log | grep cropping | awk '{print $4}'` larg=`cat $RACINE/$projet/tmp/log | grep cropping | awk '{print $5}'` echo -e "${HEADCOLOR}Cropping : "$crop ;; 5) echo -e "${SUBCOLOR}-->1)scan du DVD" title=`cat $RACINE/$projet/tmp/log | grep scan | awk '{print $5}'` angle=`cat $RACINE/$projet/tmp/log | grep scan | awk '{print $6}'` index=`cat $RACINE/$projet/tmp/log | grep scan | awk '{print $7}'` pisteaudio=`cat $RACINE/$projet/tmp/log | grep scan | awk '{print $8}'` aspect=`cat $RACINE/$projet/tmp/log | grep scan | awk '{print $9}'` resXdvd=`cat $RACINE/$projet/tmp/log | grep scan | awk '{print $10}'` resYdvd=`cat $RACINE/$projet/tmp/log | grep scan | awk '{print $11}'` fps=`cat $RACINE/$projet/tmp/log | grep scan | awk '{print $12}'` credits=`cat $RACINE/$projet/tmp/log | grep scan | awk '{print $13}'` echo -e "${HEADCOLOR}Titre : "$title echo -e "${HEADCOLOR}Angle : "$angle echo -e "${HEADCOLOR}Piste audio : "$index echo -e "${HEADCOLOR}Langue : "$pisteaudio echo -e "${HEADCOLOR}AR : "$aspect echo -e "${HEADCOLOR}ResXdvd : "$resXdvd echo -e "${HEADCOLOR}ResYdvd : "$resYdvd echo -e "${HEADCOLOR}Framerate : "$fps echo -e "${HEADCOLOR}1ere frame du générique : "$credits echo -e "${SUBCOLOR}-->2)rip du DVD" echo -e "${SUBCOLOR}-->3)encodage audio" qualite=`cat $RACINE/$projet/tmp/log | grep audio | awk '{print $4}'` echo -e "${HEADCOLOR}Qualité audio : "$qualite echo -e "${SUBCOLOR}-->4)cropping auto" crop=`cat $RACINE/$projet/tmp/log | grep cropping | awk '{print $3}'` haut=`cat $RACINE/$projet/tmp/log | grep cropping | awk '{print $4}'` larg=`cat $RACINE/$projet/tmp/log | grep cropping | awk '{print $5}'` echo -e "${HEADCOLOR}Cropping : "$crop echo -e "${SUBCOLOR}-->5)paramètres d'encodage video" tailleCD=`cat $RACINE/$projet/tmp/log | grep bitrate | awk '{print $6}'` bitvideo=`cat $RACINE/$projet/tmp/log | grep bitrate | awk '{print $8}'` scale=`cat $RACINE/$projet/tmp/log | grep bitrate | awk '{print $7}'` echo -e "${HEADCOLOR}Support : "$tailleCD" Mo" echo -e "${HEADCOLOR}Bitrate video : "$bitvideo" kbps" echo -e "${HEADCOLOR}Résolution : "$scale ;; 6) echo -e "${SUBCOLOR}-->1)scan du DVD" title=`cat $RACINE/$projet/tmp/log | grep scan | awk '{print $5}'` angle=`cat $RACINE/$projet/tmp/log | grep scan | awk '{print $6}'` index=`cat $RACINE/$projet/tmp/log | grep scan | awk '{print $7}'` pisteaudio=`cat $RACINE/$projet/tmp/log | grep scan | awk '{print $8}'` aspect=`cat $RACINE/$projet/tmp/log | grep scan | awk '{print $9}'` resXdvd=`cat $RACINE/$projet/tmp/log | grep scan | awk '{print $10}'` resYdvd=`cat $RACINE/$projet/tmp/log | grep scan | awk '{print $11}'` fps=`cat $RACINE/$projet/tmp/log | grep scan | awk '{print $12}'` credits=`cat $RACINE/$projet/tmp/log | grep scan | awk '{print $13}'` echo -e "${HEADCOLOR}Titre : "$title echo -e "${HEADCOLOR}Angle : "$angle echo -e "${HEADCOLOR}Piste audio : "$index echo -e "${HEADCOLOR}Langue : "$pisteaudio echo -e "${HEADCOLOR}AR : "$aspect echo -e "${HEADCOLOR}ResXdvd : "$resXdvd echo -e "${HEADCOLOR}ResYdvd : "$resYdvd echo -e "${HEADCOLOR}Framerate : "$fps echo -e "${HEADCOLOR}1ere frame du générique : "$credits echo -e "${SUBCOLOR}-->2)rip du DVD" echo -e "${SUBCOLOR}-->3)encodage audio" qualite=`cat $RACINE/$projet/tmp/log | grep audio | awk '{print $4}'` echo -e "${HEADCOLOR}Qualité audio : "$qualite echo -e "${SUBCOLOR}-->4)cropping auto" crop=`cat $RACINE/$projet/tmp/log | grep cropping | awk '{print $3}'` haut=`cat $RACINE/$projet/tmp/log | grep cropping | awk '{print $4}'` larg=`cat $RACINE/$projet/tmp/log | grep cropping | awk '{print $5}'` echo -e "${HEADCOLOR}Cropping : "$crop echo -e "${SUBCOLOR}-->5)paramètres d'encodage video" tailleCD=`cat $RACINE/$projet/tmp/log | grep bitrate | awk '{print $6}'` bitvideo=`cat $RACINE/$projet/tmp/log | grep bitrate | awk '{print $8}'` scale=`cat $RACINE/$projet/tmp/log | grep bitrate | awk '{print $7}'` echo -e "${HEADCOLOR}Support : "$tailleCD" Mo" echo -e "${HEADCOLOR}Bitrate video : "$bitvideo" kbps" echo -e "${HEADCOLOR}Résolution : "$scale echo -e "${SUBCOLOR}-->6)encodage video";; 7) echo -e "${SUBCOLOR}-->1)scan du DVD" title=`cat $RACINE/$projet/tmp/log | grep scan | awk '{print $5}'` angle=`cat $RACINE/$projet/tmp/log | grep scan | awk '{print $6}'` index=`cat $RACINE/$projet/tmp/log | grep scan | awk '{print $7}'` pisteaudio=`cat $RACINE/$projet/tmp/log | grep scan | awk '{print $8}'` aspect=`cat $RACINE/$projet/tmp/log | grep scan | awk '{print $9}'` resXdvd=`cat $RACINE/$projet/tmp/log | grep scan | awk '{print $10}'` resYdvd=`cat $RACINE/$projet/tmp/log | grep scan | awk '{print $11}'` fps=`cat $RACINE/$projet/tmp/log | grep scan | awk '{print $12}'` credits=`cat $RACINE/$projet/tmp/log | grep scan | awk '{print $13}'` echo -e "${HEADCOLOR}Titre : "$title echo -e "${HEADCOLOR}Angle : "$angle echo -e "${HEADCOLOR}Piste audio : "$index echo -e "${HEADCOLOR}Langue : "$pisteaudio echo -e "${HEADCOLOR}AR : "$aspect echo -e "${HEADCOLOR}ResXdvd : "$resXdvd echo -e "${HEADCOLOR}ResYdvd : "$resYdvd echo -e "${HEADCOLOR}Framerate : "$fps echo -e "${HEADCOLOR}1ere frame du générique : "$credits echo -e "${SUBCOLOR}-->2)rip du DVD" echo -e "${SUBCOLOR}-->3)encodage audio" qualite=`cat $RACINE/$projet/tmp/log | grep audio | awk '{print $4}'` echo -e "${HEADCOLOR}Qualité audio : "$qualite echo -e "${SUBCOLOR}-->4)cropping auto" crop=`cat $RACINE/$projet/tmp/log | grep cropping | awk '{print $3}'` haut=`cat $RACINE/$projet/tmp/log | grep cropping | awk '{print $4}'` larg=`cat $RACINE/$projet/tmp/log | grep cropping | awk '{print $5}'` echo -e "${HEADCOLOR}Cropping : "$crop echo -e "${SUBCOLOR}-->5)paramètres d'encodage video" tailleCD=`cat $RACINE/$projet/tmp/log | grep bitrate | awk '{print $6}'` bitvideo=`cat $RACINE/$projet/tmp/log | grep bitrate | awk '{print $8}'` scale=`cat $RACINE/$projet/tmp/log | grep bitrate | awk '{print $7}'` echo -e "${HEADCOLOR}Support : "$tailleCD" Mo" echo -e "${HEADCOLOR}Bitrate video : "$bitvideo" kbps" echo -e "${HEADCOLOR}Résolution : "$scale echo -e "${SUBCOLOR}-->6)encodage video" echo -e "${SUBCOLOR}-->7)mixage A/V" decalinit=`cat $RACINE/$projet/tmp/log | grep mixage | awk '{print $4}'` echo -e "${HEADCOLOR}Décalage : "$decalinit "ms" ;; esac verif=o else echo -n -e "${SUBCOLOR}-------> Ce projet existe déjà, on écrase ou pas (o/n) [défaut : n] ? " echo -n -e "${INPUTCOLOR}> " read verif case $verif in o | n | O | N ) ;; *) verif=n echo "Choix par défaut : On n'écrase pas..." ;; esac echo -n -e "${MAINCOLOR}" [ "$verif" = "o" ] && rm -rf $RACINE/$projet fi else if [ "$resume" = "OK" ]; then echo "Mode resume enclenché sur un projet inexistant, impossible de poursuivre..." exit else verif=o fi fi done if [ "$resume" = "OK" ]; then limite=`expr $onestou \+ 1` [ $limite -eq 8 ] && limite=7 etapedeb=10 while [ $etapedeb -gt $limite ] do echo echo -n -e "${SUBCOLOR}-------> On recommence à partir de quelle étape [défaut : $limite] ? " echo -n -e "${INPUTCOLOR}> " read etapedeb if [ "$etapedeb" = "" ] ; then echo "Choix par défaut : On recommence à partir de l'étape $limite..." etapedeb=$limite fi isnum=`echo $etapedeb | grep "^[0-9][0-9]*$"` if [ "$isnum" = "" ] ; then echo "Erreur : le code correspondant à l'étape est un entier..." etapedeb=10 else [ $etapedeb -gt $limite ] && echo "Impossible !" fi done case $etapedeb in 1 ) touch $RACINE/$projet/tmp/log.resume ;; 2 ) awk 'NR == 1 , NR == 1 {print $0}' $RACINE/$projet/tmp/log > $RACINE/$projet/tmp/log.resume ;; 3 ) awk 'NR == 1 , NR == 2 {print $0}' $RACINE/$projet/tmp/log > $RACINE/$projet/tmp/log.resume ;; 4 ) awk 'NR == 1 , NR == 3 {print $0}' $RACINE/$projet/tmp/log > $RACINE/$projet/tmp/log.resume ;; 5 ) awk 'NR == 1 , NR == 4 {print $0}' $RACINE/$projet/tmp/log > $RACINE/$projet/tmp/log.resume ;; 6 ) awk 'NR == 1 , NR == 5 {print $0}' $RACINE/$projet/tmp/log > $RACINE/$projet/tmp/log.resume ;; 7 ) awk 'NR == 1 , NR == 6 {print $0}' $RACINE/$projet/tmp/log > $RACINE/$projet/tmp/log.resume ;; esac case $etapedeb in 1 ) touch $RACINE/$projet/tmp/temps.resume ;; 2 ) awk 'NR == 1 , NR == 1 {print $0}' $RACINE/$projet/tmp/temps.log > $RACINE/$projet/tmp/temps.resume ;; 3 ) awk 'NR == 1 , NR == 2 {print $0}' $RACINE/$projet/tmp/temps.log > $RACINE/$projet/tmp/temps.resume ;; 4 ) awk 'NR == 1 , NR == 3 {print $0}' $RACINE/$projet/tmp/temps.log > $RACINE/$projet/tmp/temps.resume ;; 5 ) awk 'NR == 1 , NR == 4 {print $0}' $RACINE/$projet/tmp/temps.log > $RACINE/$projet/tmp/temps.resume ;; 6 ) awk 'NR == 1 , NR == 5 {print $0}' $RACINE/$projet/tmp/temps.log > $RACINE/$projet/tmp/temps.resume ;; 7 ) awk 'NR == 1 , NR == 6 {print $0}' $RACINE/$projet/tmp/temps.log > $RACINE/$projet/tmp/temps.resume ;; esac rm -f $RACINE/$projet/tmp/log rm -f $RACINE/$projet/tmp/temps.log mv $RACINE/$projet/tmp/log.resume $RACINE/$projet/tmp/log mv $RACINE/$projet/tmp/temps.resume $RACINE/$projet/tmp/temps.log else etapedeb=0 mkdir $RACINE/$projet mkdir $RACINE/$projet/vob mkdir $RACINE/$projet/audio mkdir $RACINE/$projet/video mkdir $RACINE/$projet/tmp touch $RACINE/$projet/tmp/log touch $RACINE/$projet/tmp/temps.log fi cd $RACINE/$projet # ANALYSE DU DVD----------------------------------- echo if [ $etapedeb -le 1 ]; then echo -e "${TABLECOLOR}+++++++++++++++SCAN DU DVD++++++++++++++++++++++++++++++++++++" echo -e "${MAINCOLOR}" dvdok="notok" while [ "$dvdok" = "notok" ]; do echo "Insérez le DVD dans le périphérique $DEVICE et appuyez sur ENTREE" read echo title_info "$DEVICE" > $RACINE/$projet/tmp/infos.dvd testdvd=`ls -l $RACINE/$projet/tmp/infos.dvd | awk '{print $5}'` if [ $testdvd -eq 0 ]; then echo echo -e "${SUBCOLOR}Aucun DVD détecté dans $DEVICE !!!" echo -e "${MAINCOLOR}" rm -f $RACINE/$projet/tmp/infos.dvd else dvdok="ok" fi done echo -e "${HEADCOLOR}" cat $RACINE/$projet/tmp/infos.dvd | grep Title echo -e "${MAINCOLOR}" echo echo -n -e "${SUBCOLOR}-------> Quel titre à ripper [défaut : 1] ? " echo -n -e "${INPUTCOLOR}> " read title case $title in 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 ) ;; *) title=1 echo "Choix par défaut : 1er titre" ;; esac echo -n -e "${MAINCOLOR}" mplayer -dvd $title -dvd-device $DEVICE -vo null -ao null -frames 0 -v >> $RACINE/$projet/tmp/infos.dvd 2>&1 angle=`cat $RACINE/$projet/tmp/infos.dvd | grep "angles in this DVD title" | awk '{print $3}'` if [ $angle -gt 1 ]; then echo -n -e "${SUBCOLOR}-------> Quel angle à ripper [défaut : 1] ? " echo -n -e "${INPUTCOLOR}> " read angle case $angle in 1 | 2 | 3 | 4 | 5) ;; *) angle=1 echo "Choix par défaut : 1er angle" ;; esac echo -n -e "${MAINCOLOR}" echo else echo "On rippe le seul angle disponible, le "$angle"..." fi echo -e "${HEADCOLOR}" cat $RACINE/$projet/tmp/infos.dvd |grep "audio format" | awk -F "audio stream:" '{print $2}'| awk -F "aid" '{print $1}' echo -e "${MAINCOLOR}" echo echo -n -e "${SUBCOLOR}-------> Quel piste audio à ripper [défaut : 1] ? " echo -n -e "${INPUTCOLOR}> " read index case $index in 0 | 1 | 2 | 3 | 4 | 5) ;; *) index=1 echo -n "Choix par défaut : 1ere piste" ;; esac echo -n -e "${MAINCOLOR}" pisteaudio=`cat $RACINE/$projet/tmp/infos.dvd | grep "audio format" | grep "audio stream: ${index}" | awk -F "language: " '{print $2}' | awk '{print $1}'` if [ "$pisteaudio" = "" ]; then pisteaudio="inconnu" fi echo -e "${HEADCOLOR}" echo -n -e "Langue de la piste choisie : "$pisteaudio echo -e "${MAINCOLOR}" aspect=`cat $RACINE/$projet/tmp/infos.dvd | grep "VIDEO" | awk '{print $5}' | awk -F ")" '{print $1}'` resXdvd=`cat $RACINE/$projet/tmp/infos.dvd | grep "VIDEO" | awk '{print $3}' | awk -F "x" '{print $1}'` resYdvd=`cat $RACINE/$projet/tmp/infos.dvd | grep "VIDEO" | awk '{print $3}' | awk -F "x" '{print $2}'` cat $RACINE/$projet/tmp/infos.dvd | grep "VIDEO" | awk '{print $6}' > $RACINE/$projet/tmp/framerate fps=`sed -e "s/,/./" $RACINE/$projet/tmp/framerate` rm -f $RACINE/$projet/tmp/framerate echo echo -e "${MAINCOLOR} >>>> Notez l'instant où commence le générique de fin puis quittez en pressant ECHAP <<<<" echo sleep 3 if [ "$modetest" = "OK" ] ; then nbchap=$full else nbchap=`cat $RACINE/$projet/tmp/infos.dvd | grep "chapters in this DVD title" | awk '{print $3}'` fi mplayer -osdlevel 2 -dvd $title -dvd-device $DEVICE -chapter $nbchap -vo $VO -ao $AO > /dev/null 2>&1 echo -n -e "${SUBCOLOR}-------> Début du générique de fin [hh:mm:ss] ? " echo -n -e "${INPUTCOLOR}> " read generique echo $generique > $RACINE/$projet/tmp/credits genH=`cat $RACINE/$projet/tmp/credits | awk -F ":" '{print $1}'` genM=`cat $RACINE/$projet/tmp/credits | awk -F ":" '{print $2}'` genS=`cat $RACINE/$projet/tmp/credits | awk -F ":" '{print $3}'` rm -f $RACINE/$projet/tmp/credits credits=`bc < " $title" "$angle" "$index" "$pisteaudio" "$aspect" "$resXdvd" "$resYdvd" "$fps" "$credits>> $RACINE/$projet/tmp/log date >> $RACINE/$projet/tmp/temps.log fi # Ripping if [ $etapedeb -le 2 ]; then echo -e "${TABLECOLOR}+++++++++++++++RIPPING DU DVD+++++++++++++++++++++++++++++++++++" echo -e "${MAINCOLOR}" typeaudio=`cat $RACINE/$projet/tmp/infos.dvd | grep "audio format" | grep "audio stream: ${index}" | awk '{print $7}'` case $typeaudio in mpeg1 ) typeaudio="mp3" ;; * ) typeaudio="ac3" ;; esac tccat -t dvd -T $title,$full,$angle -i $DEVICE | dr_splitpipe -f $RACINE/$projet/tmp/$projet-rip.log 1024 $RACINE/$projet/vob/$projet vob 2>&1 | tcextract -a $index -x $typeaudio -t vob | tcdecode -x $typeaudio | tcscan -x pcm -b 80 > $RACINE/$projet/tmp/infos.son echo echo "ripping dvd" >> $RACINE/$projet/tmp/log date >> $RACINE/$projet/tmp/temps.log fi # ENCODAGE AUDIO---------------------------- if [ $etapedeb -le 3 ]; then echo -e "${TABLECOLOR}+++++++++++++++ENCODAGE AUDIO+++++++++++++++++++++++++++++++++++" echo -e "${MAINCOLOR}" rescale=`cat $RACINE/$projet/tmp/infos.son | grep "volume" | awk -F "=" '{print $3}'` test=`bc < $gainmax EOF ` if [ "$test" = "1" ]; then # plafonne le gain à la valeur maxi lu dans le ficher config pour éviter des saturations (merci à "zeb_") rescale=$gainmax fi echo -e "${HEADCOLOR}" echo "Normalisation : "$rescale #isnum="" # while [ "$isnum" = "" ] # do echo -e "${MAINCOLOR}" echo -n -e "${SUBCOLOR}-------> Qualité d'encodage audio ogg/vorbis [défaut : 1,0] ? " echo -n -e "${INPUTCOLOR}> " read qualite if [ "$qualite" = "" ] ; then qualite=1,0 echo "Choix par défaut : 1,0" fi # isnum=`echo $bitaudio | grep "^[0-9][0-9]*$"` # if [ "$isnum" = "" ] ; then # echo "Erreur : le bitrate doit être un entier..." # fi #done echo -n -e "${MAINCOLOR}" mkfifo $RACINE/$projet/tmp/pcmpipe.raw nice -19 oggenc -r -C2 -R48000 -B16 -q$qualite -o $RACINE/$projet/audio/son.ogg $RACINE/$projet/tmp/pcmpipe.raw & nice -19 transcode -q 0 -i $RACINE/$projet/vob -a $index -g 0x0 -u 50 -s $rescale,1,1,1 --a52_drc_off -x null,vob -y raw -N 0x1 -m $RACINE/$projet/tmp/pcmpipe.raw -o /dev/null rm -f $RACINE/$projet/tmp/pcmpipe.raw sleep 2 echo "encodage audio --> "$qualite >> $RACINE/$projet/tmp/log date >> $RACINE/$projet/tmp/temps.log fi # cropping if [ $etapedeb -le 4 ]; then echo -e "${TABLECOLOR}+++++++++++++++DETECTION DU CROPPING++++++++++++++++++++++++++++" echo -e "${MAINCOLOR}" cd $RACINE/$projet/tmp taille1=`ls -l $RACINE/$projet/vob/$projet-001.vob | awk '{print $5}'` deb=`bc < $RACINE/$projet/tmp/infos.crop 2>&1 larg=`cat $RACINE/$projet/tmp/infos.crop | grep "crop area" | tail -n 1 - | awk -F "=" '{print $2}' | awk -F ")" '{print $1}' | awk -F ":" '{print $1}'` haut=`cat $RACINE/$projet/tmp/infos.crop | grep "crop area" | tail -n 1 - | awk -F "=" '{print $2}' | awk -F ")" '{print $1}' | awk -F ":" '{print $2}'` x0=`cat $RACINE/$projet/tmp/infos.crop | grep "crop area" | tail -n 1 - | awk -F "=" '{print $2}' | awk -F ")" '{print $1}' | awk -F ":" '{print $3}'` y0=`cat $RACINE/$projet/tmp/infos.crop | grep "crop area" | tail -n 1 - | awk -F "=" '{print $2}' | awk -F ")" '{print $1}' | awk -F ":" '{print $4}'` crop=`echo ${larg}:${haut}:${x0}:${y0}` top=$y0 bot=`expr $resYdvd \- $haut \- $top` gauche=$x0 droite=`expr $resXdvd \- $larg \- $gauche` echo -e "${HEADCOLOR}" echo -e "Paramètres de crop détectés: " $crop echo -e "Haut : "${top}" pixels" echo -e "Bas : "${bot}" pixels" echo -e "Droite : "${droite}" pixels" echo -e "Gauche : "${gauche}" pixels" echo echo -e "${MAINCOLOR}" echo ">>>> Vérifiez le cropping, à l'aide du rectangle blanc <<<<" echo sleep 2 mplayer -ao null -vo $VO -sb $deb -frames 125 -vop rectangle=$crop $RACINE/$projet/vob/$projet-001.vob > /dev/null 2>&1 echo -n -e "${SUBCOLOR}-------> C'est bon (o/n) [défaut : n] ? " echo -n -e "${INPUTCOLOR}> " read verif case $verif in o | n | O | N) ;; *) verif=n echo "Choix par défaut : c'est pas bon..." ;; esac echo -n -e "${MAINCOLOR}" deb=`expr $deb \+ $pas` done echo echo "cropping --> "$crop" "$haut" "$larg >> $RACINE/$projet/tmp/log date >> $RACINE/$projet/tmp/temps.log fi # resolution, bitrate... if [ $etapedeb -le 5 ]; then cd $RACINE/$projet echo -e "${TABLECOLOR}++++++DETERMINATION DES PARAMETRES D'ENCODAGE VIDEO++++++++++++++++++++" echo -e "${HEADCOLOR}" ARi=`bc < 1) 1CD 74 min" echo -e "${SUBCOLOR}-------> 2) 1CD 80 min" echo -e "${SUBCOLOR}-------> 3) 2CD 74 min" echo -e "${SUBCOLOR}-------> 4) 2CD 80 min" echo -e "${SUBCOLOR}-------> 5) Autres" echo -e "${INPUTCOLOR} Votre Choix [défaut : 2] ? > " read cd autres=notok case $cd in 1) tailleCD=650 ;; 2) tailleCD=702 ;; 3) tailleCD=1300 mkdir $RACINE/$projet/video/cd1 mkdir $RACINE/$projet/video/cd2 ;; 4) tailleCD=1404 mkdir $RACINE/$projet/video/cd1 mkdir $RACINE/$projet/video/cd2 ;; 5) isnum="" while [ "$isnum" = "" ] do echo -n -e "${SUBCOLOR}-------> Taille de votre support en Mo ? " echo -n -e "${INPUTCOLOR}> " autres=ok read tailleCD isnum=`echo $tailleCD | grep "^[0-9][0-9]*$"` if [ "$isnum" = "" ] ; then echo "Erreur : la taille du support doit être un entier..." fi done ;; *) echo "Choix par défaut : 1CD 80 min" tailleCD=702 ;; esac echo -n -e "${MAINCOLOR}" #interleave (+ marge) de 1 % tailledispo=`bc < Critère de qualité visé [défaut : 0.22] ? " echo -n -e "${INPUTCOLOR}> " read CQ if [ "$CQ" = "" ] ; then CQ=0.22 echo "Choix par défaut : 0.22" fi echo -n -e "${MAINCOLOR}" ResY=`bc <>>> Voici le format de votre vidéo telle qu'elle sera encodée <<<<" echo sleep 2 mplayer -ao null -vo png -sb $deb -frames 5 -vop scale=$scale,crop=$crop $RACINE/$projet/vob/$projet-001.vob > /dev/null 2>&1 # imview -R -p center -t normal -d 60000 -s once $RACINE/$projet/tmp/*1.png & $visu $RACINE/$projet/tmp/*1.png > /dev/null 2>&1 & echo -e -n "${SUBCOLOR}-------> Satisfait (o/n) [défaut : n] ? " echo -e -n "${INPUTCOLOR}> " read satisf case $satisf in o | n | O | N) ;; *) satisf=n echo "Choix par défaut : C'est pas bon..." ;; esac echo -n -e "${MAINCOLOR}" done echo "taille visée, résolution, bitrate --> " $tailleCD" "$scale" "$bitvideo >> $RACINE/$projet/tmp/log date >> $RACINE/$projet/tmp/temps.log fi #encodage video if [ $etapedeb -le 6 ]; then echo echo -e "${TABLECOLOR}+++++++++++++++ENCODAGE VIDEO+++++++++++++++++++++++++++++++++++" echo -e "${MAINCOLOR}" cd $RACINE/$projet/tmp [ -f "$RACINE/$projet/tmp/lavc_stats.txt" ] && rm -f $RACINE/$projet/tmp/lavc_stats.txt [ -f "$RACINE/$projet/tmp/divx2pass.log" ] && rm -f $RACINE/$projet/tmp/divx2pass.log CIBLE=$RACINE/$projet/video/${projet}sans-son.avi SOURCE=$RACINE/$projet/vob fin=`bc <> $RACINE/$projet/tmp/log date >> $RACINE/$projet/tmp/temps.log if [ "$extinction" = "OK" ]; then echo echo "Le PC va s'éteindre dans 10 secondes............." sleep 10 touch ~/.tuxripextinction echo $RACINE $projet >> ~/.tuxripextinction sudo /sbin/shutdown -h now fi fi # mixage A/V if [ $etapedeb -le 7 ]; then echo -e "${TABLECOLOR}+++++++++++++++MIXAGE A/V+++++++++++++++++++++++++++++++++++++++" echo -e "${MAINCOLOR}" pas=300 decal=$decalinit epsi=0 test="notok" until [ "$test" = "ok" ] do echo -e "${HEADCOLOR}Mixage en cours avec un décalage de "$decal "ms" ogmmerge -q -o $RACINE/$projet/video/${projet}.ogm $RACINE/$projet/video/${projet}sans-son.avi -s $decal $RACINE/$projet/audio/son.ogg echo -e "${MAINCOLOR} >>>> Vérifiez la synchronisation puis quittez en pressant ECHAP <<<<" sleep 2 mplayer -vo $VO -ao $AO $RACINE/$projet/video/${projet}.ogm > /dev/null 2>&1 rep="notok" until [ "$rep" = "ok" ] do echo -e -n "${SUBCOLOR}-------> Son en retard (-), en avance (+), ou synchrone (0) ? " echo -e -n "${INPUTCOLOR}> " read test echo epsiold=$epsi case $test in -) epsi=-1 rep="ok" ;; +) epsi=1 rep="ok" ;; 0) test="ok" rep="ok";; *) echo "Erreur de frappe..." rep="notok" ;; esac done depasse=`bc < " $decal >> $RACINE/$projet/tmp/log date >> $RACINE/$projet/tmp/temps.log fi case $tailleCD in 1300 ) echo -e "${TABLECOLOR}+++++++++++++++DECOUPAGE+++++++++++++++++++++++++++++++++++++" echo -e "${MAINCOLOR}" ogmsplit $RACINE/$projet/video/${projet}.ogm -s 650 mv $RACINE/$projet/video/${projet}-*1.ogm $RACINE/$projet/video/cd1 mv $RACINE/$projet/video/${projet}-*2.ogm $RACINE/$projet/video/cd2;; 1404 ) echo -e "${TABLECOLOR}+++++++++++++++DECOUPAGE+++++++++++++++++++++++++++++++++++++" echo -e "${MAINCOLOR}" ogmsplit $RACINE/$projet/video/${projet}.ogm -s 702 mv $RACINE/$projet/video/${projet}-*1.ogm $RACINE/$projet/video/cd1 mv $RACINE/$projet/video/${projet}-*2.ogm $RACINE/$projet/video/cd2 ;; esac echo -e "${TABLECOLOR}+++++++++++++++INFORMATIONS+++++++++++++++++++++++++++++++++++++" echo -e "${MAINCOLOR}" taillefilm=`bc </dev/null | cdrecord -v -dao speed=$vitesse dev=$graveur -tsize=${tailleSECT}s - fi echo -e "${MAINCOLOR}"