mencoder -dvd-device /dev/sr0 dvd://1 -aid 128 -sid 0 -ovc lavc -oac lavc -lavcopts vcodec=mpeg4:vpass=1:vbitrate=700:acodec=mp3:abitrate=192 -vf harddup -o video.avi
mencoder -dvd-device /dev/sr0 dvd://1 -aid 128 -ovc lavc -oac lavc -lavcopts vcodec=mpeg4:vpass=1:vbitrate=700:vhq:trell:acodec=mp3:abitrate=192 -vf harddup -o video.avi
Extract subtitles (why?) mencoder -dvd-device /dev/sr0 dvd://1 -vo copy -ao copy -o /dev/null -vobsubout video-english -vobsuboutid eng
Start Here
Ogg-Vorbis audio is not compatible with AVI containers. You must mux it separately.
Extract audio
mplayer dvd://1 -alang en -ao pcm:fast:waveheader:audio.wav -vc null -vo null
Encode audio
oggenc --quality 4.0 -o audio.ogg audio.wav
Use a pipe to streamline the previous two
mkfifo -m600 audio.pipe
These two must be run simultaneously (source first) and cannot be backgrounded.
mplayer dvd://1 -alang en -ao pcm:fast:waveheader:file=audio.pipe -vc null -vo null oggenc --quality 4.0 -o audio2.ogg audio.pipe rm audio.pipe
Calculate target bitrate from movie length and encoded audio size
movie length: 7446 seconds
video_space=$(((700 * 8388608) - $(stat -c '%s' audio.ogg) )) video_length=7446 video_bitrate=$(( (${video_space} / ${video_length}) / 1024)) mencoder dvd://1 -sid 0 -noaudio -ovc lavc -lavcopts vcodec=mpeg4:vpass=1:vbitrate=${video_bitrate}:vhq:trell \ -vf harddup -o /dev/null mencoder dvd://1 -sid 0 -audiofile audio.ogg -sid 0 -ovc lavc -oac copy -lavcopts \ vcodec=mpeg4:vpass=2:vbitrate=${video_bitrate}:vhq:trell -vf harddup -o video.avi
- ss selects a start time in seconds or hh:mm:ss.mmm
- endpos specifies the number of seconds to encode before stopping
Mencoer options are poorly documented!