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.


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".

Installation:
- download dvdauthor 0.6.x 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 than 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.

Vamps will be installed with lxdvdrip. 
Binaries: vamps_lxdvdrip, play_cell_lxdvdrip (usr/local/bin)


DVD-Backup:
===========

DVD-Backup is only used in the Copymode to backup DVDs with less than 4.7 GB
completly (with Menus).

DVD-Backup will be installed with lxdvdrip. 
Binaries: dvdbackup_lxdvdrip (usr/local/bin)


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)
  or
- vlc >= 0.85 (Video Lan Client) and transcode >= 0.6.12

Option "Parallel":
- a Buffer Package to use "Transcode parallel" or "VLC parallel":
  - buffer (Subdir "buffer") or
  - mbuffer (http://www.maier-komor.de/mbuffer.html) or
  - bfr (http://www.glines.org/wiki/bfr)
  (Setup one of them in lxdvdrip.conf, Parameter "buffer_name=...")

Copy Mode:
- DVD5=>DVD5 Copy (lxdvdrip -st=copy):
    dvdbackup (Subdir "dvdbackup") 
    or
    vobcopy (http://lpn.rnbhq.org/)
- DVD9=>DVD5 Copy (lxdvdrip -st=copy):  
    vamps (Subdir "vamps")

- For DVDs with Menu the dvdwizard >= 0.5.0 is needed, too:
  http://dvdwizard.wershofen.net/



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 / 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, "-st=transcode" for transcode and 
"-st=vlc" for Video Lan Client.

A very fast Method is "Transcode/VLC parallel", all Commands are piped, so that only a single Pass Read
is needed ("-st=trans_par", "-st=vlc_par").

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

As Copy-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,
Subtitles and a Chapteroverview. 

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

With the (experimental) Feature
"lxdvdrip -st=vamps_menu" you get a Backup with the original Menu.
The following content will be saved:
- Original menu
- main title
- Audiotracks (standard selection)
- All Subtitles


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

vlc (parallel): like transcode (parallel), but tccat is replaced by vlc

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 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
---------------------------------------------------------------------

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, vlc, vlc_par, vamps_menu (-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),
                       ISO-File or Directory with VIDEO_ts-Structure.
-db=Burner-Device    : Device of the Burner (-db=/dev/scd0)
-bp=Burn-Program     : 1=growisofs, 2=cdrecord, 3=cdrecord 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)
-check=Trackcheck?   : Check for Audiotracks with tcprobe (0=no, 1=yes) (-check=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).

An Iso-File could be ripped, too (dd if=/dev/dvd of=dvd.iso, lxdvdrip -dl=dvd.iso).


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

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

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

cdrecord 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.


