Hi!
Well, I like mplayer (www.mplayerhq.hu) a lot! Conversion and all that. But
- for a quick copy of a dvd to harddisk I didn't find the right tools under
linux (back then - something similar to vobdec under win). So, I hacked
together a copy program using heavily the libdvdread library (which is
really great).
It should also now work on FreeBSD (many thanks to Takeshi HIYAMA!!) and
Solaris (also many thanks to Erik Hovland!!) and on MacOSX (either
straight from this source or get it via fink - that really works)

What you need in advance is libdvdread(-devel) installed. This will only copy
css-unencrypted dvd's (take a GOOD look
at http://freshmeat.net/projects/libdvdread).
There are also rpm and deb packages available!

**IMPORTANT**
	I receive nearly NO bugreports, so either vobcopy (and therefore I)
	are near-perfect (yeah, right ;-) or your problems have a real slim chance
	of getting fixed. Bugreporting is *really* simple, add "-v -v" to your
	vobcopy call to have vobcopy create a bugreport file you can mail me at
	robos@muon.de along with a small description of your system (OS,
	hardware, ...) and the problem.
	I did receive some questions which I answer in the FAQ. Take a look
	there before you mail me a bugreport.

It should compile with:

$ autoreconf --install
$ ./configure
$ make

and either invoke the vobcopy binary, or if desired, install with

$ make install

and run the test suite with:

$ make check

To help debug test failures, two extra flags can be passed to all test programs
via the TESTFLAGS make variable:

  -v / --verbose      Print [verbose] progress lines (temp file paths, parsed
                      values, each assertion reached) while running.
  -k / --keep-temps   Do not delete temporary files and directories after the
                      test; their paths are printed so you can inspect them.

Examples:

$ make check TESTFLAGS="-v"          # verbose output from all tests
$ make check TESTFLAGS="-v -k"       # verbose + keep temp files for inspection

The flags are also understood when running a test binary directly:

$ ./tests/unit_dvd_image -v -k

The test suite is integrated into Automake (`make check`) and currently has:
- `tests/unit_helpers`: unit tests for helper/path logic (`safestrncpy`,
  `add_end_slash`, `sanitize_dvd_name`, and `get_fallback_dvd_name`).
- `tests/unit_dvd_image`: runtime-generated disk-image tests for dvd-name
  extraction from synthetic binary images (including a sparse large image),
  and error handling on too-small images.
- `tests/unit_image_output_flow`: end-to-end unit flow using synthetic disk
  images to verify that parsed disc titles are turned into the exact output
  filenames used by vobcopy (`make_output_path`) and that completed `.partial`
  files are promoted to final filenames (`re_name`) without data loss.
- `tests/cli-smoke.sh`: command-line smoke tests for options that do not require
  a mounted DVD (`-V`, `-h`, and invalid argument validation).

How the synthetic image tests work:
- They create temporary files in `/tmp`, write a 2048-byte block at the disc
  title offset (`32768` bytes, with title bytes at offset `40` inside the
  block), and then call the real parsing code (`get_dvd_name`).
- The "large image" case uses sparse files so no large real disk allocation is
  required.
- The "too-small image" case verifies that failure is detected for short reads
  and that the emitted reason is the short read itself (without a misleading
  `error: Success` line).
- Output-file tests then feed parsed titles into vobcopy output-name logic and
  verify exact filenames and `.partial` rename behavior using temporary files.

Input from a file path is already supported via `-i`: when path/device auto-detection
fails, vobcopy will try to open the provided `-i` value directly as a directory/image
path using libdvdread.

Code paths intentionally not covered by automated tests:
- Real DVD I/O and full title-copy loops (`DVDReadBlocks`, large-file writes, mirror
  copies): these require real DVD media/images with valid structures and large data.
- Interactive overwrite/continue prompts: these are terminal-driven flows that need
  interactive input and side-effectful filesystem setup.
- OS-specific mount/device probing in `get_device*` (`/etc/mtab`, `/etc/fstab`,
  `getmntinfo`, Solaris `mnttab`): behavior depends on host OS/runtime mount state.
- Signal/timer shutdown behavior (`SIGALRM`/`SIGTERM` handlers): deterministic unit
  testing would require process-level signal harnessing not used in `make check`.

