[Spice-devel,v5,14/20] server: Cap the VP8 and h264 video quality to limit the bit rate.

Submitted by Francois Gouget on Aug. 27, 2015, 7:01 p.m.

Details

Message ID alpine.DEB.2.20.1508272038200.22172@amboise
State New
Headers show

Not browsing as part of any series.

Commit Message

Francois Gouget Aug. 27, 2015, 7:01 p.m.
This prevents the bit rate from going insanely high for no visible video quality improvement on fast networks.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
---
 server/gstreamer_encoder.c | 2 ++
 1 file changed, 2 insertions(+)

Patch hide | download patch | download mbox

diff --git a/server/gstreamer_encoder.c b/server/gstreamer_encoder.c
index fc8dc27..de496c1 100644
--- a/server/gstreamer_encoder.c
+++ b/server/gstreamer_encoder.c
@@ -830,6 +830,7 @@  static gboolean construct_pipeline(GstEncoder *encoder, const SpiceBitmap *bitma
 #endif
         g_object_set(G_OBJECT(encoder->gstenc),
                      "resize-allowed", TRUE, /* for very low bit rates */
+                     "min-quantizer", 10, /* seems virtually lossless */
 #ifdef HAVE_GSTREAMER_0_10
                      "mode", 1, /* CBR */
                      "bitrate", encoder->video_bit_rate,
@@ -850,6 +851,7 @@  static gboolean construct_pipeline(GstEncoder *encoder, const SpiceBitmap *bitma
     case SPICE_VIDEO_CODEC_TYPE_H264:
         g_object_set(G_OBJECT(encoder->gstenc),
                      "bitrate", encoder->video_bit_rate / 1024,
+                     "qp-min", 15, /* virtually lossless */
                      "byte-stream", TRUE,
                      "aud", FALSE,
                      "tune", 4, /* zero-frame latency */