[MEncoder-users] flv encoding problem

Corey Hickey bugfood-ml at fatooh.org
Tue May 20 00:13:20 CEST 2008


Axel Huizinga wrote:
> Corey Hickey schrieb:
>> Axel Huizinga wrote:
>>   
>>> Hi,
>>> hope anyone has an idea how to solve my pixelation problem.
>>> Converted my avi video with
>>> ffmpeg -i /tmp/0001_0301.avi -y -vcodec flv -b 100k   -f flv starlogo.flv
>>>
>>> the output runs smooth via     mplayer http://enerstar.de/starlogo.flv
>>> but while playing it in a swf flvplayer there appears some pixelation:
>>>
>>>
>>> http://enerstar.de/videoScreen.php?movie=videoPlayer.swf
>>>     
>> ...looks about the same to me...
>>
>> I think the difference is that your swf player is displaying the first
>> frame for a moment while it buffers (or something) and the first frame
>> looks quite ugly.
>>
>> $ mplayer starlogo.flv -vo png -frames 1 && display 00000001.png
>>
>> I expect that you'll get better results with 2-pass encoding and some of
>> the higher-quality options of ffmpeg/mencoder: mbd=2, trell, etc.
>>   
> Hi Corey,
> the ffmpeg options are quite complex - so if you're still interested I 
> put the avi online at
> http://enerstar.de/starlogo.avi

1. The ugly frame at the beginning is already present in starlogo.avi,
along with some of the usual quantization noise to be expected from a
lossily compressed video. This can be masked somewhat by postprocessing
before encoding, but you should really try to get an uncompressed (or
losslessly compressed) source from whoever made you starlogo.avi.
Otherwise, your video encoder is just trying to faithfully reproduce the
noise and blockiness that is already there.

2. By itself, 2-pass encoding won't actually help, since you're
requesting a bitrate of 100k, but the first pass ends up being about
175k. The second pass ends up actually meeting your requested bitrate,
and this video looks lousy at only 100k. 175k looks ok; 250k looks nice.
2-pass encoding with a higher requested bitrate is good.

3. mbd=2 and trell pretty much always help a little, so you might as
well use them. There are other high-quality options, but you won't get
much more out of them. Having a good source and choosing an appropriate
bitrate are more important.


Higher bitrate, 2-pass, mbd=2 and trell:
for i in 1 2 ; do
  mencoder starlogo.avi -ovc lavc -lavcopts \
  vcodec=flv:vbitrate=250:mbd=2:trell:vpass=$i -of lavf -o 250.flv
done

Same as above but with postprocessing if you can't get a better source:
for i in 1 2 ; do
  mencoder starlogo.avi -vf spp=2 -ovc lavc -lavcopts \
  vcodec=flv:vbitrate=250:mbd=2:trell:vpass=$i -of lavf -o pp_250.flv
done


-Corey



More information about the MEncoder-users mailing list