On Thu, 6 Apr 2006, Nicolas wrote:

> When you've determined the bitrate, how do you choose the value for -q ?

        Pick a number between 2 and 8 :-)  There are higher values (up to 31)
        but in practice they're not used (not often).

        Folks think of "-q" as being "quality" and indirectly that's true.

        The encoder though does not make decisions based on "high quality"
        or "low quality".  

        It might be helpful to think of "-q" as representing the amount of
        compression applied to a frame.  Low values of 'q' mean LESS compression
        is being applied - this retains more information which of course
        means bigger files (higher bitrate).  High values of 'q' mean MORE
        compression - the extreme of 31 is the most aggressive compression
        offered.  Very small files (low bitrate) but probably unwatchable.

        Might be better to think of the specified value of 'q' as being
        the "quantization floor" or "mimimum amount of compression applied"
        rather than "quality".  The value you specify is the value that the
        encoder will NOT go BELOW.  The encoder can (indeed MUST) go HIGHER
        than the value you specify - that's the 'q=' lines logged by the
        encoder.

        Part of the "art of selecting '-q'" is realizing that too low of a
        value does NOT improve the quality at all - if you can't see the
        difference between -q2 and -q3 why waste the bits?  Similarily for
        '-q 4' vs '-q 5'.  If you can't see the difference then why spend
        the extra bits for 4 when 5 would work ok?

        Using a lower value than necessary means that frames will be less
        compressed and use more bits for no purpose - they're wasted.  True,
        it's "higher quality" but quality you can't see is pointless. Put
        feature or short subject on the DVD with the bits that are saved by
        setting the quantization floor up a point.

        There aren't any firm/fixed rules for how to set the '-q'.   If you
        set it too low either 1) the encoder will raise it to what is necessary
        to accomodate the bitrate constraints or 2) you're wasting bits
        on invisible quality.  If you set it too high then you're tossing
        quality away ;(

        Sorry to be so "vague" but it is a bit of an art form - there's no
        "use -q N" magic rule.

        You might find that '-q 5' will avoid the rate spike you're fighting.
        Maybe '4' is not applying quite enough compression in a few places.
        Might be worth a try as an experiment.

        Cheers,
        Steven Schultz



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Mjpeg-users mailing list
Mjpeg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mjpeg-users

Reply via email to