[longomatch] Configure encoders for live encoding and fast seek



commit a76024c5ba05565968dacc29b027cb60483276e1
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Tue Jun 8 23:42:37 2010 +0200

    Configure encoders for live encoding and fast seek
    
    Set max keuframe distance to 1 second to easy seeking and use variable bitrate
    and live/speed settings.

 libcesarplayer/src/gst-camera-capturer.c |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)
---
diff --git a/libcesarplayer/src/gst-camera-capturer.c b/libcesarplayer/src/gst-camera-capturer.c
index d2718e8..eb5fbe7 100644
--- a/libcesarplayer/src/gst-camera-capturer.c
+++ b/libcesarplayer/src/gst-camera-capturer.c
@@ -1157,31 +1157,42 @@ gst_camera_capturer_set_video_encoder (GstCameraCapturer * gcc,
     case VIDEO_ENCODER_MPEG4:
       gcc->priv->videoenc =
           gst_element_factory_make ("ffenc_mpeg4", "video-encoder");
+      g_object_set (gcc->priv->videoenc, "pass", "pass1",
+          "max-key-interval", -1, NULL);
       name = "FFmpeg mpeg4 video encoder";
       break;
 
     case VIDEO_ENCODER_XVID:
       gcc->priv->videoenc =
           gst_element_factory_make ("xvidenc", "video-encoder");
+      g_object_set (gcc->priv->videoenc, "pass", 1,
+          "profile", 146,
+          "max-key-interval", -1, NULL);
       name = "Xvid video encoder";
       break;
 
     case VIDEO_ENCODER_H264:
       gcc->priv->videoenc =
           gst_element_factory_make ("x264enc", "video-encoder");
+      g_object_set (gcc->priv->videoenc, "key-int-max", 25,
+          "pass", 17, NULL);
       name = "X264 video encoder";
       break;
 
     case VIDEO_ENCODER_THEORA:
       gcc->priv->videoenc =
           gst_element_factory_make ("theoraenc", "video-encoder");
+      g_object_set (gcc->priv->videoenc, "keyframe-auto", FALSE,
+          "keyframe-force", 25, NULL);
       name = "Theora video encoder";
       break;
-    
+
     case VIDEO_ENCODER_VP8:
     default:
       gcc->priv->videoenc =
           gst_element_factory_make ("vp8enc", "video-encoder");
+      g_object_set (gcc->priv->videoenc, "speed", 0,
+          "max-keyframe-distance", 25, NULL);
       name = "VP8 video encoder";
       break;
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]