appsrc = (GstAppSrc*) gst_element_factory_make ("appsrc", NULL);
g_object_set (appsrc, "is-live", TRUE, NULL);
g_object_set (appsrc, "stream-type", 0, NULL);
g_object_set (appsrc, "format", GST_FORMAT_TIME, NULL);
// 给实时视频流打上时间戳
g_object_set (appsrc, "do-timestamp", TRUE, NULL);
g_object_set (appsrc, "min-percent", 0, NULL); // then the min-latency must be set to 0 because it timestamps based on the running-time when the buffer entered appsrc
videoSink = gst_element_factory_make ("Your Video Sink", NULL);
g_object_set (G_OBJECT(videoSink), "sync", FALSE, NULL);
//是否在preroll期间渲染视频帧。
g_object_set (G_OBJECT(videoSink), "show-preroll-frame", FALSE, NULL);
GStreamer插件:appsrc 解决播放实时视频流高延迟问题
最新推荐文章于 2023-11-09 14:30:00 发布