View previous topic :: View next topic |
Author |
Message |
lars_the_bear Guru
Joined: 05 Jun 2024 Posts: 522
|
Posted: Fri Jun 21, 2024 12:52 pm Post subject: Ripping DVDs |
|
|
Hi folks
Handbrake segfaults when I try to rip a commercial DVD. It displays the chapter/title information but, as soon as its asked to encode anything, it crashes immediately. I tried to get a backtrace from gdb but, with no debug symbols, it's not particularly meaningful.
I don't suppose this problem is fixable, so my question is:
What other options are available, for ripping a commercial DVD? ffmpeg will read the DVD, but it doesn't support CSS, so I just get garbage. VLC does rip the DVD, but the resulting video file has a weird aspect ratio. That, at least, is fixable, given enough time.
What else is there?
BR, Lars. |
|
Back to top |
|
|
Hu Administrator
Joined: 06 Mar 2007 Posts: 22686
|
Posted: Fri Jun 21, 2024 12:58 pm Post subject: |
|
|
Generally, DVDs that are not encumbered by anti-copying technology should be pretty easy to rip. DVDs that are encumbered by anti-copying technology are often backed up by ill considered legislation that makes it outright illegal to rip them. Many commercial DVDs are encumbered. If you can reproduce the failure on a DVD that the vendor did not intentionally cripple by addition of anti-copying technology, that would be worth investigating. If the vendor doesn't want you reading it, then I suggest seeking a refund for the defective-by-design product. |
|
Back to top |
|
|
RumpletonBongworth Tux's lil' helper
Joined: 17 Jun 2024 Posts: 82
|
Posted: Fri Jun 21, 2024 1:02 pm Post subject: Re: Ripping DVDs |
|
|
lars_the_bear wrote: | What else is there? |
I would suggest trying MakeMKV. The downside is that its proprietary. However, it is good at what it does. Note that it doesn't do any transcoding. Rather, the selected streams will be muxed into a Matroska file exactly as they are. You could transcode the file and its streams thereafter, should you need to. |
|
Back to top |
|
|
eeckwrk99 Apprentice
Joined: 14 Mar 2021 Posts: 232 Location: Gentoo forums
|
Posted: Fri Jun 21, 2024 1:08 pm Post subject: |
|
|
media-video/mkvtoolnix (ensure to have "dvd" USE flag enabled) is another option. |
|
Back to top |
|
|
pa4wdh l33t
Joined: 16 Dec 2005 Posts: 883
|
Posted: Fri Jun 21, 2024 3:35 pm Post subject: |
|
|
I'm using a shell script i wrote (using dvdbackup and dd).
Basically it uses dvdbackup to deal with CSS, after that it's plain dd doing the copying work. The result is an ISO file which is an exact copy of the disk (including protections). I've used it to copy some old/damaged DVD's to save them before they died completely.
This is the script:
Code: |
#!/bin/sh
DEV="$1"
ISO="$2"
if [ -z "$DEV" -o -z "$ISO" ]
then
echo "Usage: $0 <device> <iso>"
exit 1
fi
if [ ! -r "$DEV" ]
then
echo "Device $DEV not readable"
exit 1
fi
if [ -r "$ISO" ]
then
echo "File $ISO already exists"
exit 1
fi
quit()
{
kill $PID
exit
}
dvdbackup -I -i "$DEV"
trap quit SIGTERM SIGQUIT SIGINT
dd if="$DEV" of="$ISO" &
PID=$!
sleep 1
while [ -d "/proc/$PID" ]
do
kill -USR1 $PID
sleep 30
done
|
_________________ The gentoo way of bringing peace to the world:
USE="-war" emerge --newuse @world
My shared code repository: https://code.pa4wdh.nl.eu.org
Music, Free as in Freedom: https://www.jamendo.com |
|
Back to top |
|
|
ormorph n00b
Joined: 18 Jun 2024 Posts: 27
|
Posted: Fri Jun 21, 2024 5:10 pm Post subject: |
|
|
Code: | # emerge media-video/dvdauthor |
Code: | $ mkdir /<path>/dir
$ cd /<path>/dir
$ dvdunauthor /dev/cdrom |
Then you can convert the resulting video files using ffmpeg or something else. These files will already be played by the player, since they are in mpeg-2 format. |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54578 Location: 56N 3W
|
Posted: Fri Jun 21, 2024 5:54 pm Post subject: |
|
|
lars_the_bear,
I like mplayer.
You cannot rip a DVD by attempting to mount the filesystem it contains. then reading that. The filisystem contains deliberately corrupt blocks, among other things.
DVDs are played/ripped much like CD-DA, using block lists.
DVD player/ripping applications know this and normally do not mount the DVD filesystem. They don't use it anyway. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
lars_the_bear Guru
Joined: 05 Jun 2024 Posts: 522
|
Posted: Fri Jun 21, 2024 6:11 pm Post subject: |
|
|
Hi folks
Thanks for the suggestions. They all look a bit complicated compared to Handbrake, which is just point-and-click simple. I only rip a DVD about once every two years, so I'd really like it to be easy.
I should point out that commercial DVDs in my region are invariably encrypted. At least, I've never seen one that isn't. There seems to be a 'css' USE flag that enables support for DVD decryption, but I don't know what it actually does. I think the binary version of Handbrake has it enabled, anyway. And VLC plays the DVD just fine. I don't think the problem is encryption, anyway. ffmeg can't play the DVD, but it doesn't crash, but just generates rubbish. Handbrake just crashes, and very quickly.
Given how rarely I do this, I think the quickest way would be to boot Federa from a live USB stick, and run Handbrake there. Shame it doesn't work in Gentoo, but I guess I can't have everything.
BR, Lars. |
|
Back to top |
|
|
Ralphred l33t
Joined: 31 Dec 2013 Posts: 654
|
Posted: Sat Jun 22, 2024 2:23 am Post subject: |
|
|
lars_the_bear wrote: | There seems to be a 'css' USE flag that enables support for DVD decryption, but I don't know what it actually does. |
There is a package called libdvdcss that handles the decryption, css use flag usually enables support for that.
I had to do this recently and I defaulted to mencoder because the oac/ovc copy switches let me just dump the DVD chapters to disk, then I sorted out the rest in kdenlive because the profiles are already set-up and I'm too lazy to read the ffmpeg man page again.
DVD ripping/authoring was always such a chore, and going back and doing it again reminded me very quickly why I plugged the computer into the TV set all those years ago. |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54578 Location: 56N 3W
|
Posted: Sat Jun 22, 2024 11:01 am Post subject: |
|
|
lars_the_bear,
man mplayer: | -dumpaudio (MPlayer only)
Dumps raw compressed audio stream to ./stream.dump (useful with
MPEG/AC-3, in most other cases the resulting file will not be
playable). If you give more than one of -dumpaudio, -dumpvideo,
-dumpstream on the command line only the last one will work.
-dumpfile <filename> (MPlayer only)
Specify which file MPlayer should dump to. Should be used to‐
gether with -dumpaudio / -dumpvideo / -dumpstream / -capture.
-dumpstream (MPlayer only)
Dumps the raw stream to ./stream.dump. Useful when ripping from
DVD or network. If you give more than one of -dumpaudio,
-dumpvideo, -dumpstream on the command line only the last one
will work.
-dumpvideo (MPlayer only)
Dump raw compressed video stream to ./stream.dump (not very us‐
able). If you give more than one of -dumpaudio, -dumpvideo,
-dumpstream on the command line only the last one will work.
|
Code: | mplayer -dumpstream -dumpfile </path/to/.vob ... | looks good.
This will give you a region free capture of the dvd object you ask for in the ... part of the command.
You will see libdecss in action too. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
lars_the_bear Guru
Joined: 05 Jun 2024 Posts: 522
|
Posted: Sat Jun 22, 2024 12:33 pm Post subject: |
|
|
Thanks, all.
BR, Lars. |
|
Back to top |
|
|
xaviermiller Bodhisattva
Joined: 23 Jul 2004 Posts: 8718 Location: ~Brussels - Belgique
|
Posted: Sun Jun 23, 2024 6:42 pm Post subject: |
|
|
Hi!
I use this command to extract a DVD to a mkv container:
Code: | output_dir=[some output dir, based on DVD title]
mkdir -pv $output_dir
makemkvcon --progress=-same --decrypt mkv disc:0 all "$ouput_dir" |
and then FFMPEG to compress to some more decent codec
Code: | ffmpeg \
-i "$infile" \
-map 0 \
-vf yadif \
-codec:v libx264 -crf 18 \
-codec:a libmp3lame -qscale:a 2 \
-codec:s copy \
"$outfile"
|
and to define an output folder Code: | DVD_TITLE=$(for i in $(blkid /dev/sr0 -o value -s LABEL | tr '_' ' ' | tr '[:upper:]' '[:lower:]'); do B=$(echo "${i:0:1}" | tr '[:lower:]' '[:upper:]' )${i:1}; echo -n "$B "; done | sed -e 's/ $//' -e 's/ / /g' -e 's/ / /g') |
_________________ Kind regards,
Xavier Miller |
|
Back to top |
|
|
RumpletonBongworth Tux's lil' helper
Joined: 17 Jun 2024 Posts: 82
|
Posted: Mon Jun 24, 2024 2:04 pm Post subject: |
|
|
xaviermiller wrote: | and to define an output folder Code: | DVD_TITLE=$(for i in $(blkid /dev/sr0 -o value -s LABEL | tr '_' ' ' | tr '[:upper:]' '[:lower:]'); do B=$(echo "${i:0:1}" | tr '[:lower:]' '[:upper:]' )${i:1}; echo -n "$B "; done | sed -e 's/ $//' -e 's/ / /g' -e 's/ / /g') |
|
Assuming bash, I would write this as:
Code: | read -ra words < <(blkid /dev/sr0 -o value -s LABEL | tr _ ' ')
words=("${words[@],,}")
DVD_TITLE=${words[*]^} |
This also eliminates the bug of considering each word as a candidate for pathname expansion. |
|
Back to top |
|
|
xaviermiller Bodhisattva
Joined: 23 Jul 2004 Posts: 8718 Location: ~Brussels - Belgique
|
Posted: Mon Jun 24, 2024 4:44 pm Post subject: |
|
|
RumpletonBongworth wrote: | xaviermiller wrote: | and to define an output folder Code: | DVD_TITLE=$(for i in $(blkid /dev/sr0 -o value -s LABEL | tr '_' ' ' | tr '[:upper:]' '[:lower:]'); do B=$(echo "${i:0:1}" | tr '[:lower:]' '[:upper:]' )${i:1}; echo -n "$B "; done | sed -e 's/ $//' -e 's/ / /g' -e 's/ / /g') |
|
Assuming bash, I would write this as:
Code: | read -ra words < <(blkid /dev/sr0 -o value -s LABEL | tr _ ' ')
words=("${words[@],,}")
DVD_TITLE=${words[*]^} |
This also eliminates the bug of considering each word as a candidate for pathname expansion. |
Thanks, I am not a script guru, I will test it _________________ Kind regards,
Xavier Miller |
|
Back to top |
|
|
Cygon Tux's lil' helper
Joined: 05 Feb 2006 Posts: 115 Location: Germany
|
Posted: Thu Jun 27, 2024 9:03 am Post subject: Re: Ripping DVDs |
|
|
RumpletonBongworth wrote: | lars_the_bear wrote: | What else is there? |
I would suggest trying MakeMKV. The downside is that its proprietary. However, it is good at what it does. |
I'd like to second that suggestion.
While the name might not give it away, MakeMKV is the go-to DVD and Blu-Ray ripper nowadays. It extracts the original video and audio data, untouched, from a disc and stores it in an .mkv file, completely preserving all its properties (like interlacing metadata, multi-view, VFR etc.) that you might require for further processing (i.e. VapourSynth + QTGMC) or to achieve the best possible encode in Handbrake.
MakeMKV is not Open Source, but its DVD ripping functionality is completely free (the Blu-Ray part inconveniences you by requiring a time-limited license key that is posted about once every month by the developer on his forum).
Last edited by Cygon on Thu Jun 27, 2024 12:52 pm; edited 1 time in total |
|
Back to top |
|
|
vasettoo Tux's lil' helper
Joined: 11 Nov 2012 Posts: 100
|
Posted: Thu Jun 27, 2024 12:52 pm Post subject: |
|
|
To add it to the OP before me - MakeMKV is the way to go when ripping and more importantly copying encrypted Blu-Ray discs. You don't have to worry about AACS protection because every three months there's a new license key published on app's forum and you just need to keep updated KEYDB.cfg whenever beating encyption fails. Recently my case was about fairly new edition copy protected Blu-Ray disc which I succesfully ripped, a.k.a. made remux of it and fully copied into folder structure with menus on my Gentoo - plays just fine as .mkv file (remux) and as Blu-Ray folder with menu navigation. Mind you, the appropriate USE flags for media-libs/libbluray need to be present - such as 'aacs' and 'bdplus'.
MakeMKV is a no brainer to use in the scenario where copy protection is present. |
|
Back to top |
|
|
|