[Ffmpeg-devel] MPEG 2 Quality Issues

herve.flores herve.flores
Fri Dec 1 16:49:46 CET 2006


Le 1 d?c. 06 ? 09:30, V?ctor Paesa a ?crit :

> Hi,
>>
>> Le 30 nov. 06 ? 11:40, Michael Niedermayer a ?crit :
>>
>>> Hi
>>>
>>> On Wed, Nov 29, 2006 at 07:21:17PM -0600, Brian Brice wrote:
>>>> Hello.
>>>>
>>>> A while back I had emailed about bitrate issues regarding MPEG 2
>>>> encoding, and now I'm back for quality issues!  I have a DV clip
>>>> that contains some fast motion and I'm getting some horrible  
>>>> blocking
>>>> when trying to encode to MPEG 2.  I am trying to find the right
>>>> options
>>>> to pass to ffmpeg that make a huge different in the quality of the
>>>> encoding.  I've used TMPGEnc and it produced *great* results, and
>>>> I wish
>>>> I could get ffmpeg up to the same standard.  At this point I'm just
>>>> passing numbers without knowing what they do.
>>>>
>>>> I have tried setting lmin to 0 and lmax to 1*QP2LAMBDA.  This video
>>>> smooth like I would expect, but the bitrate ended up averaging  
>>>> around
>>>> 13.7 Mbps even though I tried to aim for CBR 7 Mbps.
>>>>
>>>> Here's a sample screenshot of how TMPGEnc looks to ffmpeg:
>>>> TMPGEnc: http://heapify.org/etc/ffm/tmpgenc.png
>>>> ffmpeg:  http://heapify.org/etc/ffm/ffmpeg.png
>>>> Major blocky-ness with ffmpeg :-(
>>>>
>>>> Here is the original clip:
>>>> http://heapify.org/etc/ffm/TestforMPG-Short.avi
>>>>
>>>> Encoded with ffmpeg without lmin/lmax settings:
>>>> http://heapify.org/etc/ffm/YuckNolminlmax.mpg
>>>>
>>>> Encoded with TMPGEnc, looks *great* as I want ffmpeg's to :-(
>>>> http://heapify.org/etc/ffm/TMPGEnc.mpg
>>>>
>>>> Here is how I used ffmpeg:
>>>> ffmpeg -i TestforMPG-Short.avi -y -f vob -vcodec mpeg2video -
>>>> acodec mp2
>>>> -ab 384k -ar 48000 -ac 2 -aspect 4:3 -b 7000k -minrate 7000k - 
>>>> maxrate
>>>> 7000k -bufsize 1835008 -g 12 -bf 2 -flags ildct+trell -mbd 2
>>>> LooksGoodBadBitrate.mpg
>>>
>>> one thing missing here is -flags ilme
>>>
>>> [...]
>>> --
>>> Michael
>>
>> ...and "-top 0" (or "-top -1", it'll be the same here)
>>
>
> Is -top really needed here?

most of time, contents of DV is interlaced (and most of time DV is  
bottom-field-first)
if you don't write the field order, ffmpeg will produce a progressive  
output (and you'll see beautifull "comb's effect" during reading on  
TV ;-))

with a LCD TV you'll have both fields as the same time ("comb's  
effects")
with a normal TV, you'll have "comb's effect" if your DVD Player can  
read progressive, and something maybe OK or awfull if your DVD reader  
split the frame in fields (if you'll have luck, it'll decode with the  
good order: fields 1-2-3-4-5... if not: 2-1-4-3-6-5...good headache ;-))

> I tried SVN-r7186 with -top 0, with -top -1 and whitout -top,
> and I got three binary identical results.

and field stream? progressive or interlaced?
The difference is tiny, take a look to headers (I don't know how I'm  
not dev, but if ffmpeg can decode the order, it certainly can show it  
too)

with an hexa editor you can take a look to the beginning of your  
output (it's very easy):
Differencies between interlaced and progressive:
14 8A 00 01 <=> progressive (PAL & NTSC-Film)
14 82 00 01 <=> interlaced (PAL & NTSC-Video & NTSC-F+pulldown3:2 )

(but it's much more difficult to read the field order with an hexa  
editor)


> (I tried with a PAL DV on AVI file, I don't know if NTSC behaves
> differently)

exactly the same -in case of output interlaced or not- with pal or  
NTSC(or DVPro or DVCPro, etc)

> Regards,
> V?ctor

bye

Herv?



More information about the ffmpeg-devel mailing list