Log in

View Full Version : constant quantizer for vp9


madloggan
27th November 2018, 13:54
hey

how I can use constant quantizer mode on vp9
I know there is Constant Quantizer (Q) and you can select it by using --end-usage=q and -min-q=10 --max-q=10

so my question is this mode like the mode on x264 and the x265 range is from 0 to 51?

but when i trying to encode file with q = 10 on x264 or x265 i got bitrate range is from 150 mb/s to 200 mb/s but when I'm using vp9 with --end-usage=q and -min-q=10 --max-q=10 i got file with 23 mb/s how can this is possible ?


Codec: WebM Project VP9 Encoder v1.7.0



my command for x264 :

with qp mode :

x264 qp = 10

x264 --frames 100 --profile high --preset medium -o x264_10.264 --input-csp i420 --output-csp i420 --input-depth 8 --output-depth 8 --input-res 1920x1080 --fps 50 --verbose --dump-yuv x264_10.yuv /home/siraj/Desktop/Project/Samples/1080p/ReadySteadyGo_1920x1080_120fps_420_8bit_YUV.yuv --qp=10
the output bitrate = 165813.47 kb/s

x265 qp = 10

x265 -o hevc_3500.265 --output-depth 8 --input ReadySteadyGo_1920x1080_120fps_420_8bit_YUV.yuv --fps 50 --input-res 1920x1080 --input-depth 8 --input-csp 1 -P main -p medium --qp=10 --frames=100 --recon x265_40.yuv --recon-depth 8 --recon x265_50.yuv
the bitrate = 132423.19 kb/s

with crf mode :

x264 crf=20

x264 --frames 100 --profile high --preset medium -o x264_10.264 --input-csp i420 --output-csp i420 --input-depth 8 --output-depth 8 --input-res 1920x1080 --fps 50 --verbose --dump-yuv x264_10.yuv /home/siraj/Desktop/Project/Samples/1080p/ReadySteadyGo_1920x1080_120fps_420_8bit_YUV.yuv --crf=20
bitrate = 8865.74 kb/s


x265 : crf = 20

x265 -o hevc_3500.265 --output-depth 8 --input ReadySteadyGo_1920x1080_120fps_420_8bit_YUV.yuv --fps 50 --input-res 1920x1080 --input-depth 8 --input-csp 1 -P main -p medium --crf=20 --frames=100 --recon x265_40.yuv --recon-depth 8 --recon x265_50.yuv

bitrate = 6388.08 kb/s

--------------------------------------------------------------------------

for vp9

vp9 q mode = 10

./vpxenc --output=ReadySteadyGo_1920x1080_120fps_420_8bitzzz. webm --codec=vp9 --passes=2 --good -v --i420 --width=1920 --height=1080 --profile=0 --fps=50000/1001 --auto-alt-ref=1 --input-bit-depth=8 --tile-columns=4 /home/siraj/Desktop/Project/Samples/1080p/ReadySteadyGo_1920x1080_120fps_420_8bit_YUV.yuv --bit-depth=8 --end-usage=q --limit=100 --min-q=30 --max-q=30 --threads=4 --cpu-used=4 Warning: Bad quantizer values. Quantizer values should not be equal, and should differ by at least 8.
1 encoder configuration warning(s). Continue? (y to continue) y
bitrate: 24089 kb/s





cq mode = 20

./vpxenc --output=RrreadySteadyGo_1920x1080_120fps_420_8bit_. webm --codec=vp9 --passes=2 --good -v --i420 --width=1920 --height=1080 --profile=0 --fps=50000/1001 --input-bit-depth=8 /home/siraj/Desktop/Project/Samples/1080p/ReadySteadyGo_1920x1080_120fps_420_8bit_YUV.yuv --bit-depth=8 --end-usage=q --limit=100 --cq-level=20 --tile-columns=4 --threads=4 --cpu-used=4
bitrate = 15090 kb/s


when change end-usage to cq :
./vpxenc --output=RrreadySteadyGo_1920x1080_120fps_420_8bit_. webm --codec=vp9 --passes=2 --good -v --i420 --width=1920 --height=1080 --profile=0 --fps=50000/1001 --input-bit-depth=8 /home/siraj/Desktop/Project/Samples/1080p/ReadySteadyGo_1920x1080_120fps_420_8bit_YUV.yuv --bit-depth=8 --end-usage=cq --limit=100 --cq-level=20 --tile-columns=4 --threads=4 --cpu-used=4
bitrate = 8865.74 kb/s

and if i set cq=24 bucz CQ(VP9)=((CRF(X264.X265)*63))/51

