Index: pjproject/trunk/pjmedia/include/pjmedia/config.h
===================================================================
--- pjproject/trunk/pjmedia/include/pjmedia/config.h	(revision 5409)
+++ pjproject/trunk/pjmedia/include/pjmedia/config.h	(revision 5410)
@@ -1331,4 +1331,23 @@
 #endif
 
+/**
+ * Specify the number of keyframe needed to be sent after the stream is 
+ * created. Setting this to 0 will disable it.
+ *
+ * Default : 5
+ */
+#ifndef PJMEDIA_VID_STREAM_START_KEYFRAME_CNT
+#   define PJMEDIA_VID_STREAM_START_KEYFRAME_CNT	5
+#endif
+
+/**
+ * Specify the interval to send keyframe after the stream is created, in msec.
+ *
+ * Default : 1000
+ */
+#ifndef PJMEDIA_VID_STREAM_START_KEYFRAME_INTERVAL_MSEC
+#   define PJMEDIA_VID_STREAM_START_KEYFRAME_INTERVAL_MSEC  1000
+#endif
+
 
 /**
Index: pjproject/trunk/pjmedia/include/pjmedia/vid_stream.h
===================================================================
--- pjproject/trunk/pjmedia/include/pjmedia/vid_stream.h	(revision 5409)
+++ pjproject/trunk/pjmedia/include/pjmedia/vid_stream.h	(revision 5410)
@@ -117,4 +117,26 @@
 
 } pjmedia_vid_stream_rc_config;
+
+/**
+ * Structure of configuration settings for video stream sending keyframe 
+ * after it is created.
+ */
+typedef struct pjmedia_vid_stream_sk_config
+{
+    /**
+     * The number of keyframe to be sent after the stream is created.
+     *
+     * Default: PJMEDIA_VID_STREAM_START_KEYFRAME_CNT
+     */
+    unsigned			    count;
+
+    /**
+     * The keyframe sending interval after the stream is created.
+     *
+     * Default: PJMEDIA_VID_STREAM_START_KEYFRAME_INTERVAL_MSEC
+     */
+    unsigned			    interval;
+
+} pjmedia_vid_stream_sk_config;
 
 
@@ -166,4 +188,7 @@
     pjmedia_vid_stream_rc_config rc_cfg;
                                     /**< Stream send rate control settings. */
+
+    pjmedia_vid_stream_sk_config sk_cfg;
+				    /**< Stream send keyframe settings.	    */
 } pjmedia_vid_stream_info;
 
@@ -201,4 +226,12 @@
 PJ_DECL(void)
 pjmedia_vid_stream_rc_config_default(pjmedia_vid_stream_rc_config *cfg);
+
+/**
+ * Initialize the video stream send keyframe with default settings.
+ *
+ * @param cfg		Video stream send keyframe structure to be initialized.
+ */
+PJ_DECL(void)
+pjmedia_vid_stream_sk_config_default(pjmedia_vid_stream_sk_config *cfg);
 
 
Index: pjproject/trunk/pjmedia/src/pjmedia/vid_stream.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/vid_stream.c	(revision 5409)
+++ pjproject/trunk/pjmedia/src/pjmedia/vid_stream.c	(revision 5410)
@@ -155,4 +155,11 @@
 
     pj_bool_t		     force_keyframe;/**< Forced to encode keyframe? */
+    unsigned		     num_keyframe;  /**< The number of keyframe needed 
+						 to be sent, after the stream
+						 is created. */
+    pj_timestamp	     last_keyframe_tx;  
+					    /**< Timestamp of the last 
+						 keyframe. */
+
 
 #if defined(PJMEDIA_STREAM_ENABLE_KA) && PJMEDIA_STREAM_ENABLE_KA!=0
@@ -851,4 +858,21 @@
     frame_out.size = 0;
 
+    /* Check if need to send keyframe. */
+    if (stream->num_keyframe) {
+	unsigned elapse_time;
+	pj_timestamp now;
+
+	pj_get_timestamp(&now);
+
+	elapse_time = pj_elapsed_msec(&stream->last_keyframe_tx, &now);
+
+	if (elapse_time > stream->info.sk_cfg.interval)
+	{
+	    stream->force_keyframe = PJ_TRUE;
+	    if (--stream->num_keyframe)
+		stream->last_keyframe_tx = now;
+	}
+    }
+
     /* Init encoding option */
     pj_bzero(&enc_opt, sizeof(enc_opt));
@@ -1460,4 +1484,5 @@
     stream->use_ka = info->use_ka;
 #endif
+    stream->num_keyframe = info->sk_cfg.count;
 
     /* Build random RTCP CNAME. CNAME has user@host format */
