GStreamer 管道损坏

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

我不确定为什么这个管道会中断,我已经从网站上的确切说明在 Linux 上安装了 gstreamer,有什么想法吗?

gst-launch-1.0 v4l2src device=/dev/video0 ! videoscale ! video/x-raw, width=2592, height=600 ! autovideosink -v
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.
Additional debug info:
gstbasesrc.c(3055): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
streaming stopped, reason not-negotiated (-4)
Execution ended after 0:00:00.000093207
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

如果我将其更改为:

gst-launch-1.0 v4l2src device=/dev/video0 ! videoconvert! videoscale ! video/x-raw, width=2592, height=600 ! autovideosink -v 

它会起作用,但为什么反之则不起作用?

linux terminal gstreamer pipeline v4l2
1个回答
12
投票

您的网络摄像头将原始视频输出传输给正在收听的人。添加

videoconvert
将原始视频编码为可由
videoscale
元素操作的编解码器,并且操作的最终产品可由
autovideosink
元素理解。

所以

gst-launch-1.0 v4l2src device=/dev/video0 ! videoconvert! videoscale ! video/x-raw, width=2592, height=600 ! autovideosink
告诉 gstreamer 从摄像头获取原始视频,将其编码为我们理解的内容,更改视频并显示它。

我真的建议当你对某个元素有疑问时,致电

gst-inspect-1.0 <element name>
查看它的描述和属性。

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