转自:https://blog.csdn.net/zzs0829/article/details/111562443

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);

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