Note: You are viewing an old version of this page. View the current version.

Differences between version 4 and previous revision of MencoderCommands.

Other diffs: Previous Major Revision, Previous Author

Newer page: version 4 Last edited on Saturday, 23 February 2008 5:48:04 by CyberLeo Revert
Older page: version 3 Last edited on Tuesday, 19 February 2008 7:49:12 by CyberLeo Revert
@@ -46,4 +46,6 @@
 </verbatim> 
  
 -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!*  

version 4

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!