[MEncoder-users] ffmpeg vs. mencoder with libavcodec

Gary Steele gsteele at mit.edu
Sat Dec 17 19:19:48 CET 2005


Hey,

I've been playing around with comparing encoded movies from a set of 
image files using ffmpeg and mencoder.

Using what appears to be similar settings, I get much higher quality 
movies using mencoder, but I don't quite understand why, since it 
seems I'm using the same libavcodec encoder setting in both.

In particular, movies encoded with ffmpeg (CVS version) seem to be 
very "blocky": there are what appear to be macroblock (?) motion 
artifacts even in areas where the image is not changing.

As a demonstration, I have encoded two movies from the same set of 
image files to a very low target bitrate using the following commands:

$ ffmpeg -r 25 -b 50 -i %03d.jpg -vcodec msmpeg4v2 output_ffmpeg.avi

and

$ mencoder "mf://*.jpg" -mf fps=25 -o output.avi -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=50

The output files can be viewed here:

http://electron.mit.edu/~gsteele/encode_test/tmp/output_ffmpeg.avi (345 kB)
http://electron.mit.edu/~gsteele/encode_test/tmp/output_mencoder.avi (194 kB)

For some reason, in the ffmpeg output file, after about 4 frames or 
so, remkarable square blocky-ness sets in. The mencoder output looks 
much better: the quality is quite good, annd there are only irregular 
(non square) motion artifacts visible during rapid frame changes. 
mencoder also does a much better job at getting close to the target 
bitrate.

Is there a reason for this? Is there something wrong with ffmpeg, or 
are there extra libavcodec settings used by mencoder that give the 
higher quality movie?

Part of the reason I'm asking is that mencoder is incompatible with 
the input image files I'm using. The image files are grayscale jpeg, 
which seem to cause mencoder to barf. I get the following errors:

Writing AVI header...
ODML: Aspect information not (yet?) available or unspecified, not writing vprp header.
VDec: vo config request - 640 x 480 (preferred csp: Unknown)
Could not find matching colorspace - retrying with -vf scale...
Opening video filter: [scale]
The selected video_out device is incompatible with this codec.
mp_image: Unknown out_fmt: 0x0
mp_image: Unknown out_fmt: 0x0ps Trem:   0min   0mb  A-V:0.000 [0:0]
mp_image: Unknown out_fmt: 0x0ps Trem:   0min   0mb  A-V:0.000 [0:0]

1 duplicate frame(s)!
ODML: Aspect information not (yet?) available or unspecified, not 
writing vprp header.
mp_image: Unknown out_fmt: 0x0ps Trem:   0min   0mb  A-V:0.000 [0:0]

(...)

Thus, it seems that mencoder will only work with color jpeg files. I 
would rather just use ffmpeg than have to run all my jpegs through a 
conversion to color mode, but this movie quality thing is killing me.

I've cross posted this to the mencode-users list in case anyone has 
any ideas.

Thanks,
Gary.




More information about the MEncoder-users mailing list