You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

gst-launch-1.0与gst_parse_launch运行同GStreamer管道画面差异咨询

问题:GStreamer管道在gst-launch与gst_parse_launch执行结果不一致

搭建的管道详情

1. 视频源管道

将图像数据推入appsrc的发送端管道代码:

GError *error = NULL;
gchar *video_caps = g_strdup_printf("video/x-raw,format=\"BGRA\",width=%d,height=%d,framerate=%d/1", width, height, target_fps);
gchar *pipeline = g_strdup_printf("appsrc is-live=0 block=1 caps=\"%s\" name=\"appsrc\"  ! queue !  videoconvert ! nvh265enc bitrate=81920 preset=2 zerolatency=1 ! h265parse ! rtph265pay config-interval=-1 ! udpsink host=192.168.1.2 port=5902", video_caps); 
priv->pipeline = gst_parse_launch(pipeline, &error);

2. gst-launch-1.0.exe加载的正常接收管道

通过命令行工具加载的接收管道,可正常显示视频:

gst-launch-1.0 -e udpsrc port=5902 ! application/x-rtp,encoding-name=H265 ! rtph265depay ! queue ! h265parse ! nvh265dec ! videoconvert ! d3d11videosink

(显示正常画面)

3. gst_parse_launch()函数加载的异常接收管道

通过代码调用gst_parse_launch加载的接收管道,画面严重花屏且整体呈绿色:

pipeline = g_strdup_printf("udpsrc port=5902 ! application/x-rtp,encoding-name=H265 ! rtph265depay ! queue ! h265parse !  nvh265dec ! videoconvert !  d3d11videosink name=\"displaysink\"");
p->stream1.pipe = gst_parse_launch(pipeline, &error);

(显示异常画面)

核心疑问

使用完全相同的管道描述,分别通过gst-launch-1.0和gst_parse_launch加载管道,却得到不同结果,想了解两者的差异所在,以及gst-launch-1.0.exe是否对管道有特殊处理。

内容的提问来源于stack exchange,提问作者xuelong ba

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.08 23:37:03