Difference between revisions of "Extract DVD"

From Maze's wiki
Jump to: navigation, search
Line 18: Line 18:
 
First write the video stream to the harddrive so the next steps will go faster. Also remember the aid and sid for audio and subtitles.
 
First write the video stream to the harddrive so the next steps will go faster. Also remember the aid and sid for audio and subtitles.
 
<pre>
 
<pre>
mplayer dvd://1 -v -dumpstream -dumpfile <title>.vob
+
cat /dev/dvd > <title>.iso
 
</pre>
 
</pre>
  
 
Now extract audio from the stream. Just use AC3.
 
Now extract audio from the stream. Just use AC3.
 
<pre>
 
<pre>
mplayer <title>.vob -aid <aid> -dumpaudio -dumpfile <title>.ac3
+
mplayer <title>.iso -aid <aid> -dumpaudio -dumpfile <title>.ac3
 
</pre>
 
</pre>
  
 
Now extract the subtitles from the stream.
 
Now extract the subtitles from the stream.
 
<pre>
 
<pre>
mencoder <title>.vob -ovc raw -o /dev/null -nosound -sid <sid> -vobsubout <title>
+
mencoder <title>.iso -ovc raw -o /dev/null -nosound -sid <sid> -vobsubout <title>
 
</pre>
 
</pre>
  
 
Detect the amount to crop. Keep it running till it is stable for a while
 
Detect the amount to crop. Keep it running till it is stable for a while
 
<pre>
 
<pre>
mplayer <title>.vob -vf cropdetect
+
mplayer <title>.iso -vf cropdetect
 
</pre>
 
</pre>
  
 
Run the first pass on the video
 
Run the first pass on the video
 
<pre>
 
<pre>
mencoder -v <title>.vob -vf <cropvalues> -ovc x264 -x264encopts pass=1:bitrate=1000 -nosound -nosub -noautosub -of rawvideo -o <title>.264
+
mencoder -v <title>.iso -vf <cropvalues> -ovc x264 -x264encopts pass=1:bitrate=1000 -nosound -nosub -noautosub -of rawvideo -o <title>.264
 
</pre>
 
</pre>
  
 
Run the second pass on the video
 
Run the second pass on the video
 
<pre>
 
<pre>
mencoder -v <title>.vob -vf <cropvalues> -ovc x264 -x264encopts pass=2:bitrate=1000 -nosound -nosub -noautosub -of rawvideo -o <title>.264
+
mencoder -v <title>.iso -vf <cropvalues> -ovc x264 -x264encopts pass=2:bitrate=1000 -nosound -nosub -noautosub -of rawvideo -o <title>.264
 
</pre>
 
</pre>
  

Revision as of 19:55, 12 March 2012

This describes how to convert a DVD to mkv using:

  • x264 for video
  • ac3 for audio
  • any subtitles

Install the packages

apt-get install mencoder mplayer gpac mkvtoolnix

For using encrypted DVDs build and install libdvdcss from http://download.videolan.org/pub/libdvdcss/last

./configure --prefix=/usr
make
make install

First write the video stream to the harddrive so the next steps will go faster. Also remember the aid and sid for audio and subtitles.

cat /dev/dvd > <title>.iso

Now extract audio from the stream. Just use AC3.

mplayer <title>.iso -aid <aid> -dumpaudio -dumpfile <title>.ac3

Now extract the subtitles from the stream.

mencoder <title>.iso -ovc raw -o /dev/null -nosound -sid <sid> -vobsubout <title>

Detect the amount to crop. Keep it running till it is stable for a while

mplayer <title>.iso -vf cropdetect

Run the first pass on the video

mencoder -v <title>.iso -vf <cropvalues> -ovc x264 -x264encopts pass=1:bitrate=1000 -nosound -nosub -noautosub -of rawvideo -o <title>.264

Run the second pass on the video

mencoder -v <title>.iso -vf <cropvalues> -ovc x264 -x264encopts pass=2:bitrate=1000 -nosound -nosub -noautosub -of rawvideo -o <title>.264

Put the video in a MP4 container

MP4Box -add <title>.264 <title>.mp4

Combine everything in a mkv container

mkvmerge -o <title>.mkv <title>.ac3 <title>.idx <title>.mp4