gst-launch-1.0.exe 与 gst_parse_launch() 之间的不同结果

问题描述 投票:0回答:1

我有一个如下所示的管道,我将图像数据推送到appsrc中。当我使用gst-launch-1.0.exe播放该管道的图像时,图像很好,但是当我使用gst_parse_launch加载相同的管道时,图像出现严重的花屏,整个图像呈绿色。不知道GST-launch-1.0.exe是否对管道有特殊处理,或者应该如何确定使用gst-launch-1.0和gst_parse_launch的区别? (1)视频源管道:

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加载dst pipline,可以得到正常视频

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

enter image description here

(3)通过gst_parse_launch()函数加载dst pipline,图像出现严重花屏,整个图像呈绿色。

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

enter image description here

我在视频端使用了完全相同的通道描述符,并分别使用 gst-launch-1.0 和 gst_parse_launch 加载它,但得到了不同的结果,我想知道它们之间有什么区别

gstreamer
1个回答
0
投票

以发布模式编译程序可以解决这个问题。目前尚不清楚为什么在调试模式下会出现上述问题。

© www.soinside.com 2019 - 2024. All rights reserved.