#!/bin/bash version=0.76 # 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_ et à philou_a7 ;-) # merci à jj Varv**** pour l'info lisant automatiquement le mon du DVD :) # ----------------------------------------TODO------------------------------------------------------------------------------------------ #-->Version 0.8 : #- presets video #- mode --purge (pour supprimer tous les encodages du répertoire de travail), #- mode --grave dans cas de plusieurs CD, #- affiche les durées de traitement à la fin du processus global (rip, audio, video), #- vérifie la place dispo avant de commencer. #- chapitrage, #-->Version 0.9 : #- mode --vob pour encoder des fichiers vob cad sans avoir le DVD sous la main, #- support des sous titres (fichiers ifo...), #- mode --multiaudio pour faire des films avec plusieurs langues, #- mode --multigen pour encoder plusieurs génériques (par exemple début et fin). #-->Version 1.0 : #- utilisation sans Xfree, #- joblist #- mode --vob pour encoder des fichiers vob cad sans avoir le DVD sous la main, # ----------------------------------------/TODO------------------------------------------------------------------------------------------ # 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 v${version}${TABLECOLOR} |" echo -e "${TABLECOLOR}+------------------+" echo -e "$MAINCOLOR" # function langue() { case $1 in fr ) p1=" >>>> Voici le format de votre vidéo telle qu'elle sera encodée <<<<" p2="-------> Satisfait (o/n) [défaut : n] ? " p3="O" p4="o" p5="Choix par défaut : c'est pas bon..." p6="Mauvaise réponse (o/n) !!!" p7="++++++++MIXAGE A/V+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" p8="Mixage en cours avec un décalage de " p9=" >>>> Vérifiez la synchronisation puis quittez en pressant ECHAP <<<<" p10="-------> Son en retard (-), en avance (+), ou synchrone (0) ? " p11="Erreur de frappe..." p12="++++++++DECOUPAGE++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" p13="++++++++INFORMATIONS+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" p14="Taille du film encodé : " p15="Taille visée : " p16="-->Le projet " p16bis=" s'est terminée précédemment grâce à l'option --extinction." p17="-->Toutes les options de tuxrip sont ignorées." p18="-->On effectue maintenant la dernière étape : mixage et synchronisation A/V." p19="Fichier de log vidéo :" p20="-->Mode test : Seul le chapitre " p20bis=" sera rippé..." p21="-->Mode resume : Un projet existant va être poursuivi..." p22="-->Mode xvid : Encodage video en Xvid au lieu de lavc..." p23="-->Mode config : Le fichier de préférence va être généré..." p24="-------> Répertoire de travail [défaut : /space] ? " p25="Choix par défaut" p26="Ce répertoire n'existe pas..." p27="Rep de travail : " p28="-------> Device du DVD [défaut : /dev/dvd] ? " p29="Ce device n'existe pas..." p30="device du dvd : " p31="-------> Décalage initial A/V pour la synchro en ms [défaut : 0] ? " p32="Erreur : le décalage doit être un entier..." p33="-------> Options d'encodage video libavcodec [défaut " p34="options libavcodec : " p35="-------> Options d'encodage video xvid [défaut " p36="options xvid : " p37="-------> Gain maximum utilisé pour la normalisation audio [défaut : 3] ? " p38="Erreur : le gain maximum doit être un entier strictement positif..." p39="gain audio max : " p40="-------> Driver video (x11, xv, sdl) [défaut : xv] ? " p41="Erreur : seuls (x11, xv, sdl) sont dispos" p42="drivers video : " p43="-------> Driver audio (oss, alsa9, sdl) [défaut : oss] ? " p44="Erreur : seuls (oss, alsa9, sdl) sont dispos" p45="drivers audio : " p46="-------> Chaine SCSI du graveur (à déterminer avec cdrecord --scanbus) [défaut : 0,3,0] ? " p47="Erreur : saisissez une chaine du type x,y,z ..." p48="graveur : " p49="-------> Vitesse de gravure [défaut : 12] ? " p50="Erreur : la vitesse de gravure doit être un entier strictement positif..." p51="vitesse gravure : " p52="-------> Visualisateur d'images (gqview, eog, kview, imview, display) [défaut : gqview] ? " p53="visualisateur : " p54="-------> Quantization des génériques (min-max) [défaut : 20-20] ? " p55="Un quantizer est un entier supérieur ou égal à 2 !" p56="Un quantizer est un entier inférieur ou égal à 31 !" p57="Attention : quantizer min > quantizer max !!!" p58="Un quantizer est un entier compris entre 2 et 31, respecter le format min-max !!!" p59="quantizer génériques : " p60="-->Mode verif-prefs : les parametres sont affichés..." p61="Répertoire de travail : " p62="Device du DVD : " p63="Décalage A/V initial : " p64="Options libavcodec : " p65="Options xvid : " p66="Gain audio maxi : " p67="Driver vidéo : " p68="Driver audio : " p69="Graveur : " p70="Vitesse de gravure : " p71="Visualisateur : " p72="Quantizer génériques : " p73="Fichier de préférences non trouvé : relancer tuxrip en mode --config" p74="Mode help : tuxrip peut être lancé avec les options suivantes :" p75=": pour générer le fichier de préférences ~/.tuxriprc." p76=": pour forcer le désentrelacement d'une source PAL entrelacée." p77=": pour éteindre le PC après l'encodage vidéo." p78=": pour afficher ce contenu ;-)." p79=": pour reprendre un encodage déjà effectué partiellement ou totalement." p80=": pour ne ripper que le 'n ème' chapitre d'un DVD (permet de tester le script rapidement)." p81=": pour effectuer un test de compressibilité avant l'encodage (permet d'affiner le choix de la résolution)." p82=": pour vérifier le contenu du fichier de préférences." p83=": pour afficher le numéro de version de tuxrip." p84=": pour encoder en xvid à la place de libavcodec." p84bis=": pour graver la video à la fin du processus global." p84ter=": pour définir le fichier de langue ~/.tuxriplng." p84quad=": pour simplifier l'affichage de mencoder." p85="--help" p86="--config" p87="--desentrelace" p88="--extinction" p89="--resume" p90="--test" p91="--test-comp" p92="--verif-prefs" p93="--version" p94="--xvid" p95="-->Mode desentrelace : la video sera desentrelacée pendant l'encodage..." p96="-->Mode extinction : le PC sera éteint après l'encodage video et le mixage A/V sera effectué au prochain démarrage de tuxrip..." p97="--grave" p98="-->Mode grave : la vidéo sera gravée à la fin du processus d'encodage..." p99="-->Mode test-comp : Un préencodage rapide sera effectué afin de tester la compressibilité du film..." p100="Option inconnue : " p100bis=", donc ignorée..." p101="Fichier de préférences non trouvé : relancer tuxrip en mode " p102="Nom du projet [défaut :" p103="Choix par défaut" p104="Etape(s) effectuée(s) :" p105="scan du DVD" p106="Titre : " p107="Angle : " p108="Piste audio : " p109="Langue : " p110="1ere frame du générique : " p111="rip du DVD" p112="encodage audio" p113="Qualité audio : " p114="cropping auto" p115="paramètres d'encodage video" p116="Support : " p117=" Mo" p118="Bitrate video : " p119="Résolution : " p120="encodage video" p121="mixage A/V" p1220="Décalage : " p122=" Ce projet existe déjà, on écrase ou pas (o/n) [défaut : n] ? " p123="Choix par défaut : On n'écrase pas..." p124="Mauvaise réponse (o/n) !!!" p125="Mode resume enclenché sur un projet inexistant, impossible de poursuivre..." p126=" On recommence à partir de quelle étape [défaut :" p127="Choix par défaut : On recommence à partir de l'étape" p128="Erreur : le code correspondant à l'étape est un entier compris entre 1 et" p129="Impossible !" p130="++++++++SCAN DU DVD++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" p131="Insérez le DVD dans" p132="et appuyez sur ENTREE" p133="Le DVD est en cours d'analyse..." p134="Titre" p135="Données :" p136="Durée : " p137="secondes" p138="Quel titre à ripper [défaut :" p139="Choix par défaut : titre" p140="Attention, il n'y a que" p141="titre(s) disponible(s) !!!" p142="Attention, le titre est un entier supérieur ou égal à 1 !!!" p143="Il y a" p144=" angles disponibles dans ce titre... " p145=" Quel angle à ripper [défaut : 1] ? " p146="Choix par défaut : angle 1..." p147="Attention, il n'y a que" p148="angle(s) disponible(s) !!!" p149="Attention, l'angle est un entier supérieur ou égal à 1 !!!" p150="On rippe le seul angle disponible, le" p151=" Quel piste audio à ripper [défaut : 0] ? " p152="Choix par défaut : piste 0..." p153="Attention, cette piste audio n'existe pas !!!" p154="Attention, l'index de la piste audio est un entier supérieur ou égal à 0 !!!" p155="On rippe la seule piste audio disponible, la" p156="inconnu" p157="Langue de la piste choisie : " p158="Notez l'instant où commence le générique de fin puis quittez en pressant ECHAP" p159="Le chapitre" p160="(choisi par l'option --test) n'existe pas, on rippe le dernier " p161="à la place..." p162=" Début du générique de fin (hh:mm:ss) [défaut :" p163="Choix par défaut : " p164="pas d'encodage spécifique du générique..." p165="Format hh:mm:ss non respecté !" p166="++++++++RIPPING DU DVD+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" p167="Le titre n°" p168="chapitre n°" p169="est en cours de copie dans" p170="++++++++ENCODAGE AUDIO+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" p171="Normalisation : " p172=" Qualité d'encodage audio ogg/vorbis [défaut : 1,0] ? " p173="Choix par défaut : 1,0" p174="Erreur : la qualité doit être un réel positif..." p175="++++++++DETECTION DU CROPPING++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" p176="Paramètres de crop détectés: " p177="Haut : " p178="Bas : " p179="Droite : " p180="Gauche : " p181=" pixels" p182="Vérifiez le cropping, à l'aide du rectangle blanc" p183=" C'est bon (o/n) [défaut : n] ? " p184="Choix par défaut : c'est pas bon..." p185="++++++++DETERMINATION DES PARAMETRES D'ENCODAGE VIDEO++++++++++++++++++++++++++++++++++" p186="Format" p187="Ratio détecté " p188="Durée détectée " p189="Autres" p190=" Votre Choix [défaut : 2] ? > " p191="Choix par défaut : 1CD 80 min" p192="Mauvais choix..." p193=" Taille de votre support en Mo ? " p194="Erreur : la taille du support doit être un entier positif..." p195="Taille de la bande son compressée : " p196="Taille dispo pour la video : " p197="Bitrate video : " p198=" Critère de qualité visé [défaut : 0.22] ? " p199="Choix par défaut : 0.22" p200="Attention, le critère de qualité est un réel positif..." p201="Résolution calculée :" p202="Ratio d'encodage :" p203="déformation" p204="Critêre de Qualité effectif : " p205="++++++++TEST DE COMPRESSIBILITE++++++++++++++++++++++++++++++++++++++++++++++++++++++++" p206=" Quantité de film à pré-encoder en % [défaut : 5] ? " p207="Choix par défaut : On encode 5%..." p208="Veuillez saisir un entier entre 1 et 20..." p209="Il est inutile et trop long d'encoder plus de 20% du film..." p210="Pré-encodage en cours..." p211="Progression" p212="Analyse en cours..." p213="Changer la taille du support, recommencer un test." p214=" Votre Choix [défaut :" p215=" Votre Choix ? > " p216="Choix par défaut :" p217="Mauvais choix..." p218="++++++++ENCODAGE VIDEO+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" p219="L'encodage video va démarrer dans 2 secondes, les 2 passes vont s'enchainer automatiquement..." p220="DVD NTSC détecté : option '-ofps 23.976' utilisée" p221="A l'issue de la première passe, on a" p222="Deuxième passe : " p223="Première passe : " p224="Le PC va s'éteindre dans 10 secondes............." p225="++++++++GRAVURE++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" p226="Fichier à graver trop gros..." p227="Inserez un CD de" p228="et saisissez le mot de passe root pour démarrer la gravure..." p229="Résolution choisie : " p230="Gravure" p231="CQmax" p232="--langue" p233="-->Mode langue : Le fichier de langue va être généré..." p234="Quelle langue souhaitez vous utiliser" p235="Langue non supportée" p236="ignoré" p237="Fichier de langue : " p238="--silence" p239="-->Mode silence : l'affichage de mencoder sera simplifié pour être plus lisible..." ;; en ) p1=" >>>> This is the format of the video when it will be encoded <<<<" p2="-------> Satisfied (y/n) [default : n] ? " p3="Y" p4="y" p5="Default choice : not good..." p6="Bad answer (y/n) !!!" p7="++++++++A/V MULTIPLEXING+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" p8="Mixing A/V with a synch correction of " p9=" >>>> Check audio sync then quit by pressing ESCAPE <<<<" p10="-------> Sound late (-), ahead (+), or synchronous (0) ? " p11="Key error..." p12="++++++++SPLITTING++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" p13="++++++++INFORMATION+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" p14="Size of the encoded movie : " p15="Target size : " p16="-->The project : " p16bis=" has been previously terminated with the --shutdown option." p17="-->All tuxrip options are void." p18="-->We now perform the last step : mixing and A/V synchronisation." p19="Video log file :" p20="-->Test mode : Only the chapter " p20bis=" will be ripped..." p21="-->Resume mode : An existing project is resumed..." p22="-->Xvid mode : Video encoding with xvid instead of lavc..." p23="-->Config mode : The preference file will be generated..." p24="-------> Working directory [default : /space] ? " p25="Default choice" p26="That directory does not exist..." p27="Working dir : " p28="-------> DVD device [default : /dev/dvd] ? " p29="That device does not exist..." p30="dvd device : " p31="-------> Initial A/V synch shift in ms [default : 0] ? " p32="Error : the synch shift has to be an integer..." p33="-------> libavcodec options [default " p34="libavcodec options : " p35="-------> xvid options [default " p36="video options : " p37="-------> Maximum gain for audio normalisation [default : 3] ? " p38="Error : the maximum gain has to be an integer strictly higher than zero..." p39="max audio gain : " p40="-------> Video driver (x11, xv, sdl) [default : xv] ? " p41="Error : only (x11, xv, sdl) are available" p42="video driver : " p43="-------> Audio driver (oss, alsa9, sdl) [default : oss] ? " p44="Error : only (oss, alsa9, sdl) are available" p45="audio driver : " p46="-------> Position of the CD writer in the SCSI bus (use cdrecord --scanbus) [default : 0,3,0] ? " p47="Error : enter a value like x,y,z ..." p48="CD writer : " p49="-------> Writing speed [default : 12] ? " p50="Error : the writing speed has to be an integer strictly higher than zero..." p51="writing speed : " p52="-------> Image visualizer (gqview, eog, kview, imview, display) [default : gqview] ? " p53="visualizer : " p54="-------> Credits quantizers values (min-max) [default : 20-20] ? " p55="A quantizer is an integer higher or equal to 2 !" p56="A quantizer is an integer lower or equal to 31 !" p57="Careful : quantizer min > quantizer max !!!" p58="A quantizer is an integer comprised between 2 and 31, respect the format min-max !!!" p59="credits quantizers : " p60="-->Check-prefs mode : settings are displayed..." p61="Working directory : " p62="DVD device : " p63="Initial A/V synch shift : " p64="libavcodec options : " p65="xvid options : " p66="Maxi audio gain : " p67="Video driver : " p68="Audio driver : " p69="CD-writer : " p70="Writing speed : " p71="Visualizer : " p72="Credits quantizers : " p73="Preferences file not found : run tuxrip in --config mode" p74="Help mode : tuxrip can be run with these options :" p75=": generates the preferences file ~/.tuxriprc." p76=": force the deinterlacing for an interlaced PAL source." p77=": shutdowns the PC after finishing the video encoding." p78=": displays that help ;-)." p79=": resumes encoding at any step completely or partially completed." p80=": only rips the chapter #n (allows quick testing)." p81=": performs a compressibility check before encoding (allows better resolution choice)." p82=": displays the preferences." p83=": displays the version number of tuxrip." p84=": uses xvid instead of libavcodec for video encoding." p84bis=": burns the video on CD after encoding." p84ter=": generates the language file ~/.tuxriplng." p84quad=": simplifies the display of mencoder." p85="--help" p86="--config" p87="--deinterlace" p88="--shutdown" p89="--resume" p90="--test" p91="--comp-check" p92="--verif-prefs" p93="--version" p94="--xvid" p95="-->Deinterlace mode : video will be deinterlaced when encoded..." p96="-->Shutdown mode : the PC will be shutdown after video encoding, the A/V mixing will be done when tuxrip will be relaunched..." p97="--burn" p98="-->Burn mode : the video will be written on CD after encoding..." p99="-->Comp-check : A quick preencoding will be done to check the compressibilty of the movie..." p100="Unknown option : " p100bis=", will be ignored..." p101="Preferences file not found : launch tuxrip " p102="Name of the project [default :" p103="Default choice" p104="Step(s) already done :" p105="DVD scanning" p106="Title : " p107="Angle : " p108="Audio stream : " p109="Language : " p110="1st frame of the credits : " p111="DVD ripping" p112="audio encoding" p113="Audio quality : " p114="auto cropping" p115="video encoding parameters" p116="Media size : " p117=" MB" p118="Video bitrate : " p119="Resolution : " p120="video encoding" p121="A/V mixing" p1220="Sync shift : " p122=" This project already exists, overwrite (y/n) [défaut : n] ? " p123="Default choice : we do not overwrite..." p124="Bad answer (y/n) !!!" p125="Inexisting project, resuming is impossible, cancel..." p126=" Resuming from which step [default :" p127="Default choice : Resuming from step" p128="Error : step number should be an integer comprised between 1 and" p129="Impossible !" p130="++++++++DVD SCANNING+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" p131="Insert a DVD in" p132="and press ENTER" p133="DVD is being analysed..." p134="Title" p135="Data :" p136="Duration : " p137="seconds" p138="Which title to rip [default :" p139="Default choice : title" p140="Attention, there are only" p141="title(s) available !!!" p142="Attention, the title is an integer superior or equal to 1 !!!" p143="There are" p144=" angles available in that title... " p145=" Which angle to rip [default : 1] ? " p146="Default choice : angle 1..." p147="Attention, there are only" p148="angle(s) available !!!" p149="Attention, the angle is an integer superior or equal to 1 !!!" p150="The only available angle will be ripped, number" p151=" Which audio stream to rip [default : 0] ? " p152="Default choice : stream number 0..." p153="Attention, that audio stream does not exist !!!" p154="Attention, the audio stream index is an integer superior or equal to 0 !!!" p155="The only audio stream will be ripped, number" p156="unknown" p157="Language of the selected audio stream : " p158="Note the beginning of the ending credits and quit by pressing ESC" p159="The chapter" p160="(selected with --test option) does not exist, the last one will be ripped" p161="instead..." p162=" Beginning of the ending credits (hh:mm:ss) [default :" p163="Default choice : " p164="no particular encoding of credits..." p165="Format hh:mm:ss is not respected !" p166="++++++++DVD RIPPING++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" p167="Title number " p168="chapter number" p169="is being copied in" p170="++++++++AUDIO ENCODING+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" p171="Normalisation : " p172=" Audio quality of encoding in ogg/vorbis format [default : 1,0] ? " p173="Default choice : 1,0" p174="Error : the quality has to be a positive real number..." p175="++++++++DETECTION CROPPING+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" p176="Detected cropping parameters : " p177="Top : " p178="Bottom : " p179="Right : " p180="Left : " p181=" pixels" p182="Check cropping is correctly displayed with the white rectangle" p183=" Correct (y/n) [default : n] ? " p184="Default choice : not correct..." p185="++++++++VIDEO ENCODING PARAMETERS++++++++++++++++++++++++++++++++++++++++++++++++++++++" p186="Format" p187="Detected ratio " p188="Detected duration " p189="Other choices" p190=" Your Choice [default : 2] ? > " p191="Default choice : 1CD 80 min" p192="Incorrect choice..." p193=" Media size in MB ? " p194="Error : media size should be a positive integer value..." p195="Size of the compressed audio stream : " p196="Available size for video : " p197="Video bitrate : " p198=" Targeted Quality Factor [default : 0.22] ? " p199="Default choice : 0.22" p200="Attention, the quality factor should be a positive real value..." p201="Calculated resolution :" p202="Encoding ratio :" p203="deformation" p204="Effective Quality Factor : " p205="++++++++COMPRESSIBILITY CHECK++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" p206=" Amount of movie to pre-encode in % [default : 5] ? " p207="Default choice : 5% will be encoded..." p208="Please enter an integer comprised between 1 and 20..." p209="It is not necessary and too long to encode more than 20% of the movie..." p210="Pre-encoding in progress..." p211="Progress" p212="Analyse in progress..." p213="Change media size or perform the test again." p214=" Your choice [default :" p215=" Your Choice ? > " p216="Default choice :" p217="Bad choice..." p218="++++++++VIDEO ENCODING+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" p219="The video encoding will start in 2 seconds, the 2 passes will be performed automatically..." p220="Detected NTSC format : using option '-ofps 23.976'" p221="After first pass, we have" p222="Second pass : " p223="First pass : " p224="The PC is going to shutdown in 10 seconds............." p225="++++++++CD WRITING++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" p226="The file to write is too big..." p227="Insert a" p228="CD and enter the root password to start burning..." p229="Your choice : " p230="CD burning" p231="QFmax" p232="--lang" p233="-->Lang mode : The language file will be generated..." p234="Which language do you want to use" p235="Language not supported" p236="voided" p237="Language file : " p238="--quiet" p239="-->Quiet mode : the display of mencoder will be simplify in order to be more clear..." ;; esac } #--------------------------------------------------------------LOCALISATION----------------------------------------------------------------------- if [ -f ~/.tuxriplng ]; then lng=`cat ~/.tuxriplng` case $lng in "en") rep="ok" ;; "fr") rep="ok" ;; *) echo "Language not supported" rm -f ~/.tuxriplng exit ;; esac deflng="ok" else rep="notok" while [ "$rep" = "notok" ]; do echo "Language file not detected, which language do you want to use (en/fr) ?" read lng case $lng in "en") rep="ok" ;; "fr") rep="ok" ;; *) echo "Language not supported" ;; esac done touch ~/.tuxriplng echo $lng > ~/.tuxriplng deflng="notok" fi langue $lng #-------------------------------------------------------------------------------------------------------------------------------------------------------------- function preview () { if [ $choixres -lt 20 ]; then taille1=`ls -l $RACINE/$projet/vob/$projet.vob | awk '{print $5}'` cd $RACINE/$projet/tmp deb=`bc < /dev/null 2>&1 [ -f "$RACINE/$projet/tmp/00000005.png" ] && ( $visu $RACINE/$projet/tmp/00000005.png > /dev/null 2>&1 & ) || ( $visu $RACINE/$projet/tmp/00000001.png > /dev/null 2>&1 & ) fi if [ $choixres -eq 0 ]; then isformat="" while [ "$isformat" = "" ]; do echo -e -n "${SUBCOLOR}$p2" echo -e -n "${INPUTCOLOR}> " read satisf [ "$satisf" = "N" ] && satisf=n [ "$satisf" = "$p3" ] && satisf=$p4 if [ "$satisf" = "" ]; then satisf=n echo "$p5" fi if [ "$lng" = "fr" ]; then isformat=`echo $satisf | grep "^[oOnN]$"` elif [ "$lng" = "en" ]; then isformat=`echo $satisf | grep "^[yYnN]$"` fi if [ "$isformat" = "" ]; then echo "$p6" fi done fi echo -n -e "${MAINCOLOR}" } #------------------------------------------------------------ début de la fonction finalisation ----------------------------------------------------------- function finalisation () { if [ $etapedeb -le 7 ]; then echo -e "${TABLECOLOR}$p7" echo -e "${MAINCOLOR}" pas=300 decal=$decalinit epsi=0 test="notok" until [ "$test" = "ok" ] do echo -e "${HEADCOLOR}$p8$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}$p9" sleep 1 mplayer -loop 0 -osdlevel 2 -vo $VO -ao $AO $RACINE/$projet/video/${projet}.ogm > /dev/null 2>&1 rep="notok" until [ "$rep" = "ok" ] do echo -e -n "${SUBCOLOR}$p10" 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 "$p11" rep="notok" ;; esac done depasse=`bc < $decal" >> $RACINE/$projet/tmp/log fi case $tailleCD in 1300 ) echo -e "${TABLECOLOR}$p12" 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}$p12" 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}$p13" echo -e "${MAINCOLOR}" taillefilm=`bc < /dev/null 2>&1 if [ "$?" = "1" ]; then [ "$sortie" = "notok" ] && echo -e -n "${MAINCOLOR}Le(s) programme(s) -" echo -e -n "${HEADCOLOR} ${i}${MAINCOLOR}" sortie="ok" fi; done if [ "$sortie" = "ok" ]; then echo -e " - est (sont) nécessaire(s) à tuxrip et n'a (ont) pas été trouvé(s) dans ${SUBCOLOR}\"$PATH\"" exit -1 fi #-------------- fin Tests des dépendances ------------------ # 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 ^"3\." | awk '{print $2}'` VO=`cat ~/.tuxriprc | grep ^"7\." | awk '{print $4}'` AO=`cat ~/.tuxriprc | grep ^"8\." | awk '{print $4}'` tailleCD=`cat $RACINE/$projet/tmp/log | grep bitrate | awk '{print $6}'` echo "$p16$RACINE/$projet$p16bis" echo "$p17" echo "$p18" # on finit le projet : affichage,mixage echo echo -e "${HEADCOLOR}$p19${MAINCOLOR}" cat $RACINE/$projet/tmp/suivi.log | grep "Pos" cat $RACINE/$projet/tmp/suivi.log | grep "CQ" echo etapedeb=7 finalisation # on efface le fichier d'identité du projet rm -f ~/.tuxripextinction exit fi # Fin --- Reprise après extinction # Flags --------------------- full=-1 resume="" xvid="" grave="" extinction="" lb="" modetest="" testcomp="" while [ $1 ]; do case $1 in "$p93" ) exit 0 ;; "$p238" ) silence="OK" shift echo "$p239" ;; "$p232" ) if [ "$deflng" = "ok" ]; then rm -f ~/.tuxriplng echo "$p233" echo "$p17" rep="notok" while [ "$rep" = "notok" ]; do echo "$p234 (en/fr) ?" read lng case $lng in "en") rep="ok" ;; "fr") rep="ok" ;; *) echo "$p235" ;; esac done touch ~/.tuxriplng echo $lng > ~/.tuxriplng exit else shift echo "$p232 $p236" fi ;; "$p90" ) modetest="OK" shift full=$1 isnum=`echo $full | grep "^[1-9][0-9]*$"` if [ "$isnum" = "" ]; then full=1 else shift fi echo "$p20$full$p20bis" ;; "$p89" ) resume="OK" echo "$p21" shift;; "$p94" ) xvid="OK" echo "$p22" shift;; "$p86" ) [ -r ~/.tuxriprc ] && rm -f ~/.tuxriprc touch ~/.tuxriprc echo "$p17" echo "$p23" #repertoire de travail exist=notok until [ "$exist" = "OK" ] do echo -n -e "${SUBCOLOR}$p24" echo -n -e "${INPUTCOLOR}> " read RACINE if [ "$RACINE" = "" ] ; then RACINE="/space" echo "$p25 : /space" fi if [ -d "$RACINE" ]; then exist=OK else echo -e "${HEADCOLOR}$p26" fi done #echo "$p27" $RACINE >> ~/.tuxriprc echo "1." $RACINE >> ~/.tuxriprc #device exist=notok until [ "$exist" = "OK" ] do echo -n -e "${SUBCOLOR}$p28" echo -n -e "${INPUTCOLOR}> " read DEVICE if [ "$DEVICE" = "" ] ; then DEVICE="/dev/dvd" echo "$p25 : /dev/dvd" fi if [ -r "$DEVICE" ]; then exist=OK else echo -e "${HEADCOLOR}$p29" fi done #echo "$p30" $DEVICE >> ~/.tuxriprc echo "2." $DEVICE >> ~/.tuxriprc # decalage initial de synchronisation en ms isnum="" while [ "$isnum" = "" ] do echo -n -e "${SUBCOLOR}$p31" echo -n -e "${INPUTCOLOR}> " read decalinit if [ "$decalinit" = "" ] ; then decalinit=0 echo "$p25 : 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 "$p32" fi fi done #echo "synchro init : " $decalinit >> ~/.tuxriprc echo "3." $decalinit >> ~/.tuxriprc # options libavcodec echo -n -e "${SUBCOLOR}$p33: 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 "$p25..." fi #echo "$p34" $LAVCOPT >> ~/.tuxriprc echo "4." $LAVCOPT >> ~/.tuxriprc # options xvid echo -n -e "${SUBCOLOR}$p35: 4mv:me_quality=6:min_key_interval=6:max_key_interval=250:keyframe_boost=30] ? " echo -n -e "${INPUTCOLOR}> " read XVIDOPT if [ "$XVIDOPT" = "" ] ; then XVIDOPT="4mv:me_quality=6:min_key_interval=6:max_key_interval=250:keyframe_boost=30" echo "$p25..." fi #echo "$p36" $XVIDOPT >> ~/.tuxriprc echo "5." $XVIDOPT >> ~/.tuxriprc # normalisation maxi isnum="" while [ "$isnum" = "" ] do echo -n -e "${SUBCOLOR}$p37" echo -n -e "${INPUTCOLOR}> " read gainmax if [ "$gainmax" = "" ] ; then gainmax=3 echo "$p25 : 3" fi isnum=`echo $gainmax | grep "^[1-9]$"` if [ "$isnum" = "" ] ; then echo "$p38" fi done #echo "$p39" $gainmax >> ~/.tuxriprc echo "6." $gainmax >> ~/.tuxriprc # drivers video mplayer verif="notok" while [ "$verif" = "notok" ]; do echo -n -e "${SUBCOLOR}$p40" echo -n -e "${INPUTCOLOR}> " read VO case $VO in x11 | xv | sdl ) verif="OK" ;; "" ) verif="OK" VO="xv" echo "$p25 : xv" ;; * ) echo "$p41" verif="notok" ;; esac done #echo "$p42" $VO >> ~/.tuxriprc echo "7." $VO >> ~/.tuxriprc # drivers audio mplayer verif="notok" while [ "$verif" = "notok" ]; do echo -n -e "${SUBCOLOR}$p43" echo -n -e "${INPUTCOLOR}> " read AO case $AO in oss | alsa9 | sdl ) verif="OK" ;; "" ) verif="OK" AO="oss" echo "$p25 : oss" ;; * ) echo "$p44" verif="notok" ;; esac done #echo "$p45" $AO >> ~/.tuxriprc echo "8." $AO >> ~/.tuxriprc # Chaine SCSI du graveur isformat="" while [ "$isformat" = "" ] do echo -n -e "${SUBCOLOR}$p46" echo -n -e "${INPUTCOLOR}> " read graveur if [ "$graveur" = "" ]; then graveur="0,3,0" echo "$p25 : 0,3,0" fi isformat=`echo $graveur | grep "^[0-9],[0-9],[0-9]$"` if [ "$isformat" = "" ] ; then echo "$p47" fi done #echo "$p48" $graveur >> ~/.tuxriprc echo "9." $graveur >> ~/.tuxriprc # Vitesse de gravure isnum="" while [ "$isnum" = "" ] do echo -n -e "${SUBCOLOR}$p49" echo -n -e "${INPUTCOLOR}> " read vitesse if [ "$vitesse" = "" ] ; then vitesse=12 echo "$p25 : 12X" fi isnum=`echo $vitesse | grep "^[1-9][0-9]*$"` if [ "$isnum" = "" ] ; then echo "$p50" fi done #echo "$p51" $vitesse >> ~/.tuxriprc echo "10." $vitesse >> ~/.tuxriprc # visualisateur d'images test="notok" until [ "$test" = "ok" ] do echo -n -e "${SUBCOLOR}$p52" echo -n -e "${INPUTCOLOR}> " read visu if [ "$visu" = "" ] ; then visu="gqview" echo "$p25 : gqview" fi case $visu in gqview | eog | kview | imview | display ) test="ok" ;; * ) test="notok" esac done #echo "$p53" $visu >> ~/.tuxriprc echo "11." $visu >> ~/.tuxriprc # quantizer min/max des génériques format="" until [ "$format" = "ok" ] do echo -n -e "${SUBCOLOR}$p54" echo -n -e "${INPUTCOLOR}> " read quantgen if [ "$quantgen" = "" ]; then quantgen="20-20" echo "$p25 : 20-20" fi isformat=`echo $quantgen | grep "^[0-9][0-9]*-[0-9][0-9]*$"` if [ "$isformat" != "" ] ; then min=`echo $quantgen | cut -d- -f 1` max=`echo $quantgen | cut -d- -f 2` if [ $min -le 31 ] ; then if [ $min -ge 2 ] ; then fmin="ok" else echo "$p55" format="notok" fi ; else echo "$p56" format="notok" fi if [ $max -le 31 ] ; then if [ $max -ge 2 ] ; then fmax="ok" else echo "$p55" format="notok" fi ; else echo "$p56" format="notok" fi if [ "$fmin" = "ok" ] && [ "$fmax" = "ok" ] ; then if [ $min -le $max ] ; then format="ok" else echo "$p57" format="notok" fi fi else echo "$p58" format="notok" fi done #echo "$p59" $quantgen >> ~/.tuxriprc echo "12." $quantgen >> ~/.tuxriprc echo -e "$MAINCOLOR" exit ;; "$p92" ) if [ -r ~/.tuxriprc ] ; then echo "$p17" echo "$p60" RACINE=`cat ~/.tuxriprc | grep ^"1\." | awk '{print $2}'` DEVICE=`cat ~/.tuxriprc | grep ^"2\." | awk '{print $2}'` decalinit=`cat ~/.tuxriprc | grep ^"3\." | awk '{print $2}'` LAVCOPT=`cat ~/.tuxriprc | grep ^"4\." | awk '{print $2}'` XVIDOPT=`cat ~/.tuxriprc | grep ^"5\." | awk '{print $2}'` gainmax=`cat ~/.tuxriprc | grep ^"6\." | awk '{print $2}'` VO=`cat ~/.tuxriprc | grep ^"7\." | awk '{print $2}'` AO=`cat ~/.tuxriprc | grep ^"8\." | awk '{print $2}'` graveur=`cat ~/.tuxriprc | grep ^"9\." | awk '{print $2}'` vitesse=`cat ~/.tuxriprc | grep ^"10\." | awk '{print $2}'` visu=`cat ~/.tuxriprc | grep ^"11\." | awk '{print $2}'` quantgen=`cat ~/.tuxriprc | grep ^"12\." | awk '{print $2}'` lng=`cat ~/.tuxriplng` echo echo -e "${HEADCOLOR}$p61${SUBCOLOR}"$RACINE echo -e "${HEADCOLOR}$p62${SUBCOLOR}"$DEVICE echo -e "${HEADCOLOR}$p63${SUBCOLOR}"$decalinit"${HEADCOLOR} ms" echo -e "${HEADCOLOR}$p64${SUBCOLOR}"$LAVCOPT echo -e "${HEADCOLOR}$p65${SUBCOLOR}"$XVIDOPT echo -e "${HEADCOLOR}$p66${SUBCOLOR}"$gainmax echo -e "${HEADCOLOR}$p67${SUBCOLOR}"$VO echo -e "${HEADCOLOR}$p68${SUBCOLOR}"$AO echo -e "${HEADCOLOR}$p69${SUBCOLOR}"$graveur echo -e "${HEADCOLOR}$p70${SUBCOLOR}"$vitesse"${HEADCOLOR}X" echo -e "${HEADCOLOR}$p71${SUBCOLOR}"$visu echo -e "${HEADCOLOR}$p72${SUBCOLOR}"$quantgen echo -e "${HEADCOLOR}$p237${SUBCOLOR}"$lng else echo "$p73" fi echo -e "${MAINCOLOR}" exit;; "$p85" ) echo "$p17" echo -e "${SUBCOLOR}$p74${MAINCOLOR}" echo " $p86 $p75" echo " $p87 $p76" echo " $p88 $p77" echo " $p85 $p78" #echo " --purge : pour supprimer tous les projets du repertoire de travail." echo " $p89 $p79" echo " $p90 n $p80" echo " $p91 $p81" echo " $p92 $p82" echo " $p93 $p83" echo " $p94 $p84" echo " $p97 $p84bis" echo " $p232 $p84ter" echo " $p238 $p84quad" shift exit;; "$p87" ) echo "$p95" lb="OK" shift;; "$p88" ) echo "$p96" 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;; "$p97" ) echo "$p98" grave="OK" shift;; "$p91" ) echo "$p99" testcomp="OK" shift;; * ) echo "$p100$1$p100bis" shift;; esac done # LECTURE FICHIER DE PREFS------------------------------- if [ -r ~/.tuxriprc ] ; then RACINE=`cat ~/.tuxriprc | grep ^"1\." | awk '{print $2}'` DEVICE=`cat ~/.tuxriprc | grep ^"2\." | awk '{print $2}'` decalinit=`cat ~/.tuxriprc | grep ^"3\." | awk '{print $2}'` LAVCOPT=`cat ~/.tuxriprc | grep ^"4\." | awk '{print $2}'` XVIDOPT=`cat ~/.tuxriprc | grep ^"5\." | awk '{print $2}'` gainmax=`cat ~/.tuxriprc | grep ^"6\." | awk '{print $2}'` VO=`cat ~/.tuxriprc | grep ^"7\." | awk '{print $2}'` AO=`cat ~/.tuxriprc | grep ^"8\." | awk '{print $2}'` graveur=`cat ~/.tuxriprc | grep ^"9\." | awk '{print $2}'` vitesse=`cat ~/.tuxriprc | grep ^"10\." | awk '{print $2}'` visu=`cat ~/.tuxriprc | grep ^"11\." | awk '{print $2}'` quantgen=`cat ~/.tuxriprc | grep ^"12\." | awk '{print $2}'` else echo "$p101 $p86" exit fi # CREATION DU PROJET------------------------------- verif=n #----------------verif DVD present- if [ "$resume" != "OK" ]; then dvdok="notok" while [ "$dvdok" = "notok" ]; do tcprobe -i $DEVICE 2>/dev/null > /tmp/infos.dvd.test testdvd=`ls -l /tmp/infos.dvd.test | awk '{print $5}'` if [ $testdvd -eq 0 ]; then echo -e "${SUBCOLOR}$p131 $DEVICE $p132${MAINCOLOR}" rm -f /tmp/infos.dvd.test read else dvdok="ok" fi done fi # OK DVD present--- while [ "$verif" = "n" ] do [ "$resume" != "OK" ] && projetdef=$( dd if=$DEVICE ibs=1 skip=32808 count=32 2>/dev/null | sed "s/\ //g" ) || projetdef="DVD" [ "$projetdef" = "" ] && projetdef="DVD" echo -n -e "${SUBCOLOR}-------> $p102 $projetdef ] ?" echo -n -e "${INPUTCOLOR}> " read projet if [ "$projet" = "" ] ; then projet=$projetdef echo "$p103 : $projet" fi echo -e "${MAINCOLOR}" if [ -d $RACINE/$projet ] ; then if [ "$resume" = "OK" ]; then onestou=`awk 'END {print NR}' $RACINE/$projet/tmp/log` echo "$p104" case $onestou in 1) echo -e "${SUBCOLOR}-->1)$p105" 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}$p106"$title echo -e "${HEADCOLOR}$p107"$angle echo -e "${HEADCOLOR}$p108"$index echo -e "${HEADCOLOR}$p109"$pisteaudio echo -e "${HEADCOLOR}AR : "$aspect echo -e "${HEADCOLOR}ResXdvd : "$resXdvd echo -e "${HEADCOLOR}ResYdvd : "$resYdvd echo -e "${HEADCOLOR}Framerate : "$fps echo -e "${HEADCOLOR}$p110"$credits ;; 2) echo -e "${SUBCOLOR}-->1)$p105" 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}$p106"$title echo -e "${HEADCOLOR}$p107"$angle echo -e "${HEADCOLOR}$p108"$index echo -e "${HEADCOLOR}$p109"$pisteaudio echo -e "${HEADCOLOR}AR : "$aspect echo -e "${HEADCOLOR}ResXdvd : "$resXdvd echo -e "${HEADCOLOR}ResYdvd : "$resYdvd echo -e "${HEADCOLOR}Framerate : "$fps echo -e "${HEADCOLOR}$p110"$credits echo -e "${SUBCOLOR}-->2)$p111" ;; 3) echo -e "${SUBCOLOR}-->1)$p105" 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}$p106"$title echo -e "${HEADCOLOR}$p107"$angle echo -e "${HEADCOLOR}$p108"$index echo -e "${HEADCOLOR}$p109"$pisteaudio echo -e "${HEADCOLOR}AR : "$aspect echo -e "${HEADCOLOR}ResXdvd : "$resXdvd echo -e "${HEADCOLOR}ResYdvd : "$resYdvd echo -e "${HEADCOLOR}Framerate : "$fps echo -e "${HEADCOLOR}$p110"$credits echo -e "${SUBCOLOR}-->2)$p111" echo -e "${SUBCOLOR}-->3)$p112" qualite=`cat $RACINE/$projet/tmp/log | grep audio | awk '{print $4}'` echo -e "${HEADCOLOR}$p113"$qualite ;; 4) echo -e "${SUBCOLOR}-->1)$p105" 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}$p106"$title echo -e "${HEADCOLOR}$p107"$angle echo -e "${HEADCOLOR}$p108"$index echo -e "${HEADCOLOR}$p109"$pisteaudio echo -e "${HEADCOLOR}AR : "$aspect echo -e "${HEADCOLOR}ResXdvd : "$resXdvd echo -e "${HEADCOLOR}ResYdvd : "$resYdvd echo -e "${HEADCOLOR}Framerate : "$fps echo -e "${HEADCOLOR}$p110"$credits echo -e "${SUBCOLOR}-->2)$p111" echo -e "${SUBCOLOR}-->3)$p112" qualite=`cat $RACINE/$projet/tmp/log | grep audio | awk '{print $4}'` echo -e "${HEADCOLOR}$p113"$qualite echo -e "${SUBCOLOR}-->4)$p114" 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)$p105" 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}$p106"$title echo -e "${HEADCOLOR}$p107"$angle echo -e "${HEADCOLOR}$p108"$index echo -e "${HEADCOLOR}$p109"$pisteaudio echo -e "${HEADCOLOR}AR : "$aspect echo -e "${HEADCOLOR}ResXdvd : "$resXdvd echo -e "${HEADCOLOR}ResYdvd : "$resYdvd echo -e "${HEADCOLOR}Framerate : "$fps echo -e "${HEADCOLOR}$p110"$credits echo -e "${SUBCOLOR}-->2)$p111" echo -e "${SUBCOLOR}-->3)$p112" qualite=`cat $RACINE/$projet/tmp/log | grep audio | awk '{print $4}'` echo -e "${HEADCOLOR}$p113"$qualite echo -e "${SUBCOLOR}-->4)$p114" 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)$p115" 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}$p116"$tailleCD"$p117" echo -e "${HEADCOLOR}$p118"$bitvideo" kbps" echo -e "${HEADCOLOR}$p119"$scale ;; 6) echo -e "${SUBCOLOR}-->1)$p105" 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}$p106"$title echo -e "${HEADCOLOR}$p107"$angle echo -e "${HEADCOLOR}$p108"$index echo -e "${HEADCOLOR}$p109"$pisteaudio echo -e "${HEADCOLOR}AR : "$aspect echo -e "${HEADCOLOR}ResXdvd : "$resXdvd echo -e "${HEADCOLOR}ResYdvd : "$resYdvd echo -e "${HEADCOLOR}Framerate : "$fps echo -e "${HEADCOLOR}$p110"$credits echo -e "${SUBCOLOR}-->2)$p111" echo -e "${SUBCOLOR}-->3)$p112" qualite=`cat $RACINE/$projet/tmp/log | grep audio | awk '{print $4}'` echo -e "${HEADCOLOR}$p113"$qualite echo -e "${SUBCOLOR}-->4)$p114" 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)$p115" 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}$p116"$tailleCD"$p117" echo -e "${HEADCOLOR}$p118"$bitvideo" kbps" echo -e "${HEADCOLOR}$p119"$scale echo -e "${SUBCOLOR}-->6)$p120";; 7) echo -e "${SUBCOLOR}-->1)$p105" 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}$p106"$title echo -e "${HEADCOLOR}$p107"$angle echo -e "${HEADCOLOR}$p108"$index echo -e "${HEADCOLOR}$p109"$pisteaudio echo -e "${HEADCOLOR}AR : "$aspect echo -e "${HEADCOLOR}ResXdvd : "$resXdvd echo -e "${HEADCOLOR}ResYdvd : "$resYdvd echo -e "${HEADCOLOR}Framerate : "$fps echo -e "${HEADCOLOR}$p110"$credits echo -e "${SUBCOLOR}-->2)$p111" echo -e "${SUBCOLOR}-->3)$p112" qualite=`cat $RACINE/$projet/tmp/log | grep audio | awk '{print $4}'` echo -e "${HEADCOLOR}$p113"$qualite echo -e "${SUBCOLOR}-->4)$p114" 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)$p115" 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}$p116"$tailleCD"$p117" echo -e "${HEADCOLOR}$p118"$bitvideo" kbps" echo -e "${HEADCOLOR}$p119"$scale echo -e "${SUBCOLOR}-->6)$p120" echo -e "${SUBCOLOR}-->7)$p121" decalinit=`cat $RACINE/$projet/tmp/log | grep mixage | awk '{print $4}'` echo -e "${HEADCOLOR}$p1220"$decalinit "ms" [ "$grave" = "OK" ] && echo -e "${SUBCOLOR}-->8)$p230" ;; esac verif=o else isformat="" while [ "$isformat" = "" ]; do echo -n -e "${SUBCOLOR}------->$p122" echo -n -e "${INPUTCOLOR}> " read verif [ "$verif" = "N" ] && verif=n [ "$verif" = "$p3" ] && verif=$p4 if [ "$verif" = "" ]; then verif=n echo "$p123" fi if [ "$lng" = "fr" ]; then isformat=`echo $verif | grep "^[oOnN]$"` elif [ "$lng" = "en" ]; then isformat=`echo $verif | grep "^[yYnN]$"` fi if [ "$isformat" = "" ]; then echo "$p124" fi echo -n -e "${MAINCOLOR}" [ "$verif" = "$p4" ] && rm -rf $RACINE/$projet || echo done fi else if [ "$resume" = "OK" ]; then echo "$p125" exit else verif=o fi fi done if [ "$resume" = "OK" ]; then limite=`expr $onestou \+ 1` [ $limite -eq 8 ] && limite=7 if [ $limite -eq 7 ] && [ "$grave" = "OK" ]; then limite=8 fi etapedeb=10 while [ $etapedeb -gt $limite ] do echo echo -n -e "${SUBCOLOR}------->$p126 $limite] ? " echo -n -e "${INPUTCOLOR}> " read etapedeb if [ "$etapedeb" = "" ] ; then echo "$p127 $limite..." etapedeb=$limite fi isnum=`echo $etapedeb | grep "^[1-9][0-9]*$"` if [ "$isnum" = "" ] ; then echo "$p128 $limite..." etapedeb=10 else [ $etapedeb -gt $limite ] && echo "$p129" fi done echo $etapedeb 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 ;; 8 ) awk 'NR == 1 , NR == 7 {print $0}' $RACINE/$projet/tmp/log > $RACINE/$projet/tmp/log.resume ;; esac rm -f $RACINE/$projet/tmp/log mv $RACINE/$projet/tmp/log.resume $RACINE/$projet/tmp/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 fi cd $RACINE/$projet # ANALYSE DU DVD----------------------------------- echo if [ $etapedeb -le 1 ]; then echo -e "${TABLECOLOR}$p130" echo -e "${MAINCOLOR}" dvdok="notok" while [ "$dvdok" = "notok" ]; do tcprobe -i $DEVICE 2>/dev/null > $RACINE/$projet/tmp/infos.dvd.test testdvd=`ls -l $RACINE/$projet/tmp/infos.dvd.test | awk '{print $5}'` if [ $testdvd -eq 0 ]; then echo echo -e "${SUBCOLOR}$p131 $DEVICE $p132${MAINCOLOR}" rm -f $RACINE/$projet/tmp/infos.dvd.test read else dvdok="ok" fi done echo -e "${HEADCOLOR}$p133${MAINCOLOR}" titre=1 tcprobe -i $DEVICE -T $titre > $RACINE/$projet/tmp/infos.dvd.$titre 2>&1 titremax=`cat $RACINE/$projet/tmp/infos.dvd.$titre | grep "DVD title" | awk '{print $4}' | awk -F "/" '{print $2}' | awk -F ":" '{print $1}'` titre=2 while [ $titre -le $titremax ]; do tcprobe -i $DEVICE -T $titre > $RACINE/$projet/tmp/infos.dvd.$titre 2>&1 titre=$(($titre + 1)) done titre=1 timemax=0 titredef=1 while [ $titre -le $titremax ]; do echo -e "${HEADCOLOR}--->$p134 $titre${MAINCOLOR}" echo -n -e "${MAINCOLOR}$p135${SUBCOLOR}" ; cat $RACINE/$projet/tmp/infos.dvd.$titre | grep "DVD title" | awk -F ":" '{print $2}' | awk -F ", title" '{print $1}' time=`cat $RACINE/$projet/tmp/infos.dvd.$titre | grep "time" | awk '{print $5}'` H=`echo $time | cut -d: -f 1` M=`echo $time | cut -d: -f 2` S=`echo $time | cut -d: -f 3` timesec=`bc < $p138 $titredef] ? " echo -n -e "${INPUTCOLOR}> " read title if [ "$title" = "" ]; then echo "$p139 $titredef..." title=$titredef fi isnum=`echo $title | grep "^[1-9][0-9]*$"` if [ "$isnum" != "" ]; then if [ $title -gt $titremax ]; then echo "$p140 $titremax $p141" isnum="" fi else echo "$p142" fi done 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}'` anglemax=$angle if [ $anglemax -gt 1 ]; then isnum="" echo -e "${HEADCOLOR}$p143 ${SUBCOLOR}$anglemax${HEADCOLOR}$p144" until [ "$isnum" != "" ]; do echo -n -e "${SUBCOLOR}------->$p145" echo -n -e "${INPUTCOLOR}> " read angle if [ "$angle" = "" ]; then echo "$p146" angle=1 fi isnum=`echo $angle | grep "^[1-9][0-9]*$"` if [ "$isnum" != "" ]; then if [ $angle -gt $anglemax ]; then echo "$p147 $anglemax $p148" isnum="" fi else echo "$p149" fi done echo -n -e "${MAINCOLOR}" echo else echo "$p150 "$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}' audiomax=`cat $RACINE/$projet/tmp/infos.dvd | grep "audio format" | awk -F "audio stream:" '{print $2}' | awk -F "aid" '{print $1}' | tail -n 1 | awk '{print $1}'` if [ $audiomax -gt 0 ]; then isnum="" until [ "$isnum" != "" ]; do echo -n -e "${SUBCOLOR}------->$p151" echo -n -e "${INPUTCOLOR}> " read index if [ "$index" = "" ]; then echo "$p152" index=0 fi isnum=`echo $index | grep "^[0-9][0-9]*$"` if [ "$isnum" != "" ]; then if [ $index -gt $audiomax ]; then echo "$p153" isnum="" fi else echo "$p154" fi done echo -n -e "${MAINCOLOR}" else index=$audiomax echo -e "${MAINCOLOR}$p155 "$index"..." fi 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="$p156" fi aid=`expr $index \+ 128` echo -n -e "${HEADCOLOR}$p157"$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} >>>> $p158 <<<<" echo nbchap=`cat $RACINE/$projet/tmp/infos.dvd | grep "chapters in this DVD title" | awk '{print $3}'` # if [ "$modetest" = "OK" ] ; then # if [ $full -gt $nbchap ]; then # echo "$p159 $full $p160($nbchap) $p161" # full=$nbchap # else # nbchap=$full # fi # fi if [ "$modetest" = "OK" ] ; then if [ $full -gt $nbchap ]; then echo "$p159 $full $p160($nbchap) $p161" full=$nbchap chapgen=$(($nbchap - 1)) elif [ $full -eq $nbchap ]; then chapgen=$(($full - 1)) else chapgen=$full fi else [ $nbchap -gt 1 ] && chapgen=$(($nbchap - 1)) || chapgen=$nbchap fi mplayer -loop 0 -osdlevel 2 -dvd $title -aid $aid -dvd-device $DEVICE -chapter $chapgen -vo $VO -ao $AO > /dev/null 2>&1 nogen=`cat $RACINE/$projet/tmp/infos.dvd.$title | grep time | awk '{print $5}' | awk -F "." '{print $1}'` isformat="" until [ "$isformat" != "" ] do echo -n -e "${SUBCOLOR}------->$p162 $nogen] ? " echo -n -e "${INPUTCOLOR}> " read generique if [ "$generique" = "" ] ; then echo "$p163 $nogen, $p164" generique=$nogen fi isformat=`echo $generique | egrep "^0?[0-4]:[0-5]?[0-9]:[0-5]?[0-9]$"` if [ "$isformat" = "" ] ; then echo "$p165" else genH=`echo $generique | cut -d: -f 1` genM=`echo $generique | cut -d: -f 2` genS=`echo $generique | cut -d: -f 3` credits=`bc </dev/null > $RACINE/$projet/tmp/$projet-chapitrage echo echo echo "scan dvd (titre,angle,index,langue,AR,ResX,ResY,fps,credits) --> $title $angle $index $pisteaudio $aspect $resXdvd $resYdvd $fps $credits" >> $RACINE/$projet/tmp/log fi # Ripping if [ $etapedeb -le 2 ]; then echo -e "${TABLECOLOR}$p166" 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" ;; # lpcm ) typeaudio="raw" ;; * ) typeaudio="ac3" ;; esac dvdok="notok" while [ "$dvdok" = "notok" ]; do tcprobe -i $DEVICE 2>/dev/null > $RACINE/$projet/tmp/infos.dvd.test testdvd=`ls -l $RACINE/$projet/tmp/infos.dvd.test | awk '{print $5}'` if [ $testdvd -eq 0 ]; then echo echo -e "${SUBCOLOR}$p131 $DEVICE $p132${MAINCOLOR}" read else dvdok="ok" fi done if [ "$modetest" = "OK" ]; then echo -e "${HEADCOLOR}$p167${SUBCOLOR}${title}${HEADCOLOR} ($p168${SUBCOLOR} ${full}${HEADCOLOR}) $p169 ${SUBCOLOR}$RACINE/$projet/vob/$projet.vob${HEADCOLOR}...${MAINCOLOR}" else echo -e "${HEADCOLOR}$p167${SUBCOLOR}${title}${HEADCOLOR} $p169 ${SUBCOLOR}$RACINE/$projet/vob/$projet.vob${HEADCOLOR}...${MAINCOLOR}" fi # tccat -t dvd -T $title,$full,$angle -i $DEVICE 2>/dev/null | tee $RACINE/$projet/vob/$projet.vob | tcextract -a $index -x $typeaudio -t vob | tcdecode -x $typeaudio | tcscan -x pcm -b 80 > $RACINE/$projet/tmp/infos.son tccat -t dvd -T $title,$full,$angle -i $DEVICE 2>/dev/null > $RACINE/$projet/vob/$projet.vob tccat -i $RACINE/$projet/vob/$projet.vob | 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 fi # ENCODAGE AUDIO---------------------------- if [ $etapedeb -le 3 ]; then echo -e "${TABLECOLOR}$p170" 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 "$p171"$rescale isnum="" while [ "$isnum" = "" ] do echo -e "${MAINCOLOR}" echo -n -e "${SUBCOLOR}------->$p172" echo -n -e "${INPUTCOLOR}> " read qualite if [ "$qualite" = "" ] ; then qualite=1,0 echo "$p173" fi isnum=`echo $qualite | egrep "^[0-9]+[\.,]?[0-9]*$"` if [ "$isnum" = "" ] ; then echo "$p174" 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 2>/dev/null rm -f $RACINE/$projet/tmp/pcmpipe.raw sleep 2 echo "encodage audio --> $qualite" >> $RACINE/$projet/tmp/log fi # cropping if [ $etapedeb -le 4 ]; then echo -e "${TABLECOLOR}$p175" echo -e "${MAINCOLOR}" cd $RACINE/$projet/tmp taille1=`ls -l $RACINE/$projet/vob/$projet.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 "$p176" $crop echo -e "$p177"${top}"$p181" echo -e "$p178"${bot}"$p181" echo -e "$p179"${droite}"$p181" echo -e "$p180"${gauche}"$p181" echo echo -e "${MAINCOLOR}" echo ">>>> $p182 <<<<" echo mplayer -ao null -vo png -z 0 -sb $deb -frames 5 -vop rectangle=$crop $RACINE/$projet/vob/$projet.vob > /dev/null 2>&1 [ -f "$RACINE/$projet/tmp/00000005.png" ] && ( $visu $RACINE/$projet/tmp/00000005.png > /dev/null 2>&1 & ) || ( $visu $RACINE/$projet/tmp/00000001.png > /dev/null 2>&1 & ) isformat="" while [ "$isformat" = "" ] ; do echo -n -e "${SUBCOLOR}------->$p183" echo -n -e "${INPUTCOLOR}> " read verif [ "$verif" = "N" ] && verif=n [ "$verif" = "$p3" ] && verif=$p4 if [ "$verif" = "" ]; then verif=n echo "$p184" fi if [ "$lng" = "fr" ]; then isformat=`echo $verif | grep "^[oOnN]$"` elif [ "$lng" = "en" ]; then isformat=`echo $verif | grep "^[yYnN]$"` fi if [ "$isformat" = "" ]; then echo "$p124" fi done echo -n -e "${MAINCOLOR}" deb=`bc < $crop $haut $larg" >> $RACINE/$projet/tmp/log fi # resolution, bitrate... if [ $etapedeb -le 5 ]; then cd $RACINE/$projet echo -e "${TABLECOLOR}$p185" 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) $p189" echo -n -e "${INPUTCOLOR}$p190" read cd if [ "$cd" = "" ]; then cd=2 echo "$p191" fi isnum=`echo $cd | grep "^[1-5]$"` if [ "$isnum" = "" ]; then echo "$p192" fi done 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}------->$p193" echo -n -e "${INPUTCOLOR}> " autres=ok read tailleCD isnum=`echo $tailleCD | grep "^[1-9][0-9]*$"` if [ "$isnum" = "" ] ; then echo "$p194" fi done ;; esac echo -n -e "${MAINCOLOR}" #interleave (+ marge) de 1 % tailledispo=`bc <$p198" echo -n -e "${INPUTCOLOR}> " read CQ if [ "$CQ" = "" ] ; then CQ=0.22 echo "$p199" fi isnum0=`echo $CQ | egrep "^[0-9]+\.?[0-9]*$"` if [ "$isnum0" = "" ]; then echo "$p200" fi done echo -n -e "${MAINCOLOR}" ResY=`bc <$p206" echo -e -n "${INPUTCOLOR}> " read pcfilm if [ "$pcfilm" = "" ]; then pcfilm=5 echo "$p207" fi isnum=`echo $pcfilm | grep "^[1-9][0-9]*$"` if [ "$isnum" = "" ]; then echo "$p208" else if [ $pcfilm -gt 20 ]; then echo "$p209" isnum="" fi fi done echo -n -e "${MAINCOLOR}" sec=`bc </dev/null 2>&1 i=$(($i + 1)) done echo echo -e "${HEADCOLOR}$p212${MAINCOLOR}" avimerge -i $RACINE/$projet/tmp/cctemp*.avi -o $RACINE/$projet/tmp/ccheck$projet.avi > $RACINE/$projet/tmp/infocc$projet.merge 2>&1 dureecc=`bc < $RACINE/$projet/tmp/infocc$projet echo echo -e "${MAINCOLOR}$p231=${SUBCOLOR}0$CC${MAINCOLOR}" echo ResX=`bc <> $RACINE/$projet/tmp/res ResY=`bc < $RACINE/$projet/tmp/res.format printf "%1s %5s %1s %10s %1s %10s %1s %2s %1s %3s %1s \n" \| Choix \| Résolution \| Déformation \| CQvisé \| %Comp. \| elif [ "$lng" = "en" ]; then awk '{printf "| %2d) | %8s | %7.1f | %6.3f | %5.1f |\n", $1 , $2 , $3 , $4 , $5 }' $RACINE/$projet/tmp/res > $RACINE/$projet/tmp/res.format printf "%1s %6s %1s %10s %1s %10s %1s %4s %1s %3s %1s \n" \| Choice \| Resolution \| Deformation \| QFtarget \| %Comp. \| fi cat $RACINE/$projet/tmp/res.format echo " 20) $p213" isnum="" while [ "$isnum" = "" ] do if [ "$resdefaut" != "" ]; then echo -n -e "${INPUTCOLOR}$p214 $resdefaut] ? > " else echo -n -e "${INPUTCOLOR}$p215" fi read choixres if [ "$resdefaut" != "" ]; then if [ "$choixres" = "" ]; then choixres=$resdefaut echo "$p216 $resdefaut" fi fi isnum=`echo $choixres | grep "^[1-9][0-9]*$"` [ "$isnum" != "" ] && [ $isnum -gt 20 ] && isnum="" if [ "$isnum" = "" ]; then echo "$p217" fi done echo -e "${MAINCOLOR}" scale=`cat $RACINE/$projet/tmp/res | grep "^$choixres" | awk '{print $2}'` ResX=`echo $scale | cut -d: -f 1` ResY=`echo $scale | cut -d: -f 2` [ $choixres -eq 20 ] && satisf="n" [ $choixres -lt 20 ] && satisf="o" echo "$p229$scale" preview # fin compressibility check fi done echo "taille visée, résolution, bitrate --> $tailleCD $scale $bitvideo" >> $RACINE/$projet/tmp/log fi #encodage video if [ $etapedeb -le 6 ]; then echo echo -e "${TABLECOLOR}$p218" 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/$projet.vob fin=`bc </dev/null 1>$RACINE/$projet/tmp/suivi1.log | (sleep 2 ; pid=`ps r | grep mencoder | awk '{print $1}'` ; nice -19 tail -f --pid=$pid -n 1 $RACINE/$projet/tmp/suivi1.log) bitmax=`cat $RACINE/$projet/tmp/suivi1.log | tail -n 1 | awk '{print $3}' | sed -e "s/,/./"` CQmax=`bc </dev/null 1>$RACINE/$projet/tmp/suivi2.log | (sleep 2 ; pid=`ps r | grep mencoder | awk '{print $1}'` ; nice -19 tail -f --pid=$pid -n 1 $RACINE/$projet/tmp/suivi2.log) else if [ "$lb" = "OK" ]; then echo -e "${SUBCOLOR}$p223${MAINCOLOR}" nice -15 mencoder $SOURCE -nosound -o /dev/null -ovc xvid -xvidencopts $XVIDOPT:bitrate=$bitvideo:pass=1 -vop scale=$scale,crop=$crop,pp=lb -sws 2 2>/dev/null 1>$RACINE/$projet/tmp/suivi1.log | (sleep 2 ; pid=`ps r | grep mencoder | awk '{print $1}'` ; nice -19 tail -f --pid=$pid -n 1 $RACINE/$projet/tmp/suivi1.log) bitmax=`cat $RACINE/$projet/tmp/suivi1.log | tail -n 1 | awk '{print $3}' | sed -e "s/,/./"` CQmax=`bc </dev/null 1>$RACINE/$projet/tmp/suivi2.log | (sleep 2 ; pid=`ps r | grep mencoder | awk '{print $1}'` ; nice -19 tail -f --pid=$pid -n 1 $RACINE/$projet/tmp/suivi2.log) else echo -e "${SUBCOLOR}$p223${MAINCOLOR}" nice -15 mencoder $SOURCE -nosound -o /dev/null -ovc xvid -xvidencopts $XVIDOPT:bitrate=$bitvideo:pass=1 -vop scale=$scale,crop=$crop -sws 2 2>/dev/null 1>$RACINE/$projet/tmp/suivi1.log | (sleep 2 ; pid=`ps r | grep mencoder | awk '{print $1}'` ; nice -19 tail -f --pid=$pid -n 1 $RACINE/$projet/tmp/suivi1.log) bitmax=`cat $RACINE/$projet/tmp/suivi1.log | tail -n 1 | awk '{print $3}' | sed -e "s/,/./"` CQmax=`bc </dev/null 1>$RACINE/$projet/tmp/suivi2.log | (sleep 2 ; pid=`ps r | grep mencoder | awk '{print $1}'` ; nice -19 tail -f --pid=$pid -n 1 $RACINE/$projet/tmp/suivi2.log) fi fi else if [ "$fps" = "29.97" ]; then echo "$p220" echo -e "${SUBCOLOR}$p223${MAINCOLOR}" nice -15 mencoder $SOURCE -nosound -o /dev/null -ovc lavc -lavcopts $LAVCOPT:vrc_override=$credits,$fin,$quantgen:vqscale=2:vpass=1 -vop scale=$scale,crop=$crop -ofps 23.976 -sws 2 2>/dev/null 1>$RACINE/$projet/tmp/suivi1.log | (sleep 2 ; pid=`ps r | grep mencoder | awk '{print $1}'` ; nice -19 tail -f --pid=$pid -n 1 $RACINE/$projet/tmp/suivi1.log) bitmax=`cat $RACINE/$projet/tmp/suivi1.log | tail -n 1 | awk '{print $3}' | sed -e "s/,/./"` CQmax=`bc </dev/null 1>$RACINE/$projet/tmp/suivi2.log | (sleep 2 ; pid=`ps r | grep mencoder | awk '{print $1}'` ; nice -19 tail -f --pid=$pid -n 1 $RACINE/$projet/tmp/suivi2.log) else if [ "$lb" = "OK" ]; then echo -e "${SUBCOLOR}$p223${MAINCOLOR}" nice -15 mencoder $SOURCE -nosound -o /dev/null -ovc lavc -lavcopts $LAVCOPT:vrc_override=$credits,$fin,$quantgen:vqscale=2:vpass=1 -vop scale=$scale,crop=$crop,lavcdeint -sws 2 2>/dev/null 1>$RACINE/$projet/tmp/suivi1.log | (sleep 2 ; pid=`ps r | grep mencoder | awk '{print $1}'` ; nice -19 tail -f --pid=$pid -n 1 $RACINE/$projet/tmp/suivi1.log) bitmax=`cat $RACINE/$projet/tmp/suivi1.log | tail -n 1 | awk '{print $3}' | sed -e "s/,/./"` CQmax=`bc </dev/null 1>$RACINE/$projet/tmp/suivi2.log | (sleep 2 ; pid=`ps r | grep mencoder | awk '{print $1}'` ; nice -19 tail -f --pid=$pid -n 1 $RACINE/$projet/tmp/suivi2.log) else echo -e "${SUBCOLOR}$p223${MAINCOLOR}" nice -15 mencoder $SOURCE -nosound -o /dev/null -ovc lavc -lavcopts $LAVCOPT:vrc_override=$credits,$fin,$quantgen:vqscale=2:vpass=1 -vop scale=$scale,crop=$crop -sws 2 2>/dev/null 1>$RACINE/$projet/tmp/suivi1.log | (sleep 2 ; pid=`ps r | grep mencoder | awk '{print $1}'` ; nice -19 tail -f --pid=$pid -n 1 $RACINE/$projet/tmp/suivi1.log) bitmax=`cat $RACINE/$projet/tmp/suivi1.log | tail -n 1 | awk '{print $3}' | sed -e "s/,/./"` CQmax=`bc </dev/null 1>$RACINE/$projet/tmp/suivi2.log | (sleep 2 ; pid=`ps r | grep mencoder | awk '{print $1}'` ; nice -19 tail -f --pid=$pid -n 1 $RACINE/$projet/tmp/suivi2.log) fi fi fi else if [ "$xvid" = "OK" ]; then if [ "$fps" = "29.97" ]; then echo "$p220" echo -e "${SUBCOLOR}$p223${MAINCOLOR}" nice -15 mencoder $SOURCE -nosound -o /dev/null -ovc xvid -xvidencopts $XVIDOPT:bitrate=$bitvideo:pass=1 -vop scale=$scale,crop=$crop -ofps 23.976 -sws 2 2>&1 | tee $RACINE/$projet/tmp/suivi1.log bitmax=`cat $RACINE/$projet/tmp/suivi1.log | tail -n 1 | awk '{print $3}' | sed -e "s/,/./"` CQmax=`bc <&1 | tee $RACINE/$projet/tmp/suivi2.log else if [ "$lb" = "OK" ]; then echo -e "${SUBCOLOR}$p223${MAINCOLOR}" nice -15 mencoder $SOURCE -nosound -o /dev/null -ovc xvid -xvidencopts $XVIDOPT:bitrate=$bitvideo:pass=1 -vop scale=$scale,crop=$crop,pp=lb -sws 2 2>&1 | tee $RACINE/$projet/tmp/suivi1.log bitmax=`cat $RACINE/$projet/tmp/suivi1.log | tail -n 1 | awk '{print $3}' | sed -e "s/,/./"` CQmax=`bc <&1 | tee $RACINE/$projet/tmp/suivi2.log else echo -e "${SUBCOLOR}$p223${MAINCOLOR}" nice -15 mencoder $SOURCE -nosound -o /dev/null -ovc xvid -xvidencopts $XVIDOPT:bitrate=$bitvideo:pass=1 -vop scale=$scale,crop=$crop -sws 2 2>&1 | tee $RACINE/$projet/tmp/suivi1.log bitmax=`cat $RACINE/$projet/tmp/suivi1.log | tail -n 1 | awk '{print $3}' | sed -e "s/,/./"` CQmax=`bc <&1 | tee $RACINE/$projet/tmp/suivi2.log fi fi else if [ "$fps" = "29.97" ]; then echo "$p220" echo -e "${SUBCOLOR}$p223${MAINCOLOR}" nice -15 mencoder $SOURCE -nosound -o /dev/null -ovc lavc -lavcopts $LAVCOPT:vrc_override=$credits,$fin,$quantgen:vqscale=2:vpass=1 -vop scale=$scale,crop=$crop -ofps 23.976 -sws 2 2>&1 | tee $RACINE/$projet/tmp/suivi1.log bitmax=`cat $RACINE/$projet/tmp/suivi1.log | tail -n 1 | awk '{print $3}' | sed -e "s/,/./"` CQmax=`bc <&1 | tee $RACINE/$projet/tmp/suivi2.log else if [ "$lb" = "OK" ]; then echo -e "${SUBCOLOR}$p223${MAINCOLOR}" nice -15 mencoder $SOURCE -nosound -o /dev/null -ovc lavc -lavcopts $LAVCOPT:vrc_override=$credits,$fin,$quantgen:vqscale=2:vpass=1 -vop scale=$scale,crop=$crop,lavcdeint -sws 2 2>&1 | tee $RACINE/$projet/tmp/suivi1.log bitmax=`cat $RACINE/$projet/tmp/suivi1.log | tail -n 1 | awk '{print $3}' | sed -e "s/,/./"` CQmax=`bc <&1 | tee $RACINE/$projet/tmp/suivi2.log else echo -e "${SUBCOLOR}$p223${MAINCOLOR}" nice -15 mencoder $SOURCE -nosound -o /dev/null -ovc lavc -lavcopts $LAVCOPT:vrc_override=$credits,$fin,$quantgen:vqscale=2:vpass=1 -vop scale=$scale,crop=$crop -sws 2 2>&1 | tee $RACINE/$projet/tmp/suivi1.log bitmax=`cat $RACINE/$projet/tmp/suivi1.log | tail -n 1 | awk '{print $3}' | sed -e "s/,/./"` CQmax=`bc <&1 | tee $RACINE/$projet/tmp/suivi2.log fi fi fi fi cat $RACINE/$projet/tmp/suivi1.log $RACINE/$projet/tmp/mitemps $RACINE/$projet/tmp/suivi2.log > $RACINE/$projet/tmp/suivi.log rm -f $RACINE/$projet/tmp/suivi1.log $RACINE/$projet/tmp/mitemps $RACINE/$projet/tmp/suivi2.log echo echo "encodage video" >> $RACINE/$projet/tmp/log if [ "$extinction" = "OK" ]; then echo echo "$p224" sleep 10 touch ~/.tuxripextinction echo $RACINE $projet >> ~/.tuxripextinction sudo /sbin/shutdown -h now fi fi # mixage A/V finalisation if [ "$grave" = "OK" ]; then if [ $etapedeb -le 8 ]; then echo -e "${TABLECOLOR}$p225" echo -e "${MAINCOLOR}" tailleSECT=`mkisofs -r -J -q -print-size $RACINE/$projet/video/${projet}.ogm` tailleMO=`expr $tailleSECT \* 2048` cd650=333000 cd700=360000 test1=`expr $tailleSECT "<=" $cd650` test2=`expr $tailleSECT "<=" $cd700` if [ "$test1" = "1" ] ; then disk=650 elif [ "$test2" = "1" ] ; then disk=700 else echo "$p226" exit 0 fi echo -e "${SUBCOLOR}$p227 $disk$p117 $p228${MAINCOLOR}" su -c "mkisofs -r -J $RACINE/$projet/video/${projet}.ogm 2>/dev/null | cdrecord -v -dao speed=$vitesse dev=$graveur -tsize=${tailleSECT}s -" fi fi echo -e "${MAINCOLOR}"