LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Competent CLI DVD copy program? (https://www.linuxquestions.org/questions/linux-software-2/competent-cli-dvd-copy-program-946364/)

Nutria 05-22-2012 04:49 PM

Competent CLI DVD copy program?
 
Hi,

Distro is Ubuntu 12.04.

I copy my TV and movie DVDs to ISO files so as to have HandBrakeCLI rip away at them without having some GUI app eject a DVD 10 minutes after I go to sleep or head to work, thus doing nothing for hours and hours.

I've tried copying them using cat, dd (neither of which has error correction), readom (started throwing errors 1/2 way through) and readdvd (which silently hung 1/2 way through). No luck with any of them because of CSS encryption, even though readdvd decrypted the keys.

Brasero works great in GUI mode (but there's all that needless pointing and clicking), and is supposed to work in CLI mode, but I can't figure out the magic sauce to make it work.

So... any programs I've overlooked or ideas on how to make brasero work from the CLI?

TIA

teckk 05-23-2012 03:43 PM

Quote:

I copy my TV and movie DVDs
This is for TV or a DVD that you are legally allowed to copy.

lsdvd will show you the chapters on a DVD

Code:

mplayer dvd://1 -dumpstream -dumpfile outputfile.vob
Will dump title 1 to file which you can then save or encode.

Do a search on LQ or the web for
mplayer
ffmpeg
mencoder
lsdvd
libdvdcss

teckk 05-23-2012 04:21 PM

Reread your post

To make an .iso mount the DVD (UDF) and then use something like
Code:

dd if=/dev/sr0 of=output.iso bs=2048
or
Code:

mkisofs -R -J /dev/sr0 -o /path/to/output.iso
or
Code:

ddrescue –n –b 2048 /dev/sr0 output.iso
Use your own device nodes and syntax.

Nutria 05-23-2012 04:39 PM

Quote:

Originally Posted by teckk (Post 4685859)
Reread your post

To make an .iso mount the DVD (UDF) and then use something like
Code:

dd if=/dev/sr0 of=output.iso bs=2048

Barfs on CSS-encrypted disks.

Quote:

or
Code:

mkisofs -R -J /dev/sr0 -o /path/to/output.iso

Code:

$ mkisofs -R -J /dev/sr0 -o foo.iso
I: -input-charset not specified, using utf-8 (detected in locale settings)
genisoimage: No such file or directory. Invalid node - '-o'.

That's because mkisofs/genisoimage masters ISO images, not copies them.

Quote:

or
Code:

ddrescue –n –b 2048 /dev/sr0 output.iso
Use your own device nodes and syntax.
Code:

$ ddrescue –n –b 2048 /dev/sr0 output.iso
ddrescue: Too many files.
Try `ddrescue --help' for more information.

Anyway, it should barf on encrypted DVDs just as dd does.

TobiSGD 05-23-2012 05:15 PM

Neither dd nor ddrescue should "barf" on CSS-encrypted DVDs, since, as its name says CSS scrambles the content of the disk, not its filesystem. And even if the filesystem would be encrypted or damaged dd/ddrescue simply wouldn't care and copy it anyway.
It may be that there are other copy protections in place and it is not CSS that causes your issues.

By the way, "barfs" is in no way a sufficient error description, it may help to see which error-message you exactly get.

teckk 05-23-2012 06:07 PM

Try somethink like
Code:

dd if=/dev/sr0 of=dvd.iso bs=128 conv=notrunc,noerror
And we are talking about a DVD that is legal for you to copy. Not a copyrighted DVD. That would be a violation of LQ TOS.

Nutria 05-23-2012 06:10 PM

Quote:

Originally Posted by TobiSGD (Post 4685888)
Neither dd nor ddrescue should "barf" on CSS-encrypted DVDs, since, as its name says CSS scrambles the content of the disk, not its filesystem. And even if the filesystem would be encrypted or damaged dd/ddrescue simply wouldn't care and copy it anyway.

You'd think...
Code:

$ dd bs=2048 if=/dev/sr0 of=output.iso
dd: reading `/dev/sr0': Input/output error
73434+0 records in
73434+0 records out
150392832 bytes (150 MB) copied, 30.9552 s, 4.9 MB/s

ddrescue worked, but took forever. GUI brasero Just Worked.

Quote:

It may be that there are other copy protections in place and it is not CSS that causes your issues.
Doesn't appear to be the case, since brasero and dvdread go thru the whole "decrypting CSC keys" process.

Nutria 05-23-2012 07:04 PM

Quote:

Originally Posted by teckk (Post 4685926)
Try somethink like
Code:

dd if=/dev/sr0 of=dvd.iso bs=128 conv=notrunc,noerror

That completes successfully, writing out the correct number of bytes, but the sha1sum of the ISOs created by dd and brasero are different.

vlc seems to play the two ISOs the same, so maybe it's just some padding bits at the end.

Quote:

And we are talking about a DVD that is legal for you to copy. Not a copyrighted DVD. That would be a violation of LQ TOS.
I bought the DVD from Amazon, if that's what you mean.

TobiSGD 05-23-2012 07:15 PM

Quote:

Originally Posted by Nutria (Post 4685954)
I bought the DVD from Amazon, if that's what you mean.

That you bought the DVD does not mean that it is legal to copy it. This, of course, is dependent on the country you live in (in Germany it is for example illegal to circumvent any kind of copy-protection).

Nutria 05-23-2012 07:31 PM

Quote:

Originally Posted by Nutria (Post 4685954)
That completes successfully, writing out the correct number of bytes, but the sha1sum of the ISOs created by dd and brasero are different.

But on the other hand, the next disk I tried instantly started throwing errors:
Code:

$ dd bs=2048 if=/dev/sr0 of=SBSP_D9.iso conv=noerror
dd: reading `/dev/sr0': Input/output error
510+0 records in
510+0 records out
1044480 bytes (1.0 MB) copied, 0.407657 s, 2.6 MB/s
dd: reading `/dev/sr0': Input/output error
510+0 records in
510+0 records out
1044480 bytes (1.0 MB) copied, 0.476265 s, 2.2 MB/s
dd: reading `/dev/sr0': Input/output error
510+0 records in
510+0 records out
1044480 bytes (1.0 MB) copied, 0.551775 s, 1.9 MB/s
dd: reading `/dev/sr0': Input/output error
510+0 records in
510+0 records out
1044480 bytes (1.0 MB) copied, 0.575026 s, 1.8 MB/s
dd: reading `/dev/sr0': Input/output error
510+0 records in
510+0 records out
1044480 bytes (1.0 MB) copied, 0.620688 s, 1.7 MB/s
dd: reading `/dev/sr0': Input/output error
510+0 records in
510+0 records out
1044480 bytes (1.0 MB) copied, 0.643952 s, 1.6 MB/s
dd: reading `/dev/sr0': Input/output error
510+0 records in
510+0 records out
1044480 bytes (1.0 MB) copied, 0.689581 s, 1.5 MB/s
dd: reading `/dev/sr0': Input/output error
510+0 records in
510+0 records out
1044480 bytes (1.0 MB) copied, 0.71286 s, 1.5 MB/s
dd: reading `/dev/sr0': Input/output error
514+0 records in
514+0 records out
1052672 bytes (1.1 MB) copied, 0.770159 s, 1.4 MB/s
dd: reading `/dev/sr0': Input/output error
514+0 records in
514+0 records out
1052672 bytes (1.1 MB) copied, 0.8047 s, 1.3 MB/s
dd: reading `/dev/sr0': Input/output error
514+0 records in
514+0 records out
1052672 bytes (1.1 MB) copied, 0.850716 s, 1.2 MB/s
dd: reading `/dev/sr0': Input/output error
514+0 records in
514+0 records out
1052672 bytes (1.1 MB) copied, 0.908086 s, 1.2 MB/s
dd: reading `/dev/sr0': Input/output error
514+0 records in
514+0 records out
1052672 bytes (1.1 MB) copied, 0.965591 s, 1.1 MB/s
dd: reading `/dev/sr0': Input/output error
514+0 records in
514+0 records out
1052672 bytes (1.1 MB) copied, 1.02292 s, 1.0 MB/s
dd: reading `/dev/sr0': Input/output error
514+0 records in
514+0 records out
1052672 bytes (1.1 MB) copied, 1.07563 s, 979 kB/s
dd: reading `/dev/sr0': Input/output error

Naturally, brasero worked.

Wiser Slacker 08-16-2014 10:48 PM

Quote:

Originally Posted by TobiSGD (Post 4685959)
That you bought the DVD does not mean that it is legal to copy it. This, of course, is dependent on the country you live in (in Germany it is for example illegal to circumvent any kind of copy-protection).

You are wrong here ... and may have a look here:
https://de.wikipedia.org/wiki/Privat...ma.C3.9Fnahmen

how could a protection be "wirksam" ... lol

greetings

Nutria 08-16-2014 11:41 PM

Solution to DVD ripping with dd
 
Apparently, some DVDs need to be decrypted first. So, I run cli vlc first for 4 seconds, and then dd.

Code:

#!/bin/bash
cvlc :start-time=1 --stop-time=4 dvd:///dev/sr0 vlc://quit
BS=$(isoinfo -d -i /dev/sr0 | grep "^Logical block size is:" | awk '{print $5}')
VS=$(isoinfo -d -i /dev/sr0 | grep "^Volume size is:" | awk '{print $4}')
VSID=$(isoinfo -d -i /dev/sr0 | grep "Volume set id: " | awk '{print $4}')
VID=$(isoinfo -d -i /dev/sr0 | grep "^Volume id: " | awk '{print $3}')
if [ -z $1 ]; then
    if [ -z $VSID ] || [ "$VSID" == "UNDEFINED" ] || [ "$VSID" == "NOT_SET" ] || [ $VID == $VSID ] ; then
        OF=${VID}
    else
        OF=${VID}_${VSID}
    fi
    ls -1 $OF.iso &> /dev/null
    rc=$?
    if [ $rc -eq 0 ]; then echo -e "\n\nFile already exists\n"; exit; fi
else
    OF=$(basename $1 .iso) # just in case I accidentally pasted in a name with .iso
fi
pv /dev/sr0 | dd conv=noerror bs=$BS count=$VS of=$OF.iso
sleep 3
eject /dev/sr0


273 08-17-2014 05:49 AM

I have found this problem in the past when ripping DVDs to my hard drive using dd or dcfldd. Does anyone know a way around this without having to open the DVD in VLC or similar before ripping? It's quite tiresome when ripping a box-set for example.

Nutria 08-17-2014 09:27 AM

Quote:

Originally Posted by 273 (Post 5222394)
Does anyone know a way around this without having to open the DVD in VLC or similar before ripping? It's quite tiresome when ripping a box-set for example.

That's the beauty of "cvlc :start-time=1 --stop-time=4": it does the opening and closing of vlc for you.

273 08-17-2014 09:37 AM

Quote:

Originally Posted by Nutria (Post 5222435)
That's the beauty of "cvlc :start-time=1 --stop-time=4": it does the opening and closing of vlc for you.

Ah, thanks, I missed the simplicity there. next time I buy some DVDs I'll be ready.


All times are GMT -5. The time now is 12:10 PM.