[MPlayer-users] mencoder dvd -> avi question
D Richard Felker III
dalias at aerifal.cx
Mon Mar 15 03:14:16 CET 2004
On Sun, Mar 14, 2004 at 05:51:58PM -0500, Aaron Peterson wrote:
> I have this process I go through to make divx encoded movie files from
> dvds. some of it i've pinched from various documentation, including the
> mplayer home page, and some I've come up with on my own. It seems to work
> out okay, but I just thought I'd ask here if I could speed up the process
> or make it more efficient, or if I'm doing anything stupid that I can
> avoid.
>
> I usually make a full screen size high quality divx first using this
> command that i basically copied from the mplayer documentation:
>
> cat *.vob | mencoder -oac copy -ovc lavc -lavcopts
> vcodec=mpeg4:vqscale=3:vhq:v4mv:trell -ofps 23.976 -o first_pass.avi
Never cat from *.vob. This will cause a/v desync. Instead use the
mencoder dvd:// -dvd-device /path/to/vobs (or just have mencoder read
straight off the dvd).
> Now, this turns out beautifully. From here I can see how big the file is,
> and generally try to do some things to make it smaller so it fits on 2
> cds. I always go through this first step though, because if it's small
> enough like this already, why scale down the screen size or encode mp3
> audio or anything else to make the size smaller?
Because q=3 isn't very good for still scenes. That's why you should
follow the directions and do a 2pass encode specifying bitrate rather
than constant-quantizer. Simply compute the desired bitrate to get the
filesize you want (leaving about 12 megs for the avi index)
> The resulting file IS usually too big though, so I do something like this:
>
> cat first_pass.avi | mencoder -oac mp3lame -lameopts preset=standard:vol=8
> -ovc lavc -lavcopts vcodec=mpeg4:vhq:v4mv:trell -vf scale -zoom -xy 640 -o
> second_pass.avi -
No, this is totally wrong!! Reencoding twice will trash the quality
with no gain. And you're not even specifying a bitrate!! Always encode
from the originals (the dvd/vobs!) and rtfm about how to make a
working filter chain. You'll need to crop the black borders, scale to
the desired size and aspect, and probably denoise.
> now, the two things I'm trying to accomplish are encoding the ac3 audio to
> compressed mp3, and resize the picture to 640px wide (from 720 usually).
> My concern though is that I'm re-encoding the video to mpeg4 from video
> that's already mpeg4. would i perhaps be better off just to start over
> with the .vobs and add the extra encoding options?
Yes.
> Lastly, I usually want to split the file into two close to evenly sized
> parts. I use a couple commands like this:
>
> mencoder second_pass.avi -oac copy -ovc copy -ss 0 -endpos 00:45:00 -o
> second_pass-1.avi
> mencoder second_pass.avi -oac copy -ovc copy -ss 00:45:00 -o
> second_pass-2.avi
This is bad. Unless you have a keyframe _exactly_ at 45 minutes,
you'll lose some of the video, or duplicate some. A much better method
is to encode both halves of the movie separately, using the -chapter
option so you line up the cut right on a chapter boundary. That way
you won't cut someone off in the middle of dialogue, etc., and it'll
actually work.
Actually if you follow the directions and rtfm, you'll see that you
can get better quality on ONE cd than you were getting on two before.
So if you were happy with the quality you got before, you should just
do 1disc encodes, but for goodness sake, do them RIGHT...
Rich
More information about the MPlayer-users
mailing list