@@ -2010,3 +2035,15 @@
 
 
+/*
+ * Initialize the video stream send keyframe with default settings.
+ */
+PJ_DEF(void)
+pjmedia_vid_stream_sk_config_default(pjmedia_vid_stream_sk_config *cfg)
+{
+    pj_bzero(cfg, sizeof(*cfg));
+    cfg->count = PJMEDIA_VID_STREAM_START_KEYFRAME_CNT;
+    cfg->interval = PJMEDIA_VID_STREAM_START_KEYFRAME_INTERVAL_MSEC;
+}
+
+
 #endif /* PJMEDIA_HAS_VIDEO */
Index: pjproject/trunk/pjsip/include/pjsua-lib/pjsua.h
===================================================================
--- pjproject/trunk/pjsip/include/pjsua-lib/pjsua.h	(revision 5409)
+++ pjproject/trunk/pjsip/include/pjsua-lib/pjsua.h	(revision 5410)
@@ -3307,4 +3307,11 @@
 
     /**
+     * Specify the send keyframe config for video stream.
+     *
+     * Default: see #pjmedia_vid_stream_sk_config
+     */
+    pjmedia_vid_stream_sk_config vid_stream_sk_cfg;
+
+    /**
      * Media transport config.
      */
Index: pjproject/trunk/pjsip/include/pjsua2/account.hpp
===================================================================
--- pjproject/trunk/pjsip/include/pjsua2/account.hpp	(revision 5409)
+++ pjproject/trunk/pjsip/include/pjsua2/account.hpp	(revision 5410)
@@ -832,4 +832,19 @@
     unsigned			rateControlBandwidth;
 
+    /**
+     * The number of keyframe to be sent after the stream is created.
+     *
+     * Default: PJMEDIA_VID_STREAM_START_KEYFRAME_CNT
+     */
+    unsigned			    startKeyframeCount;
+
+    /**
+     * The keyframe sending interval after the stream is created.
+     *
+     * Default: PJMEDIA_VID_STREAM_START_KEYFRAME_INTERVAL_MSEC
+     */
+    unsigned			    startKeyframeInterval;
+
+
 public:
     /**
Index: pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c	(revision 5409)
+++ pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c	(revision 5410)
@@ -278,4 +278,5 @@
 #if PJMEDIA_HAS_VIDEO
     pjmedia_vid_stream_rc_config_default(&cfg->vid_stream_rc_cfg);
+    pjmedia_vid_stream_sk_config_default(&cfg->vid_stream_sk_cfg);
 #endif
     pjsua_transport_config_default(&cfg->rtp_cfg);
Index: pjproject/trunk/pjsip/src/pjsua-lib/pjsua_vid.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsua-lib/pjsua_vid.c	(revision 5409)
+++ pjproject/trunk/pjsip/src/pjsua-lib/pjsua_vid.c	(revision 5410)
@@ -911,4 +911,7 @@
 	/* Set rate control config from account setting */
 	si->rc_cfg = acc->cfg.vid_stream_rc_cfg;
+
+	/* Set send keyframe config from account setting */
+	si->sk_cfg = acc->cfg.vid_stream_sk_cfg;
 
 #if defined(PJMEDIA_STREAM_ENABLE_KA) && PJMEDIA_STREAM_ENABLE_KA!=0
Index: pjproject/trunk/pjsip/src/pjsua2/account.cpp
===================================================================
--- pjproject/trunk/pjsip/src/pjsua2/account.cpp	(revision 5409)
+++ pjproject/trunk/pjsip/src/pjsua2/account.cpp	(revision 5410)
@@ -278,4 +278,6 @@
     NODE_READ_NUM_T   ( this_node, pjmedia_vid_stream_rc_method, rateControlMethod);
     NODE_READ_UNSIGNED( this_node, rateControlBandwidth);
+    NODE_READ_UNSIGNED( this_node, startKeyframeCount);
+    NODE_READ_UNSIGNED( this_node, startKeyframeInterval);
 }
 
@@ -291,4 +293,6 @@
     NODE_WRITE_NUM_T   ( this_node, pjmedia_vid_stream_rc_method, rateControlMethod);
     NODE_WRITE_UNSIGNED( this_node, rateControlBandwidth);
+    NODE_WRITE_UNSIGNED( this_node, startKeyframeCount);
+    NODE_WRITE_UNSIGNED( this_node, startKeyframeInterval);
 }
 
@@ -434,4 +438,6 @@
     ret.vid_stream_rc_cfg.method= videoConfig.rateControlMethod;
     ret.vid_stream_rc_cfg.bandwidth = videoConfig.rateControlBandwidth;
+    ret.vid_stream_sk_cfg.count = videoConfig.startKeyframeCount;
+    ret.vid_stream_sk_cfg.interval = videoConfig.startKeyframeInterval;
 }
 
@@ -599,4 +605,6 @@
     videoConfig.rateControlMethod	= prm.vid_stream_rc_cfg.method;
     videoConfig.rateControlBandwidth	= prm.vid_stream_rc_cfg.bandwidth;
+    videoConfig.startKeyframeCount	= prm.vid_stream_sk_cfg.count;
+    videoConfig.startKeyframeInterval	= prm.vid_stream_sk_cfg.interval;
 }
 
