Thursday, January 10, 2013

Introducing dvdcopy, an error-resistant command-line DVD copier

My wife likes watching DVDs a lot, which is why she borrows many from the public library. The problem is that many of those were handled by people who have no clue whatsoever about the proper handling of DVDs, which means that they are in a state ranging from moderately scratched in the best cases to properly scarred in the worst ones... xine or VLC fail miserably to read such DVDs. What's worse is that failures happen right in the middle of DVDs, which is quite frustrating !

That's why I've started quite some time ago to write a small C wrapper around libdvdread to first copy the DVD files onto the disk and then read them from there. It was also an easy solution to copy files to a driveless netbook to watch the DVD there. With time, this project evolved into a neat C++ command-line utility that's able to keep track of badly read sectors and come back to them later.

Today is the 0.0 release of dvdcopy. You can get the tarball there. It follows the standard autoconf dance:

~ ./configure
~ make
~ make install

Using it is as simple as running:

~ dvdcopy /dev/dvd MyMovieDirectory

If everything went fine, you're set, and you can open the directory created with vlc or xine:

~ xine dvd://`pwd`/MyMovieDirectory

(yes, xine needs the full path, I haven't checked with VLC, but from what I remember, you can open DVD directories directly from a menu).

If you're not that lucky and dvdcopy found some bad sectors, try reading again using

~ dvdcopy --second-pass /dev/dvd MyMovieDirectory

I found that in many cases, one or two second passes get all the sectors back. While that wasn't really the intended purpose, the fact that most copy protection schemes (in addition to CSS) are implemented using bad sectors make dvdcopy quite resistant to them.

I have no plan of making a Debian package for it at the time being, but if there is demand for that, I may reconsider. Enjoy !

10 comments:

fabian said...

I hereby declare demand in a Debian package! ;)

Ole Laursen said...

My wife could use that too. A Debian package would be neat. :)

Ross Reedstrom said...

I have the exact same use case: DVDs from the library. Though exacerbated by the fact that most of the dcds ee check out are for my two boys, so have been handled even more roughly. I often have to resort to manually "resurfacing" the disks. Debian packages please!

23.gs said...

What does this do that dvdisaster (http://dvdisaster.net/) or python-dvdvideo (http://bblank.thinkmo.de/blog/new-software-python-dvdvideo) don't?

Vincent Fourmond said...

@23.gs
dvdisaster allows one to write DVDs that contain data that you may be able to read even if the DVD becomes damaged. It doesn't allow you to read damaged DVDs it didn't produce (and as far as I can tell, it won't work on CSS-encrypted DVDs).

python-dvdvideo seems much closer, but I didn't find a focus on bad sectors handling (but I haven't tried it).

Vincent Fourmond said...

@others
I see there is need. Debian package will come in due time !

Lionel Billoret said...

"make" return this error :
In file included from src/main.cc:25:0:
src/headers.hh:35:32: fatal error: dvdread/dvd_reader.h: Aucun fichier ou dossier de ce type
compilation terminated.

Vincent Fourmond said...

Try installing the dvdread development files, as per the README file ;-):

sudo apt-get install libdvdread-dev

Lionel Billoret said...

I didn't read the readme file, only your blog post. Shame on me!

Thank you for your help and for this amazing tool

river proaudio said...

Great Tool..Thanks for posting..

DVD Copier