Difference between revisions of "Extract DVD"

From Maze's wiki
Jump to: navigation, search
(Video)
Line 30: Line 30:
 
Some VOB files report the wrong duration so just in case rebuild the vob file but only with the required videostream and audiostream.
 
Some VOB files report the wrong duration so just in case rebuild the vob file but only with the required videostream and audiostream.
 
<pre>
 
<pre>
avconv -i <title><stream>.vob -map 0:<videostream> -c:v copy -an -sn <title>.vob
+
avconv -i <title><stream>.vob -map 0:<videostream> -c:v copy -an -sn -f rawvideo <title>.rawvideo
avconv -i <title><stream>.vob -map 0:<audiostream> -c:a copy -vn -sn <title>.ac3
+
avconv -i <title><stream>.vob -map 0:<audiostream> -c:a copy -vn -sn -f ac3 <title>.ac3
 
</pre>
 
</pre>
  

Revision as of 08:46, 28 March 2012

This describes how to convert a DVD to OGG video using:

  • libtheora for video
  • libvorbis for audio
  • srt subtitles

Installation

Install the packages

apt-get install lsdvd ffmpeg vobcopy oggz-tools

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

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

Prepare

Use lsdvd to see what's on DVD. Determine the stream you would like to extract as well as the aid for audio and the sid for subtitles.

lsdvd -x

Write the stream to the harddrive so the next steps will go faster.

vobcopy -l -n <stream> -t <title>

Investigate the VOB file and note the numbers for the videostream and the audiostream

avconv -i <title><stream>.vob

Some VOB files report the wrong duration so just in case rebuild the vob file but only with the required videostream and audiostream.

avconv -i <title><stream>.vob -map 0:<videostream> -c:v copy -an -sn -f rawvideo <title>.rawvideo
avconv -i <title><stream>.vob -map 0:<audiostream> -c:a copy -vn -sn -f ac3 <title>.ac3

Audio

Now extract audio from the stream and convert to OGG. If the original audiostream if stereo take 128 (2 channel) or 256 (6 channel) for the bitrate.

avconv -y -i <title>.ac3 -c:a libvorbis -q:a 4 -ar 44100 -vn -sn -f ogg <title>.audio

Video

Detect the amount to crop.

avconv -y -i <title>.vob -t 600 -vf cropdetect -an -sn -f rawvideo /dev/null 2>&1 | tail | head -n 1 | sed 's/^.*crop=//'

Convert the video stream to ogv

avconv -y -i <title>.vob -vf crop=<cropvalues> -g 25 -bf 16 -q:v 9 -c:v libtheora -an -sn -f ogg <title>.video

Subtitles

Extract the subtitles from the stream.

To do!!!

Merging

Combine everything in a ogg container

oggz-merge -o <title>.ogv <title>.video <title>.audio