Discussion:
[libdvdcss-devel] Any way to improve brute force?
Christian Pernegger
2016-03-10 09:57:33 UTC
Permalink
Hi,

I've recently embarked on ripping my DVDs to my NAS and (perhaps
foolishly) started by copying the VIDEO_TS directories, intending to
play from that or convert as needed. As it turns out this doesn't work
for all discs or even most, I get a lot of "libdvdread: Error cracking
CSS key for [...]". From what I've read this could maybe have been
avoided by a) having used libdvdcss directly on the disc (instead of a
directory) while b) having the correct region set on the drive.
This means that I would have to re-rip (I'd really rather not, the
last session took the better part of a day) and set a region on my
drive (meaning I'd sooner or later run out of changes).

My understanding was that libdvdcss would fall back to a brute force
"title" method if presented with data on a filesystem or an RPC2 drive
not set to the correct region. I'd have expected that process to take
some serious time, but it doesn't, it fails almost immediately (couple
of seconds at most). Is there any way to improve the title method,
e.g. give it more time or additional info?

Regards,
Christian
Reimar Döffinger
2016-03-10 19:16:52 UTC
Permalink
Post by Christian Pernegger
Hi,
My understanding was that libdvdcss would fall back to a brute force
"title" method if presented with data on a filesystem or an RPC2 drive
not set to the correct region. I'd have expected that process to take
some serious time, but it doesn't, it fails almost immediately (couple
of seconds at most). Is there any way to improve the title method,
e.g. give it more time or additional info?
The cases I know of only fail on short titles, like copyright warnings (the irony!).
For brute-forcing it then gets a bit difficult since you are short of bits with known values so then you'd probably need a bit of video stream parsing code to check that you got the right key (I think).
In many cases however that is not necessary: you can get the key of the longest title and then you check the same key and +- a few values.
That would work for almost half of my DVDs.
Quite a few have just c0:00:00:00:0? as keys actually.
Besides all that, there is a chance someone looking closely might actually simply find bugs in the code that would improve things.
Christian Pernegger
2016-03-10 19:40:22 UTC
Permalink
Post by Reimar Döffinger
The cases I know of only fail on short titles, like copyright warnings (the irony!).
My current test case fails on a ~20 min "featurette", so not quite that short.
Post by Reimar Döffinger
In many cases however that is not necessary: you can get the key of the longest title and
then you check the same key and +- a few values.
I actually know the key, for the above case at least, because I have
the .dvdcss directory from a computer with a drive set to the correct
region. If there were a way to force-feed keys to libdvdcss for use
even on disc images / VIDEO_TS dirs, I'd be home free. Well, I'd still
have to insert each disc once more to get the keys, but that's a ...
sight better than ripping it all again at ~3 MB/s.

AFAICT 1.4.0 doesn't use the cache at all for VIDEO_TS files; for disc
images it insists on using a cache directory with a non-obvious name
(yay strace!) directly under / ...

All that for opera recordings from the early 1980s that I could
probably watch on Youtube in about the same quality. But it's the
principle of the thing, having a clean software solution that doesn't
require fiddling with regionset.

Regards,
Christian

Loading...