LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices



Reply
 
Search this Thread
Old 05-22-2012, 05:49 PM   #1
Nutria
Member
 
Registered: Nov 2007
Location: New Orleans, LA, USA
Distribution: Xubuntu
Posts: 65

Rep: Reputation: 6
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
 
Old 05-23-2012, 04:43 PM   #2
teckk
Senior Member
 
Registered: Oct 2004
Distribution: FreeBSD Arch
Posts: 1,773

Rep: Reputation: 197Reputation: 197
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
 
1 members found this post helpful.
Old 05-23-2012, 05:21 PM   #3
teckk
Senior Member
 
Registered: Oct 2004
Distribution: FreeBSD Arch
Posts: 1,773

Rep: Reputation: 197Reputation: 197
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.

Last edited by teckk; 05-23-2012 at 05:22 PM.
 
1 members found this post helpful.
Old 05-23-2012, 05:39 PM   #4
Nutria
Member
 
Registered: Nov 2007
Location: New Orleans, LA, USA
Distribution: Xubuntu
Posts: 65

Original Poster
Rep: Reputation: 6
Quote:
Originally Posted by teckk View Post
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.
 
Old 05-23-2012, 06:15 PM   #5
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,653
Blog Entries: 2

Rep: Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095
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.

Last edited by TobiSGD; 05-23-2012 at 06:23 PM.
 
Old 05-23-2012, 07:07 PM   #6
teckk
Senior Member
 
Registered: Oct 2004
Distribution: FreeBSD Arch
Posts: 1,773

Rep: Reputation: 197Reputation: 197
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.
 
Old 05-23-2012, 07:10 PM   #7
Nutria
Member
 
Registered: Nov 2007
Location: New Orleans, LA, USA
Distribution: Xubuntu
Posts: 65

Original Poster
Rep: Reputation: 6
Quote:
Originally Posted by TobiSGD View Post
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.
 
Old 05-23-2012, 08:04 PM   #8
Nutria
Member
 
Registered: Nov 2007
Location: New Orleans, LA, USA
Distribution: Xubuntu
Posts: 65

Original Poster
Rep: Reputation: 6
Quote:
Originally Posted by teckk View Post
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.
 
Old 05-23-2012, 08:15 PM   #9
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,653
Blog Entries: 2

Rep: Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095
Quote:
Originally Posted by Nutria View Post
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).
 
Old 05-23-2012, 08:31 PM   #10
Nutria
Member
 
Registered: Nov 2007
Location: New Orleans, LA, USA
Distribution: Xubuntu
Posts: 65

Original Poster
Rep: Reputation: 6
Quote:
Originally Posted by Nutria View Post
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.
 
Old 08-16-2014, 11:48 PM   #11
Wiser Slacker
LQ Newbie
 
Registered: May 2014
Location: germany
Distribution: slackware x86_64 , arm
Posts: 4

Rep: Reputation: Disabled
Quote:
Originally Posted by TobiSGD View Post
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
 
Old 08-17-2014, 12:41 AM   #12
Nutria
Member
 
Registered: Nov 2007
Location: New Orleans, LA, USA
Distribution: Xubuntu
Posts: 65

Original Poster
Rep: Reputation: 6
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

Last edited by Nutria; 08-17-2014 at 10:43 AM.
 
Old 08-17-2014, 06:49 AM   #13
273
Senior Member
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 3,571

Rep: Reputation: 805Reputation: 805Reputation: 805Reputation: 805Reputation: 805Reputation: 805Reputation: 805
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.
 
Old 08-17-2014, 10:27 AM   #14
Nutria
Member
 
Registered: Nov 2007
Location: New Orleans, LA, USA
Distribution: Xubuntu
Posts: 65

Original Poster
Rep: Reputation: 6
Quote:
Originally Posted by 273 View Post
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.
 
1 members found this post helpful.
Old 08-17-2014, 10:37 AM   #15
273
Senior Member
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 3,571

Rep: Reputation: 805Reputation: 805Reputation: 805Reputation: 805Reputation: 805Reputation: 805Reputation: 805
Quote:
Originally Posted by Nutria View Post
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.
 
  


Reply

Tags
cli, copy, dvd


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
open source dvd/cd copy program? burning on the fly program? vieya Linux - Software 3 12-14-2009 10:16 PM
Any program to copy newer dvd's (Mr. Woodcock) kryptobs2000 Linux - Software 3 01-24-2008 08:07 PM
CLI copy files by date linuxhippy Slackware 2 06-23-2006 10:01 PM
CLI copy is greater than GUI copy ?? 0_o killahsmurf Slackware 14 01-04-2006 12:53 PM


All times are GMT -5. The time now is 09:19 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration