[MPlayer-users] mencoder: encoding a B&W movie

D Richard Felker III dalias at aerifal.cx
Tue Oct 22 05:49:02 CEST 2002


On Mon, Oct 21, 2002 at 01:29:33AM -0400, Laurent Joubert wrote:
> [Automatic answer: RTFM (read DOCS, FAQ), also read DOCS/bugreports.html]
> Hello,
> 
> I am trying to encode a B&W movie from a DVD. After a few tries I am 
> still a little bit disappointed with the video quality. Since it is a 
> "dark" movies, there is a lot of black on the pictures, and on the 
> encoded avi I can see a lot of annoying "mpeg squares". I am using 
> avifile codec, but the best I think is to give you the command line I 
> used to encode a preview of the result:
> 
> First pass:
> mencoder TITLE01-ANGLE1.VOB -oac copy -ovc lavc -lavcopts 
> vcodec=mpeg4:vhq:vpass=1:vbitrate=800:keyint=48 -ofps 23.976 -npp lb 
> -ss 2:00 -endpos 0:30 -vop scale -zoom -xy 640 -o movie.avi
> 
> Second pass:
> the same with vpass=2
> 
> I am new to mencoder, so please tell me any idea you have even if it 
> obvious. I also tried the "gray" option of lavc, to encode B&W only, 
> but strangely it gives me "pink" squares from time to time.

YOU NEED TO CROP THE BLACK BORDERS. I can't stress enough what a waste
this is. Be sure you get all of the border off, since the very edge of
it is what wastes the most bits; overcrop a little if necessary! Also,
like someone else said, increase the keyframe interval to at least
250, but not more than 300-350. 48 is way too low. You could also
scale down a bit more, and/or do some blurring (see the -ssf option)
to make things compress better.

Also, keep in mind that 2pass will not help much with such a short
clip as you're testing. You need a long time for things to average out
over. Increasing vratetol to something very large will help spread the
bits better to the parts of the movie where they're needed on the
first pass, but it may cause your file to come out larger than you
expect.

BTW, about your pink squares with the gray option, you should probably
report that as a bug in libavcodec. See if you can find a simple way
to demonstrate the problem.

> PS. mencoder gives a "bus error" when it finishes encoding the file. It 
> does not seem to be a problem since the avi is perfect, but just to let 
> you know. (mplayer 0.90pre8 and MacOS X 10,2, gcc 3.1)

Probably not tested well, so this may be part of your problem...

Rich





More information about the MPlayer-users mailing list