Help to lxdvdrip
================

I please to respect with employment of this program the Copyright.
The copy of a Video DVD is permitted only for private purposes, 
its not permitted to crack a copy protection.

For Details see the german copyright protection law: http://transpatent.com/gesetze/urhg.html 


Disclaimer:
===========

The Usage of lxdvdrip is for own Risc. I give no Guarantee, that
lxdvdrip ever operates correct. Even i am not responsible for all Damages,
that could exist because of Usage of lxdvdrip.


Files in this Archive
=====================

- Makefile:        compile lxdvdrip
- lxdvdrip.c:      the Main Program
- streamanalyze.c: factor calculation
- lxac3scan.c:     ac3-Audio scan
- README.de:       german Help
- README.en:       english Help
- README.fr:       french Help
- lxdvdrip.conf:   example Config-File
- Changelog.en:    Changes from Version to Version / english Text
- Changelog.de:    Changes from Version to Version / german Text
- Changelog.fr:    Changes from Version to Version / french Text
- COPYING:         The GPL
- dvdauthor/dvdvob.c: 
                   Patch for dvdauthor-0.6.10
- vamps:           Complete Version of vamps (needed for Copymode)
- mpgtx/mpgtx:     Static Binary of mpgtx
- mpgtx/mpeg.cxx:  Patch for Source


Installation
============ 

- archives unpack: 

tar zxvf lxdvdrip.tgz 

- compile&install: 

cd lxdvdrip 
make 
make install 

By "make install" the program "lxdvdrip" is copied to "/usr/local/bin".

After that you should edit the Config File "lxdvdrip.conf.EN". After editing&saving
copy the file to Directory "/etc" with:

code: cp lxdvdrip.conf.EN /etc/lxdvdrip.conf.

Alternative: Copy as ".lxdvdrip.conf" to Userdir:

code: cp lxdvdrip.conf.EN ~/.lxdvdrip.conf

See below for changing the Values in the config-File.


Patch of dvdauthor:
===================

In the Subdir "dvdauthor" there is the File "dvdvob.c". Here is a Patch against
the Error-Message "ERR: SCR moves backwards" and a Bugfix for the 
"Navigationproblem" (some players couldnt rewind the movie).

