[Spice-devel,v6,17/26] server: Cap the VP8 and h264 video quality to limit the bit rate

Submitted by Francois Gouget on Oct. 14, 2015, 3:33 p.m.

Details

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

Not browsing as part of any series.

Commit Message

Francois Gouget Oct. 14, 2015, 3:33 p.m.
This prevents the bit rate from going insanely high on fast networks
for no visible video quality improvement.

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 d31a15e..2829326 100644
--- a/server/gstreamer_encoder.c
+++ b/server/gstreamer_encoder.c
@@ -784,6 +784,7 @@  static gboolean construct_pipeline(SpiceGstEncoder *encoder, const SpiceBitmap *
 #endif
         g_object_set(G_OBJECT(encoder->gstenc),
                      "resize-allowed", TRUE, /* for very low bit rates */
+                     "min-quantizer", 10, /* seems virtually lossless */
                      "target-bitrate", encoder->video_bit_rate,
                      "end-usage", 1, /* CBR */
                      "lag-in-frames", 0, /* zero-frame latency */
@@ -796,6 +797,7 @@  static gboolean construct_pipeline(SpiceGstEncoder *encoder, const SpiceBitmap *
     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 */

Comments

ACK.

On Wed, Oct 14, 2015 at 05:33:19PM +0200, Francois Gouget wrote:
> This prevents the bit rate from going insanely high on fast networks
> for no visible video quality improvement.
> 
> Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
> ---
>  server/gstreamer_encoder.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/server/gstreamer_encoder.c b/server/gstreamer_encoder.c
> index d31a15e..2829326 100644
> --- a/server/gstreamer_encoder.c
> +++ b/server/gstreamer_encoder.c
> @@ -784,6 +784,7 @@ static gboolean construct_pipeline(SpiceGstEncoder *encoder, const SpiceBitmap *
>  #endif
>          g_object_set(G_OBJECT(encoder->gstenc),
>                       "resize-allowed", TRUE, /* for very low bit rates */
> +                     "min-quantizer", 10, /* seems virtually lossless */
>                       "target-bitrate", encoder->video_bit_rate,
>                       "end-usage", 1, /* CBR */
>                       "lag-in-frames", 0, /* zero-frame latency */
> @@ -796,6 +797,7 @@ static gboolean construct_pipeline(SpiceGstEncoder *encoder, const SpiceBitmap *
>      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 */
> -- 
> 2.6.1
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel