Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Ripping DVDs
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
lars_the_bear
Tux's lil' helper
Tux's lil' helper


Joined: 05 Jun 2024
Posts: 128

PostPosted: Fri Jun 21, 2024 12:52 pm    Post subject: Ripping DVDs Reply with quote

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
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 21977

PostPosted: Fri Jun 21, 2024 12:58 pm    Post subject: Reply with quote

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
View user's profile Send private message
RumpletonBongworth
n00b
n00b


Joined: 17 Jun 2024
Posts: 60

PostPosted: Fri Jun 21, 2024 1:02 pm    Post subject: Re: Ripping DVDs Reply with quote

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
View user's profile Send private message
eeckwrk99
Apprentice
Apprentice


Joined: 14 Mar 2021
Posts: 184
Location: Gentoo forums

PostPosted: Fri Jun 21, 2024 1:08 pm    Post subject: Reply with quote

media-video/mkvtoolnix (ensure to have "dvd" USE flag enabled) is another option.
Back to top
View user's profile Send private message
pa4wdh
l33t
l33t


Joined: 16 Dec 2005
Posts: 817

PostPosted: Fri Jun 21, 2024 3:35 pm    Post subject: Reply with quote

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
View user's profile Send private message
ormorph
n00b
n00b


Joined: 18 Jun 2024
Posts: 16

PostPosted: Fri Jun 21, 2024 5:10 pm    Post subject: Reply with quote

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
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54484
Location: 56N 3W

PostPosted: Fri Jun 21, 2024 5:54 pm    Post subject: Reply with quote

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
View user's profile Send private message
lars_the_bear
Tux's lil' helper
Tux's lil' helper


Joined: 05 Jun 2024
Posts: 128

PostPosted: Fri Jun 21, 2024 6:11 pm    Post subject: Reply with quote

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
View user's profile Send private message
Ralphred
Guru
Guru


Joined: 31 Dec 2013
Posts: 535

PostPosted: Sat Jun 22, 2024 2:23 am    Post subject: Reply with quote

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
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54484
Location: 56N 3W

PostPosted: Sat Jun 22, 2024 11:01 am    Post subject: Reply with quote

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
View user's profile Send private message
lars_the_bear
Tux's lil' helper
Tux's lil' helper


Joined: 05 Jun 2024
Posts: 128

PostPosted: Sat Jun 22, 2024 12:33 pm    Post subject: Reply with quote

Thanks, all.

BR, Lars.
Back to top
View user's profile Send private message
xaviermiller
Bodhisattva
Bodhisattva


Joined: 23 Jul 2004
Posts: 8713
Location: ~Brussels - Belgique

PostPosted: Sun Jun 23, 2024 6:42 pm    Post subject: Reply with quote

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
View user's profile Send private message
RumpletonBongworth
n00b
n00b


Joined: 17 Jun 2024
Posts: 60

PostPosted: Mon Jun 24, 2024 2:04 pm    Post subject: Reply with quote

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
View user's profile Send private message
xaviermiller
Bodhisattva
Bodhisattva


Joined: 23 Jul 2004
Posts: 8713
Location: ~Brussels - Belgique

PostPosted: Mon Jun 24, 2024 4:44 pm    Post subject: Reply with quote

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
View user's profile Send private message
Cygon
Tux's lil' helper
Tux's lil' helper


Joined: 05 Feb 2006
Posts: 114
Location: Germany

PostPosted: Thu Jun 27, 2024 9:03 am    Post subject: Re: Ripping DVDs Reply with quote

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
View user's profile Send private message
vasettoo
Tux's lil' helper
Tux's lil' helper


Joined: 11 Nov 2012
Posts: 100

PostPosted: Thu Jun 27, 2024 12:52 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum