使用GStreamer和QGC后,视频流在几帧后停止

时间:2017-12-12 20:40:16

标签: video-streaming gstreamer

我正在尝试使用GStreamer将RGB彩色视频从我的UAV传输到在我的ubuntu笔记本电脑上运行的QGC。

我的管道构建为

char str_pipeline[200];

snprintf(str_pipeline, sizeof( str_pipeline ), "appsrc name=mysource ! videoconvert ! "
"video/x-raw,width=640,height=480,format=NV12 ! vaapih264enc ! h264parse ! rtph264pay !"
"udpsink host=%s port=5600", "192.168.8.2");

pipeline = gst_parse_launch( str_pipeline, &error );

if( !pipeline )
{
printf( "gst_parse_launch error. Cannot launch GStreamer..: %s\n", error->message );
return;
}

appsrc = gst_bin_get_by_name( GST_BIN( pipeline ), "mysource" );

app_caps = gst_caps_new_simple( "video/x-raw", "format", G_TYPE_STRING, "RGB",
"width", G_TYPE_INT, WIDTH, "height", G_TYPE_INT, HEIGHT, NULL );

gst_app_src_set_caps( GST_APP_SRC( appsrc ), app_caps );
gst_caps_unref( app_caps );
g_object_set( G_OBJECT( appsrc ), "is-live", TRUE, "format", GST_FORMAT_TIME, NULL );

在几帧之后,视频停止在QGC上流式传输(即使您已将帧发送到它)。

我在每次发送后检查管道状态,第一帧是PAUSED,然后是播放。

我的管道中有什么东西是错的吗?什么是流式RGB COLOR视频的正确管道?我错过了一些管道元素吗?

0 个答案:

没有答案