Installation:
- download dvdauthor 0.6.10 as Source-Package
  (http://sourceforge.net/project/showfiles.php?group_id=59028)
- Unzip Package (tar zxvf dvdauthor*)
- copy "dvdvob.c" into the src-Subdir over the original File
- compile&install (./configure, make, make install)


Installation of vamps:
======================

Vamps is only used in the Copymode to backup DVDs with more 4.7 GB
completly (instead of Menus).

In the Subdir "vamps" is  a complete Version of vamps. A Download
at www.heise.de isnt needed anymore. The Original Version doesnt work,
this Version is patched to work with dvdunauthor-Streams and against 
Floating Point Errors.

Installation with "make" and "make install".


Installation of mpgtx:
======================

"mpgtx" is used in the partcopy-Mode to calculate the Playtime of
the ripped Titles. You can use the static Binary "mpgtx", copy it i. E. to
"/usr/local/bin". Or compile it from Source, copy File "mpeg.cxx" over the 
Original File from your mpgtx-Version 1.3.

Homepage: http://mpgtx.sourceforge.net/


Conditions:
=========== 

The following programs must be installed:

- vamps >= 0.98 to rip (Subdir "vamps")
  or
- mplayer >= 0.90 (http://www.mplayerhq.hu/)
  or
- transcode >= 0.6.12 (http://www.transcoding.org/cgi-bin/transcode)
  a Buffer Package to use "Transcode parallel":
  - buffer (http://rpmfind.net/linux/RPM/contrib/libc6/i386/buffer-1.19-1.i386.html) or
  - mbuffer (http://www.rcs.ei.tum.de/~maierkom/privat/software/mbuffer/) or
  - bfr (http://www.glines.org:8000/software/buffer.html)
  (Setup one of them in lxdvdrip.conf, Parameter "buffer_name=...")
  or
- DVD5=>DVD5 Copy (lxdvdrip -st=copy):
    dvdbackup (http://dvd-create.sourceforge.net/) 
    or
    vobcopy (http://lpn.rnbhq.org/)
- DVD9=>DVD5 Copy (lxdvdrip -st=copy):  
    vamps (Subdir "vamps")

- For DVDs with Menu the dvdwizard >= 0.4.2 is needed, too:
  http://www.wershofen.de/downloads/dvdwizard.tar.gz
  http://udrecsuite.sourceforge.net/doku_dvdwizard.html


Remark: If you have Problems with vamps, please use the mplayer or
transcode Method. Its not so fast, but it works mostly perfect.

- dvdauthor for the Video DVD-Structure (http://dvdauthor.sourceforge.net/)
- libdvdread for reading the DVD (http://rpmseek.com/rpm-pl/libdvdread.html?hl=de&cs=libdvdread:PN:0:0:0:0)


The following programs could be installed:

- Player for Preview, i. E. mplayer (http://www.mplayerhq.hu/)
- Burning Tool
  growisofs from the dvd+-rw-tools (http://fy.chalmers.se/~appro/linux/DVD+RW/) or
  cdrecord-prodvd (http://gd.tuwien.ac.at/utils/misc/schilling/cdrecord/ProDVD/) and
  cdrtools (because of mkisofs)
- lsdvd for showing the DVD-Structure (http://acidrip.thirtythreeandathird.net/)

For every Method lxdvdrip tests for all used Programs.


What is lxdvdrip? 
================= 

The actual technology is based on the package vamps. 

This program is able to rip a DVD title or chapters, reauthor the files to a DVD-Structure,
preview the Files and burn to a DVD+/-R.

The "traditional" way to Rip in 4 Steps (Rip Video&Requant, Rip Audio, Mplex, dvdauthor) is included, too. 
Activation through Command Line Parameter "-st=mplayer" for mplayer or "-st=transcode" for transcode.

A very fast Method is "Transcode parallel", all Commands are piped, so that only a single Pass Read
is needed.

The Program calculates the longest Title and the Factor to requant the 
Video.

As 4.th Streamtool "dvdbackup" could be called. It copies the whole DVD to Harddisk.
So it is easy to copy a 4,7 GB DVD without Requant etc. Activation with "-st=copy".

New is the Copymode for DVDs greater than 4.7 GB. dvdunauthor is used to rip the DVD,
tcprobe is used to select VOB-Files Content (Count Audio and Subpicture Tracks),
vamps to requant VOB-Files and at last dvdauthor for new Authorisation.
Using this Method you get a DVD with all Video-, Audio- and Subpicturetracks and 
the Chapters from the Original. Menus are lost. Using this Method you have to patch
dvdauthor. The needed Files are in this Archive. Copy them over the Original and
compile the Version. Activation with "-st=copy", too.

New is the "partial Copy"-Mode, too (lxdvdrip -st=partcopy). Like the Copymode, the whole DVD is copied
to Harddisc with dvdunauthor. Then the User could preview and select the Titles, 
that should be copied. The Requant-Job is done bei vamps (like Copymode, too).
All Audio- and Subpicture-Tracks are copied. This mode is ideal to make a Backup
of a DVD with TV-Series.


DVD with Menu
=============

Through Integration of the dvdwizard the DVD gets a Menu. 
The Backup gets a light Menu with Buttons to select and start the Title, the Audiotrack
and a Chapteroverview. 

For more Information take a look at "README.dvdwiard.en".


Call of streamtool to Rip
=========================

Here are the Program-Calls used by lxdvdrip:

vamps (-st=vamps): 

- dvdauthor -t .... -f 'play_cell ... | vamps ... |'

mplayer (-st=mplayer):

- mplayer dvd://1 -dumpstream -dumpfile /dev/stdout | tcextract -t vob -a 0 -x mpeg2 | tcrequant -f 2 > /tmp/ofile.m2v
- mplayer dvd://1 -alang de -dumpaudio -dumpfile /tmp/ofile.ac3
- tcmplex -i /tmp/ofile.m2v -p /tmp/ofile.ac3 -m d -o /tmp/film-neu.vob
- dvdauthor -t -a ac3+de -o film-dvd film-neu.vob

transcode (-st=transcode):

- tccat -i /dev/dvd -T1,-1 | tcextract -t vob -x mpeg2 | tcrequant -f 2 > /tmp/ofile.m2v
- tccat -i /dev/dvd -T1,-1 | tcextract -t vob -x ac3 -a0 > /tmp/ofile.ac3
- tcmplex -i /tmp/ofile.m2v -p /tmp/ofile.ac3 -m d -o /tmp/film-neu.vob
- dvdauthor -t -a ac3+de -o film-dvd film-neu.vob

transcode parallel (-st=trans_par):

- mkfifo foo.s1
- mkfifo foo.s2
- mkfifo foo.ac3
- mkfifo foo.m2v
- mkfifo foo.mpeg
- mkdir dvdimage
- mplex -f 8 -S 0 -o foo.mpeg foo.m2v foo.ac3 &
- buffer -s 64k -m 16m -i foo.s1 | tcextract -t vob -x mpeg2 | tcrequant -f 2.0 >foo.m2v &
- buffer -s 64k -m 16m -i foo.s2 | tcextract -t vob -x ac3 -a 0 >foo.ac3 &
- tccat -i /dev/dvd -T 1,-1 | tee foo.s1 foo.s2 >/dev/null &
- dvdauthor -t -a ac3+en -o dvdimage foo.mpeg # final command has no ampersand

Copymode, DVD <= 4.7 GB (-st=copy):

- dvdbackup -i /dev/dvd -o /tmp/film-dvd -M

Copymode, DVD > 4.7 GB (-st=copy):

- dvdunauthor /dev/dvd
- tcprobe (Select Content of VOBs, Video, Count Subpictures, Count Audiotracks)
- dvdauthor -t ... -f 'cat *.vob | vamps -E ...|'
- dvdauthor -T

partial Copy: see Copymode (-st=partcopy)


Config File
===========

The File Name is /etc/lxdvdrip.conf (~/.lxdvdrip.conf). All possible Parameters of the
Program could be set to a Default Value.

You must only start the program with a command line Parameter, if you need 
in an example another Value than the Default.

If you have Problems with the calculated factor, overwrite the value with 
the command line Parameter "-f=value".

Example for Use of growisofs und mplayer:

---------------------------------------------------------------------
titel=0
audio=1
untertitel=0
faktor=0
dvdleser=/dev/dvd
dvdbrenner=/dev/scd0
filmverzeichnis=/tmp/film-dvd
brennprogramm=1
vobplayer=mplayer
language=de
audio-default=0
streamtool=mplayer
wait-burn=1
tmp=/tmp
delete=1
mplex=tcmplex
chapter=1
free=1
---------------------------------------------------------------------

Example for Use of cdrecord-prodvd und xine:

---------------------------------------------------------------------
titel=0
audio=1
untertitel=0
faktor=0
dvdleser=/dev/dvd
dvdbrenner=0,0,0
filmverzeichnis=/tmp/film-dvd
brennprogramm=2
vobplayer=xine
language=de
audio-default=0
streamtool=transcode
wait-burn=1
tmp=/tmp
delete=1
mplex=mplex
chapter=1
free=1
speed=4
burnkey=CDR_SECURIRY=xyz
---------------------------------------------------------------------

The permitted Values are shown by calling "lxdvdrip -h" or (--help):

---------------------------------------------------------------------------------------------
lxdvdrip Help
=============

Start Program: lxdvdrip [-parameter=value]

You must only give those Parameters with another Value as defined in the config-File
(/etc/lxdvdrip.conf, ~/.lxdvdrip.conf). The Default Values are in Brackets () behind 
the Parameters.

-st=Streamtool       : vamps, mplayer, transcode, trans_par (Transcode parallel), copy,
                       partcopy (-st=vamps)
-tmp=Directory       : Directory for temp-Files for Ripping with mplayer (-tmp=/tmp)
-mp=mplex            : Multiplexer, only with -st=mplayer, use mplex instead of tcmplex 
                       by having Problems with tcmplex (-mp=tcmplex)
-t=TitleNr           : Nr of the ripping Title, "lsdvd" shows all Titles, 
                       regulary the longest Title, 0=longest Title will be 
                       calculated by lxdvdrip, l=select from list (-t=0)
-hq=x                : High Quality Backup, copy 1 DVD-9 => 2 DVD-5,
                       -hq=1=>1. Part, -hq=2=>2. Part (-hq=0)
-vf=x                : dvdauthor with -v (Video Format) (0=no,1=yes) (-vf=0)
-a=Language Audio    : "-a=1": only german, "-a=2": only english, "-a=3": german+english,
                       "-a=4,xy" in Language xy, i. E. "-a=4,fr" for french, 
                       "-a=l" for List for free Selection of Audiotracks (-a=1)
-ad=AudioDefault     : 0=first Track in Language, 1=AC3 with Channel first, AC3/2 twice, 
                       2=DTS first (not with mplayer) (-ad=0)
-lab=VolumeID        : Name of DVD (Volume-ID/Label)
-chap=chapter        : 0=without Chapter, 1=with Chapter/lxdvdrip, 2=with Chapter/tcprobe (-chap=1)
-u=Subpicture-Nr.    : Nr of the ripping Subpicture-Track (Infos with lsdvd), 
                       0=without Subtitles, l=list, input Nr., alternative Language, i. E. "-u=de" (-u=0)
-fv=Film-Directory   : Directory for the ripping Files (-fv=/tmp/film-dvd)
-f=Factor            : Normally Factor vor Requant will be calculated, but you can 
                       overwrite the factor with your value, by "-f=-1" lxdvdrip makes a 
                       Testrip of one Chapter to calculate Factor (-f=0)
-dl=DVD-Device       : Device-Name of DVD-Reader (-dl=/dev/dvd)
-db=Burner-Device    : Device of the Burner (-db=/dev/scd0)
-bp=Burn-Program     : 1=growisofs, 2=cdrecord-prodvd, 3=cdrecord-prodvd on the fly, 0=no Burning (-bp=1)
-sp=x                : burning Speed (-sp=0)
-wb=Wait for Burn    : Program ask you for DVD-R before Burning (1=yes, 0=no) (-wb=1)
-format=             : 1=RW format, 0=no
-vp=VOB-Player       : player for VOB-preview, off=no Preview (-vp=mplayer)
-lang=en             : Program in english (Default german)
-d=delete            : Delete VOB-Files after Burning (0=no, 1=yes) (-d=1)
-free=check          : Check for free Disk Space before Ripping (0=no, 1=yes) (-free=1)
-file=Outputfile     : Instead dvdauthor+growisofs Result in a File, i. E. "-file=/tmp/dvd.vob"
                       -file=0=>Option off
-dw=x                : 1=dvdwizard on, 0=dvdwizard off (0)
-h                   : Show this help (--help)
-v                   : Show Version (--version)
Example: # lxdvdrip -t=1

If there are 2 Audio Tracks in the same Language, lxdvdrip takes as Default the dts-Track 
(better Quality, -ad=2). If there are 2 AC3-Tracks, lxdvdrip takes that one 
with the highest Channel-Nr (-ad=1). Default is the first Track with the 
selected Language (-ad=0).
---------------------------------------------------------------------------------------------


Option in Config File       Command Line Parameter
==================================================
titel                       -t
audio                       -a
untertitel                  -u
faktor                      -f
dvdleser                    -dl
dvdbrenner                  -db
filmverzeichnis             -fv
brennprogramm               -bp
speed                       -sp
vobplayer                   -vp
language                    -lang
audio-default               -ad
streamtool                  -st
wait-burn                   -wb
format                      -format
tmp                         -tmp
delete                      -d
mplex                       -mp
chapter                     -chap
free                        -free
videoformat                 -fv
file                        -file
dvdwizard                   -dw


Remarks to DVD-Reading-Device
=============================

Normally there is a Link "/dev/dvd" to the Reading Device. If there is no link,
you could create it as root, i. E. "ln -s /dev/hdc /dev/dvd".

You could shrink&burn Videos copied to the Harddisc by dvdbackup with:

"lxdvdrip -dl=/path/to/video" (Path instead of DVD-Device).


Remarks to DVD-Burning-Device
=============================

By using growisofs with an IDE-Burner with SCSI Emulation the Device normally is 
"/dev/scd0".

By using "cdrecord-prodvd the Device is normally "0,0,0". The correct Value you can find
with "cdrecord-prodvd -scanbus".

cdrecord-prodvd works with IDE-Burners directly without SCSI-Emulation. In this Case 
the Device is i. E. "ATAPI:0,0,0".


Remarks to Calculation of Factor, Testrip
=========================================

Lxdvdrip calculates the Size of Video- and all / selected Audiostreams.
Because lxdvdrip uses averagely Bit Rates to calculate the length of Audio Tracks, the
Result is not so optimal as Possible.

Therefore lxdvdrip has the Feature "Testrip" (-f=-1). A single Chapter at the mid of the DVD is readed, from the Size of the ripped Files lxdvdrip calculates the Size from the whole Title  
and then the Requant-Factor. This Function gives a very good Result.


Search for Errors / Log-File
============================

To search an Error, its a good idea to write all Messages from lxdvdrip and used Tools
to a Logfile. In this case you must call lxdvdrip in this way:

"lxdvdrip ... 2>&1 | tee lxdvdrip.log"

"..." is a Placeholder for any lxdvdrip-Options, "2>&1" writes the Output of the used Tools (stderr)
to "/dev/stdout", "tee lxdvdrip.log" write the Console-Output (stdout) to the Logfile 
"lxdvdrip.log".

All Output from lxdvdrip and the used Tools will be written to the Logfile
"lxdvdrip.log". Input is possible, Output to stdout normally.
