VP8 Quality setting

605 views
Skip to first unread message

fnordware

unread,
Nov 22, 2013, 10:48:02 PM11/22/13
to apps-...@webmproject.org
Hey everyone, I'm a little confused about how to set constant quality in libvpx.

It's easy in libwebp, just set config.quality to a number 0-100, 100 being the highest quality.

In libvpx, there's constant quality, constrained quality, min/max quantizer, etc. The quality seems to go from 0-63, with 63 being the lowest quality. Or maybe I'm supposed to check the range programmatically?

I just want to make a slider for libvpx like the one in libwebp. What's the best way?



Brendan

fnordware

unread,
Dec 12, 2013, 10:35:58 PM12/12/13
to apps-...@webmproject.org
On Friday, November 22, 2013 7:48:02 PM UTC-8, fnordware wrote:
I just want to make a slider for libvpx like the one in libwebp. What's the best way?


Anyone? My vpxenc command looks something like this:

vpxenc --codec=vp8 --good --cpu-used=0 --threads=8 --yv12 --end-usage=q --cq-level=63 --width=1920 --height=800 --fps=24/1 --output=test_encode_vp8_q63.webm test.yv12


Using cq-level of 63 (the maximum) doesn't look great like I'd expect. And setting it much lower to something like 20 doesn't look really bad like I'd expect. Am I doing it wrong?

What's the difference between constant quality and constrained quality?


Brendan

Tom Finegan

unread,
Dec 13, 2013, 2:20:37 PM12/13/13
to apps-...@webmproject.org
I'm going to completely dodge your CQ related questions. I don't have a complete grasp of the topic, and I don't want to mislead you or send you down a blind alley wrt your app development.

If you want to implement a quality slider, I would suggest:

1) Set your min-q to a low number (0-4, for example).
2) Use your quality slider to manipulate max-q (but do not allow users to specify min_q == max_q). The encoder should produce better quality video when given at least some room to manipulate q values.

Note: Higher quantizer values mean lower quality. From http://www.webmproject.org/docs/encoder-parameters/ :

--min-q=<arg>                    (valid values 0-63, recommended value 0-4)
--max-q=<arg>                    (valid values --min-q to 63, recommended value 50-63)

These two parameters define the range of quantizers that the rate control algorithm may use. A lower number equates to higher quality but more bits (note, however, that these are not real quantizer values just control values). In effect these two parameters can trump all the other rate control parameters. For example if you have set a maximum of 10 then the encoder will never use a quantizer greater than the value represented by 10, even if it massively overshoots the target bit rate. They are useful however, because they allow the user to set upper and lower quality limits for a clip




Brendan

--
You received this message because you are subscribed to the Google Groups "Application Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to apps-devel+...@webmproject.org.
To post to this group, send email to apps-...@webmproject.org.
Visit this group at http://groups.google.com/a/webmproject.org/group/apps-devel/.
For more options, visit https://groups.google.com/a/webmproject.org/groups/opt_out.

Lou Quillio

unread,
Dec 13, 2013, 2:48:09 PM12/13/13
to apps-...@webmproject.org
On Fri, Dec 13, 2013 at 11:20 AM, Tom Finegan <tomfi...@google.com> wrote:
> On Thu, Dec 12, 2013 at 7:35 PM, fnordware <fnor...@gmail.com> wrote:

>> What's the difference between constant quality and constrained quality?

> I'm going to completely dodge your CQ related questions. I don't have a
> complete grasp of the topic, and I don't want to mislead you or send you
> down a blind alley wrt your app development.

> Note: Higher quantizer values mean lower quality. From
> http://www.webmproject.org/docs/encoder-parameters/

There's a discussion of CQ (constrained quality) on that page as well:

http://www.webmproject.org/docs/encoder-parameters/#vbr-cbr-and-cq-mode

As I understand it, --end-usage=cq and --cq-level=<arg> are for
YouTube-like use cases, where you have a large number of encodes to
do.

LQ


--
Lou Quillio
Webmaster, WebMProject.org

fnordware

unread,
Dec 13, 2013, 6:20:56 PM12/13/13
to apps-...@webmproject.org
On Friday, December 13, 2013 11:48:09 AM UTC-8, Lou Quillio wrote:

http://www.webmproject.org/docs/encoder-parameters/#vbr-cbr-and-cq-mode



Thanks for the link, guys. Just what I needed.

Tom, your advice on --max-q looks spot-on. In fact, --cq-level doesn't seem to do anything at all, at least when encoding VP8. Files wound up exactly the same size.


Brendan
Reply all
Reply to author
Forward
0 new messages