Difference between revisions of "DVD to DVD Backup Script"

From MythTV Official Wiki
Jump to: navigation, search
m (Reverted edits by Dryepicurean68 (Talk) to last revision by Matthias)
 
Line 1: Line 1:
La densidad es la forma en estrecha colaboración moléculas son el uno al otro. Aunque parezca increíble, el agua y el alcohol puede tener diferentes
+
''This script is from a posting on the MythTV-users mailing list.''
  
densidades (a pesar de que ambos son líquidos). Entonces, ¿los diferentes tipos de harina o azúcar. ¿Te has preguntado si una taza de azúcar morena significaba: a la
+
You can burn VOB files already ripped in MythDVD by commenting out the portions of the script that grab the main feature and that grab the chapter info and change the name of the VOB file in the script.  Or just leave the script as is to backup from a DVD. This How-To assumes you already have MythDVD working correctly.
  
izquierda esponjosa, envasado en, o en realidad lleno de duro? Una balanza de cocina digital con facilidad respuestas a estas preguntas que le proporciona el peso, que
+
To have this script run uninterrupted from beginning to end, you must replace the original dvd with a blank dvd at some point during the process.
  
es una medida totalmente independiente de la densidad o el volumen. Aparte de hacer cocinar / hornear más precisa, es mucho más rápido. En vez de salir todas sus
+
If you want to put multiple video titles on one DVD, you will want to create a DVD with a menu.  To do so you will have to activate the "Make the DVD image (w/menu)" section of the script and deactive the w/o section. To create your menu, check out the [[Dvd Menu How To|DVDs With Menus]] How-To.
  
medidas taza y cucharas, cucharitas, hacer conversiones entre todas las unidades, se puede utilizar una balanza digital.
+
{{Code box|dvd-backup.sh|
[http://www.recetas.im Recetas de Cocina Faciles]
+
<pre>
 +
 
 +
## Grab the .vob of the main feature
 +
echo "Grabbing VOB from DVD."
 +
tccat -i /dev/dvd -T 1,-1 -L >dvd.vob
 +
 
 +
## Make fifo's for extracting audio and video simultaneously
 +
mkfifo vid.fifo
 +
mkfifo aud.fifo
 +
 
 +
## perform the extraction
 +
echo "Extracting audio and video from file1"
 +
tcextract -i aud.fifo -t vob -x ac3 -a 0 > ofile1.ac3 &
 +
tcextract -i vid.fifo -t vob -x mpeg2 > ofile1.m2v &
 +
cat dvd.vob | tee aud.fifo vid.fifo >/dev/null
 +
 
 +
rm *.fifo
 +
 
 +
## Retrieve the chapter list.
 +
echo "Retrieving chapter list from DVD"
 +
tcprobe -i /dev/dvd -T 1 -H 10 2>&1 | egrep "\[Chapter ..\] " | \
 +
cut -d " " -f 4 | perl -pi -e 's/\n/,/' | \
 +
perl -pi -e 's/,$//' >chap.list &&
 +
 
 +
## Calculate the requantization factor
 +
vsize1=`ls -l ofile1.m2v | awk '{print $5}'`
 +
vsize1=`echo $vsize1 / 1048576 | bc`
 +
asize1=`ls -l ofile1.ac3 | awk '{print $5}'`
 +
asize1=`echo $asize1 / 1048576 | bc`
 +
req=`echo "1.05 * $vsize1 / (4400 - $asize1)" | bc -ql`
 +
echo Requantizing at: $req
 +
 
 +
## Perform requantization (comment out if $req < 1.0)
 +
echo "Requantizing MPEG video for file1"
 +
tcrequant -i ofile1.m2v -o movie1.m2v -f $req
 +
 
 +
## Put the audio and video back together
 +
echo "mplexing file1"
 +
mplex -f 8 -S 0 -o movie1.mpeg movie1.m2v ofile1.ac3
 +
 
 +
## Make the dvd image (w/o menu)
 +
echo "Making DVD file system, step 1"
 +
dvdauthor -t -a ac3+en -c `cat chap.list` -o dvd movie1.mpeg
 +
echo "Making DVD file system, step 2"
 +
dvdauthor -T -o dvd
 +
 
 +
## Make the dvd image (w/ menu)
 +
#echo "Making DVD file system"
 +
#dvdauthor -x dvd.xml
 +
 
 +
## Make DVD
 +
echo "Writing DVD"
 +
growisofs -Z /dev/scd0 -dvd-video dvd
 +
 
 +
echo "Done."
 +
 
 +
</pre>
 +
}}
 +
 
 +
[[Category:HOWTO]]
 +
[[Category:Scripts]]

Latest revision as of 08:51, 5 December 2011

This script is from a posting on the MythTV-users mailing list.

You can burn VOB files already ripped in MythDVD by commenting out the portions of the script that grab the main feature and that grab the chapter info and change the name of the VOB file in the script. Or just leave the script as is to backup from a DVD. This How-To assumes you already have MythDVD working correctly.

To have this script run uninterrupted from beginning to end, you must replace the original dvd with a blank dvd at some point during the process.

If you want to put multiple video titles on one DVD, you will want to create a DVD with a menu. To do so you will have to activate the "Make the DVD image (w/menu)" section of the script and deactive the w/o section. To create your menu, check out the DVDs With Menus How-To.


Script.png dvd-backup.sh


## Grab the .vob of the main feature
echo "Grabbing VOB from DVD."
tccat -i /dev/dvd -T 1,-1 -L >dvd.vob

## Make fifo's for extracting audio and video simultaneously
mkfifo vid.fifo
mkfifo aud.fifo

## perform the extraction
echo "Extracting audio and video from file1"
tcextract -i aud.fifo -t vob -x ac3 -a 0 > ofile1.ac3 &
tcextract -i vid.fifo -t vob -x mpeg2 > ofile1.m2v &
cat dvd.vob | tee aud.fifo vid.fifo >/dev/null

rm *.fifo

## Retrieve the chapter list.
echo "Retrieving chapter list from DVD"
tcprobe -i /dev/dvd -T 1 -H 10 2>&1 | egrep "\[Chapter ..\] " | \
cut -d " " -f 4 | perl -pi -e 's/\n/,/' | \
perl -pi -e 's/,$//' >chap.list &&

## Calculate the requantization factor
vsize1=`ls -l ofile1.m2v | awk '{print $5}'`
vsize1=`echo $vsize1 / 1048576 | bc`
asize1=`ls -l ofile1.ac3 | awk '{print $5}'`
asize1=`echo $asize1 / 1048576 | bc`
req=`echo "1.05 * $vsize1 / (4400 - $asize1)" | bc -ql`
echo Requantizing at: $req

## Perform requantization (comment out if $req < 1.0)
echo "Requantizing MPEG video for file1"
tcrequant -i ofile1.m2v -o movie1.m2v -f $req

## Put the audio and video back together
echo "mplexing file1"
mplex -f 8 -S 0 -o movie1.mpeg movie1.m2v ofile1.ac3

## Make the dvd image (w/o menu)
echo "Making DVD file system, step 1"
dvdauthor -t -a ac3+en -c `cat chap.list` -o dvd movie1.mpeg
echo "Making DVD file system, step 2"
dvdauthor -T -o dvd

## Make the dvd image (w/ menu)
#echo "Making DVD file system"
#dvdauthor -x dvd.xml

## Make DVD
echo "Writing DVD"
growisofs -Z /dev/scd0 -dvd-video dvd

echo "Done."