[Spice-commits] server/gstreamer-encoder.c

Frediano Ziglio fziglio at kemper.freedesktop.org
Sat Oct 29 09:34:34 UTC 2016


 server/gstreamer-encoder.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 96818da95d607603627f51c83345d5635290d387
Author: Francois Gouget <fgouget at codeweavers.com>
Date:   Thu Oct 27 19:04:27 2016 +0200

    streaming: Limit the h264 image compression level
    
    When uncapped x264enc can compress the frames beyond recognition in low
    bitrate situation. Beyond the set limit the gains are modest and it is
    better to drop frames to reduce the bit rate further.
    
    Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
    Acked-by: Frediano Ziglio <fziglio at redhat.com>

diff --git a/server/gstreamer-encoder.c b/server/gstreamer-encoder.c
index d575c67..641ae96 100644
--- a/server/gstreamer-encoder.c
+++ b/server/gstreamer-encoder.c
@@ -932,11 +932,14 @@ static gboolean create_pipeline(SpiceGstEncoder *encoder)
     case SPICE_VIDEO_CODEC_TYPE_H264:
         /* - Set tune and sliced-threads to ensure a zero-frame latency
          * - qp-min ensures the bitrate does not get needlessly high.
+         * - qp-max ensures the compression does not go so high that the video
+         *   is unrecognizable. When that threshold is reached it is better to
+         *   drop frames to lower the bit rate further.
          * - Set speed-preset to get realtime speed.
          * - Set intra-refresh to get more uniform compressed frame sizes,
          *   thus helping with streaming.
          */
-        gstenc_opts = g_strdup("byte-stream=true aud=true qp-min=15 tune=4 sliced-threads=true speed-preset=ultrafast intra-refresh=true");
+        gstenc_opts = g_strdup("byte-stream=true aud=true qp-min=15 qp-max=35 tune=4 sliced-threads=true speed-preset=ultrafast intra-refresh=true");
         break;
     default:
         /* gstreamer_encoder_new() should have rejected this codec type */


More information about the Spice-commits mailing list