How to check if DVD uses CSS copy protection

For questions and discussion that is NOT (I repeat NOT) specific to a certain Operating System.
mivk
New Cone
New Cone
Posts: 7
Joined: 13 Jun 2017 16:44

How to check if DVD uses CSS copy protection

Postby mivk » 22 Jul 2019 19:25

I regularly need to convert DVDs for various purposes. Most are not encrypted, so I can just copy the .VOB files and convert them with ffmpeg. But some DVDs use CSS copy protection, and I realize it only after doing all the transcoding.

Is there a quick and easy way in VLC to find out if a DVD uses CSS?

There is code in VLC which does check that, but I don't really know C or C++, so I'm not able to extract and rewrap it into a simple "csscheck" command-line tool.

mivk
New Cone
New Cone
Posts: 7
Joined: 13 Jun 2017 16:44

Re: How to check if DVD uses CSS copy protection

Postby mivk » 26 Jul 2019 13:44

Well it seems I just have to try playing a single VOB instead of the whole DVD or DVD-folder. The scrambling is immediately visible. For some reason, I had he impression that VLC would also de-CSS a single VOB, but apparently it doesn't.

Before realizing that, I had made a Perl script which seems to correctly detect it too, so here it is in case it's useful to someone:

Code: Select all

#!/usr/bin/perl my $VERSION=0.02; my $sector_size = 2048; my $count = 1000; use strict; use autodie; my $file = shift; die "Not found: $file\n" unless (-f $file); if (-s $file < $count * $sector_size) { $count = int( (-s $file)/$sector_size ); warn "File too small. Checking $count sectors only ($file)\n"; } my $protected = 0; open my $fh, '<:raw', $file; for (my $s=0; $s<$count; $s++) { my $bytes_read = read($fh, my $bytes, $sector_size); die "Got $bytes_read but expected $sector_size from $file\n" unless ($bytes_read == $sector_size); my @sectors = unpack("C*", $bytes); if ( ($sectors[ ($sectors[13] & 7)+20 ] & 48) != 0 ) { $protected++; } } if ($protected) { print "CSS-protected (on $protected of $count sectors) : $file\n"; } else { print "NOT protected : $file\n"; }


Return to “General VLC media player Troubleshooting”

Who is online

Users browsing this forum: No registered users and 51 guests