For rpm based systems the commands should be something like this:
The src.rpm should rebuild cleanly on any RPM-based distro with
"rpmbuild --rebuild vobcopy-0.5.8-1.src.rpm" (or replace "rpmbuild" with
"rpm" on older distributions), so it's distribution-neutral.
Alternatively this will build the binary package for them automagically:
rpmbuild -ta vobcopy-0.5.8.tar.gz

Compile:
	make
Install:
	as root: make install


Handling:
vobcopy	(without _any_ options)
	will copy the title with the most chapters to the current directory.
 	The vobs will be merged up to 2 gigs and then a new file will be
	started. So what you get is:
	name-of-moviex-1.vob (2 gig size) name-of-moviex-2.vob ...
	During copying there is a .partial appended to the filename to
	indicate that the files are not done yet. If for some reason the
	sizes don't match the one on dvd the .partial will stay to indicate
	that something is wrong.

For more infos on the options see "man vobcopy"
	Newest addition:

vobcopy -M will rip the title with the longest playing time. Normal
	mode without any options is with the most chapters. Both
	methods can be wrong so please try both. I will implement a
	message when the methods deliver different "main" titles shortly.

vobcopy -x will not ask any questions if you want to overwrite
	pre-existing files but will simply do so.

vobcopy -O <filename of single files you want to copy, more than one have to
	be separated by comma>
	e.g. -O video_ts.vob,vts_01_01.ifo,vts_01_01.vob
	or -O bup,ifo will copy all files containing ifo and bup in their names
	This selects files by name from VIDEO_TS, so it cannot be combined with
	-n. To match title 2 in this mode, use something like -O vts_02_.

vobcopy -F <fast_factor= 1..64> (--fast)
	Speed up the copying (experimental)
	(in my case it went from 10:43 min to 9:40 with 1x to 10x, so not
	THAT much, maybe with faster drives...)

vobcopy -m (or --mirror, long-options are possible now)
	Mirror the content of /dvd/video_ts/ to a dir named after the dvd.

	Optionally you can provide which vts_xx_01 (which title) should be
	copied via
vobcopy -n 3
	will copy vts_03_xx.vob to harddisk.
vobcopy -o /tmp/, "-" or "stdout"
	will copy the output to /tmp/, or to stdout for piping to another program
	(like bbtools, see the vobcopy page)
vobcopy -1/tmp1/
	will continue to write the data to this directory if the first one
	(behind -o) is full. Additionally there are -2, -3 and -4 available.
	(watch out that there are no spaces behind the number and the dir,
	might not work otherwise)
vobcopy -l
	will copy the data into only one really large file (probably larger
	than 2 GB). This large-file-support has to be met by your system. No
	autodetection yet.
vobcopy -h
	gives you the available command options (help)

If parts of vobcopy work buggy you can override some things:
vobcopy -f
	force vobcopy to write to the destination directory even if vobcopy
	thinks there is not enough free space.
vobcopy -i /path/to/the/mounted/dvd/
	if vobcopy fails to autodetect the mounted dvd you can provide the path
	like that.
vobcopy -I
	will give you some infos on the dvd data and on the output directory
vobcopy -v -v
	will write a log-file to the current directory. You can send me this
	as a bugreport 	(along with a few words by you about the problem)
vobcopy -b
	begins to copy from the specified offset-size. Modifiers like b for
	512-bytes, k for kilo-bytes, m for mega- and g for giga-bytes can be
	appended to the number. Example: vobcopy -b 500m will start to copy
	from 500MB onward till the end.
vobcopy -e size[bkmg]
	similar to -b, this options lets you specify some size to stop before
	the end.
vobcopy -V
	prints the version number of vobcopy
vobcopy -t name
	changes the name of the output file or writes to stdout for pipeing
	(deprecated, use -o instead now)

vobcopy -q
	all info and error messages of vobcopy go to vobcopy.bla in the current
	directory instead of stderr. Good when you want to pipe the output of
	vobcopy to some other program, e.g. bbtools or mplayer.

vobcopy -x
	overwrite all existing files without further question

The options can be combined and arranged as you like.
It worked for me, hope for you too.
Have fun!
Robos (robos@muon.de)