./vpxenc --output=RrreadySteadyGo_1920x1080_120fps_420_8bit_. webm --codec=vp9 --passes=2 --good -v --i420 --width=1920 --height=1080 --profile=0 --fps=50000/1001 --input-bit-depth=8 /home/siraj/Desktop/Project/Samples/1080p/ReadySteadyGo_1920x1080_120fps_420_8bit_YUV.yuv --bit-depth=8 --end-usage=q --limit=100 --cq-level=24 --tile-columns=4 --threads=4 --cpu-used=4
bitrate = 12804 kb/s

Selur
27th November 2018, 19:54
What makes you thing there should be a formula that you can find a relation between quantization mappings between different formats.
Seems to me like assuming that there should be a correlation to between the length of a translated of a text into different languages (which use the same symbols when written down).
For x264 and x265 (different languages) which share lots of code (grammar&co) and are quite similar a loose correlation might exist, but looking at different formats this seems to have no logical base.
Looking at what quantization is, I see no reason that there should be a a relation like you are looking for,...

Also as a side note: Why use '--passes=2' when using constant quantizer with VP9 ? iirc constrained quality is a 1pass encoding mode,....

What makes you thing there should be a formula that you can find a relation between quantization mappings between different formats.
Seems to me like assuming that there should be a correlation to between the length of a translated of a text into different languages (which use the same symbols when written down).
For x264 and x265 (different languages) which share lots of code (grammar&co) and are quite similar a loose correlation might exist, but looking at different formats this seems to have no logical base.
Looking at what quantization is, I see no reason that there should be a a relation like you are looking for,...

Also as a side note: Why use '--passes=2' when using constant quantizer with VP9 ? iirc constrained quality is a 1pass encoding mode,....

Constrained Quality Level:
CQ mode is a special variant of VBR. It is designed as a fire-and-forget mechanism for encoding a large set of clips such that, as much as possible, the output stays within given quality and size constraints across the set. CQ mode exposes an additional parameter (--cq-level), and the meaning of the --target-bitrate parameter changes to be the “target maximum rate”.
In CQ mode the encoder will try to encode normal frames (all frames apart from key frames, golden frames and alternative reference frames) at a quantizer / quality level of --cq-level, provided that this does not cause the bitrate to rise above the target maximum value.
since afaik crf calculation in x264 and x265 is similar but quite different from VP9s quality level I'm even more doubtful that your goal is achievable,..

-> wish you the best of luck

foxyshadis
27th November 2018, 22:29
VP9 has quantizers from 0-63 on a completely different scale from MPEG. I don't know why you'd expect them to be similar, since the whole point of VPx is to be the un-MPEG.

madloggan
28th November 2018, 12:49
What makes you thing there should be a formula that you can find a relation between quantization mappings between different formats.
Seems to me like assuming that there should be a correlation to between the length of a translated of a text into different languages (which use the same symbols when written down).
For x264 and x265 (different languages) which share lots of code (grammar&co) and are quite similar a loose correlation might exist, but looking at different formats this seems to have no logical base.
Looking at what quantization is, I see no reason that there should be a a relation like you are looking for,...

Also as a side note: Why use '--passes=2' when using constant quantizer with VP9 ? iirc constrained quality is a 1pass encoding mode,....

What makes you thing there should be a formula that you can find a relation between quantization mappings between different formats.
Seems to me like assuming that there should be a correlation to between the length of a translated of a text into different languages (which use the same symbols when written down).
For x264 and x265 (different languages) which share lots of code (grammar&co) and are quite similar a loose correlation might exist, but looking at different formats this seems to have no logical base.
Looking at what quantization is, I see no reason that there should be a a relation like you are looking for,...

Also as a side note: Why use '--passes=2' when using constant quantizer with VP9 ? iirc constrained quality is a 1pass encoding mode,....


since afaik crf calculation in x264 and x265 is similar but quite different from VP9s quality level I'm even more doubtful that your goal is achievable,..

-> wish you the best of luck

Thank you

Also as a side note: Why use '--passes=2' when using constant quantizer with VP9? iirc constrained quality is a 1pass encoding mode,...

when I use 2-pass, the output bitrate = 29003 kb/s
with 1-pass, the output bitrate = bitrate: 59061 kb/s

why it is different? if the CQ is 1 pass encoding mod..

madloggan
28th November 2018, 12:50
VP9 has quantizers from 0-63 on a completely different scale from MPEG. I don't know why you'd expect them to be similar, since the whole point of VPx is to be the un-MPEG.

Thank you for the detailed and informative answer