LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Desktop (http://www.linuxquestions.org/questions/linux-desktop-74/)
-   -   dd of a DVD fails unless I first view it with VLC (http://www.linuxquestions.org/questions/linux-desktop-74/dd-of-a-dvd-fails-unless-i-first-view-it-with-vlc-4175459061/)

Nutria 04-21-2013 10:37 PM

dd of a DVD fails unless I first view it with VLC
 
Hi,

When I buy a DVD, I immediately rip it to an ISO, then transcode the movie or episodes because that's faster than having HandBrake read directly from DVD.

The problem is that dd quickly barfs with an IO error when reading protected DVDs except when I first view (even for just a few seconds) the DVD with vlc. Then dd works perfectly. Presumably this has something to do with reading the CSS keys.

So, does anyone know of a CLI tool that will read the CSS keys and place the results in ~/dvdcss ?

Thanks.

ozanbaba 04-22-2013 02:13 AM

how about cvlc? It's CLI to vlc.

Nutria 04-22-2013 02:38 AM

Quote:

Originally Posted by ozanbaba (Post 4936226)
how about cvlc? It's CLI to vlc.

Excellent!

This is what my ripping script now looks like:
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
else
    OF=$(basename $1 .iso) # just in case I accidentally pasted in a name with .iso
fi

echo $OF
echo $BS
echo $VS

pv /dev/sr0 | dd conv=noerror bs=$BS count=$VS of=$OF.iso

sleep 3
eject /dev/sr0



All times are GMT -5. The time now is 02:16 PM.