[MPlayer-users] Can I get a few tips on DVD ripping?

Miriam English mim at miriam-english.org
Fri Sep 8 16:18:35 EEST 2017


Hi Rui,

I always rip my DVDs to my computer as soon as I buy them. The plastic 
they make DVDs out of is so easily scratched I like to play them just 
the one time, in ripping them to the computer. Then I put them away in 
my DVD case to be taken out again only if the hard drive gets damaged 
and my ripped video corrupted.

You don't need dvdnav:// as that's used for showing the DVD menus. 
Simply dvd:// is sufficient. Also the video will rip as a vob file, not 
as an iso file.

If the track I want is track 2 then I use:
mplayer dvd://2 -dumpstream -dumpfile videoname.vob


I used to use mencoder (part of the mplayer package) to encode videos, 
but now I prefer ffmpeg. Here is the way I used to encode a video using 
mencoder.

Originally I used to use mplayer to find the width and height of the video

mplayer "$F_NAME.vob" -benchmark -nosound -vo null -endpos 1

but I ended up writing a script that extracted the width and height 
automatically for me and inserted those values into the mencoder command:

width=`mplayer "$1.vob" -benchmark -nosound -vo null -endpos 1 
2>/dev/null | grep '=>' | cut -d' ' -f5 | cut -dx -f1 | tail -n1`
height=`mplayer "$1.vob" -benchmark -nosound -vo null -endpos 1 
2>/dev/null | grep '=>' | cut -d' ' -f5 | cut -dx -f2 | tail -n1`
mencoder "$1.vob" -ovc lavc -lavcopts 
vcodec=mpeg4:vbitrate=$bitrate:v4mv:mbd=2:trell -vf 
scale=$width:$height,hqdn3d=2:1:2 -aid $audio -nosub -audio-delay -0.2 
-oac mp3lame -lameopts vbr=3 -o "$1.avi"

For $bitrate I used 1600 for most videos, but 1800 or 2000 for fast 
action. I always meant to get around to learning how to do two-pass 
encodings so that mplayer would work out the optimum bitrates, but I 
never seemed to have enough time.
Of course $audio was usually 128, though many times would be a different 
value.
I found that my videos often had a slight sound mismatch so added 
-audio-delay -0.2 to fix that.


Once the video is ripped it contains all the audio tracks associated 
with it, so if you want to extract that (perhaps as a commentary track) 
then you could get it from the vob file. No need to fetch it off the DVD 
again.

If the audio ID is 128:

mplayer "videoname.vob" -aid 128 -ao pcm:file="videoname.wav" -vc null 
-vo null

You could then convert it to mp3 using lame:

lame --vbr-new -V 3 "videoname.wav" "videoname.mp3"

You could then play the video with the separate commentary audio file:

mplayer "videoname.avi" -audiofile "videoname.mp3"  -msglevel all=-1

(The -msglevel all=-1 just suppresses error messages.)

One of the reasons I now use ffmpeg is that I can easily encode a video 
with multiple soundtracks in the one file. That's probably possible with 
mencoder, but I never learned how.


Subtitles are a little trickier. I only know of a way to use mencoder to 
rip them. If the subtitle you want to rip is subtitle (sid) 0, which is 
usually the English soundtrack, and the dvd title is title 1:

mencoder dvd://1 -ovc copy -oac copy -vobsubout "videoname" 
-vobsuboutindex 0 -sid 0 -nosound -o /dev/null -vf harddup

I can't remember why I added the filter -vf harddup


A quick way to find out important info about a video file is to put this 
in a script:

     mplayer "$1" -v -ao null -vo null -frames 0 2>/dev/null | grep 
"audio codec:"
     mplayer "$1" -v -ao null -vo null -frames 0 2>/dev/null | grep "VIDEO:"
     mplayer "$1" -benchmark -nosound -vo null -endpos 1 2>/dev/null | 
grep "=>"
     mplayer "$1" -v -ao null -vo null -frames 0 2>/dev/null | grep "==>"
     echo

Where $1 is the name of the video file passed to the script .


You can convert the titles to the much better (in my opinion) format 
.srt subtitles using vobsub2srt, which you can download from
https://github.com/ruediger/VobSub2SRT
It uses the free, excellent OCR (optical character recognition) program 
"tesseract" to go through the subtitles and write them as text along 
with timing info to a .srt file. Unfortunately, even though tesseract is 
getting better and better it still makes a lot of dumb errors on the 
subtitles. I find it's much easier and often better to go to one of the 
subtitle archives on the net, such as http://subscene.com/ and search 
for the DVD I've bought. This is particularly useful if the DVD doesn't 
have subtitles. As I'm getting very deaf I find I can no longer watch 
movies without subtitles.

I hope this helps.

     - Miriam



Rui Correia wrote:
> Hello,
> I have quite a few legally owned Disney DVD's that I would like to rip so
> that my daughter can watch them on her tablet and avoid scratching the DVD
> discs. If I wanted anything to do with piracy I would download the torrent
> or whatever. ;-)
> My NAS runs Linux Debian (OpenMediaVault) and it has a DVD recorder on it
> that I would like to use for ripping. Being a NAS, it doesn't have a GUI
> (X11/Wayland) so I have to try and achieve this all on the CLI. Hence why I
> am trying Mplayer for this task.
> I'm only interested in the main movie, with two audio languages (my native
> and English) and my native language subtitles for when watching it in
> English audio. Also I'd like to retain chapter timecodes and to
> containerize inside a MP4/MKV file that will be shared on the LAN through
> the NAS.
>
>  From what I understand, I can use MPlayer for most of it.
> I've taken note of a few MPlayer commands that I found to grab stuff that I
> will be needing.
>
> For getting information about the audio track, subtitle tracks and chapters:
> $ mplayer dvdnav://1 -identify -dvd-device ~/name_of_movie.iso
>
> For ripping the video:
> $ mplayer dvdnav://1 -dumpvideo -dumpfile name_of_movie.m2v -dvd-device
> ~/name_of_movie.iso
>
> For ripping the audio track 128:
> $ mplayer dvdnav://1 -dumpaudio -aid 128 -dumpfile name_of_movie.ac3
> -dvd-device ~/name_of_movie.iso
>
> My questions:
> - Are the above the best options getting info, ripping video and ripping
> audio?
> - How can I dump subtitles?
>
> Thanks in advance,
>
> Cheers
> _______________________________________________
> MPlayer-users mailing list
> MPlayer-users at mplayerhq.hu
> https://lists.mplayerhq.hu/mailman/listinfo/mplayer-users

-- 
There are two wolves and they're always fighting.
One is darkness and despair. The other is light and hope.
Which wolf wins?
Whichever one you feed.
  -- Casey in Brad Bird's movie "Tomorrowland"



More information about the MPlayer-users mailing list