如何将这个gst-launch命令从GStreamer 0.10转换为1.0?

时间:2022-09-28 20:00:22

This is to be converted:

这将改为:

gst-launch -v ximagesrc startx=0 starty=0 endx=800 endy=600 ! ffmpegcolorspace ! "video/x-raw-yuv,width=800,height=600,framerate=30/1" ! v4l2sink device=/dev/video0  

I found here that

我发现在这里

The "ffmpegcolorspace" element has been replaced with the new "videoconvert" element.

“ffmpegcolorspace”元素已经替换为新的“videoconvert”元素。

Simply replacing gst-launch with gst-launch-1.0 and ffmpegcolorspace with videoconvert is not sufficient and produces an error:

仅仅用gst-launch-1.0和ffmpegcolorspace替换使用videoconvert来替换gst-launch是不够的,会产生错误:

WARNING: erroneous pipeline: could not link videoconvert0 to v4l2sink0

警告:错误的管道:无法将videoconvert0链接到v4l2sink0

A simple gst-launch-1.0 videotestsrc ! ximagesink works fine, while gst-launch-1.0 videotestsrc ! v4l2sink device=/dev/video0 produces a different error:

一个简单的gst-launch-1.0 videotestsrc !ximagesink运行良好,而gst-launch-1.0 videotestsrc !v4l2sink设备=/dev/video0产生不同的错误:

ERROR: from element /GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0: Internal data flow error.

错误:从元素/GstPipeline:管道0/GstVideoTestSrc:videotestsrc0:内部数据流错误。

1 个解决方案

#1


3  

Two things, first, GStreamer changed the way they do caps, so video/x-raw-yuv becomes video/x-raw,format=YUV9 (or one of many other formats). So your caps would be wrong under GStreamer 1.0.

首先,GStreamer改变了大写格式,因此视频/x-raw-yuv变成了视频/x-raw,format=YUV9(或其他许多格式中的一种)。所以在GStreamer 1.0下,你的帽子是错误的。

Secondly, you can probably trim your pipeline up a bit. I'd guess you could do this:

第二,你可以稍微调整一下你的管道。我想你可以这么做:

gst-launch -v ximagesrc startx=0 starty=0 endx=800 endy=600 ! videoconvert ! v4l2sink device=/dev/video0

gst-launch -v ximagesrc startx=0 startx=0 endx=800 endy=600 !videoconvert != / dev / video0 v4l2sink设备

And if the frame rates don't match between the source and sink you'd have to add videorate:

如果帧速率不匹配源和接收器你需要添加视频

gst-launch -v ximagesrc startx=0 starty=0 endx=800 endy=600 ! videoconvert ! videorate ! video/x-raw,framerate=30/1 ! v4l2sink device=/dev/video0

gst-launch -v ximagesrc startx=0 startx=0 endx=800 endy=600 !videoconvert !videorate !视频/ x-raw,帧速率= 30/1 != / dev / video0 v4l2sink设备

#1


3  

Two things, first, GStreamer changed the way they do caps, so video/x-raw-yuv becomes video/x-raw,format=YUV9 (or one of many other formats). So your caps would be wrong under GStreamer 1.0.

首先,GStreamer改变了大写格式,因此视频/x-raw-yuv变成了视频/x-raw,format=YUV9(或其他许多格式中的一种)。所以在GStreamer 1.0下,你的帽子是错误的。

Secondly, you can probably trim your pipeline up a bit. I'd guess you could do this:

第二,你可以稍微调整一下你的管道。我想你可以这么做:

gst-launch -v ximagesrc startx=0 starty=0 endx=800 endy=600 ! videoconvert ! v4l2sink device=/dev/video0

gst-launch -v ximagesrc startx=0 startx=0 endx=800 endy=600 !videoconvert != / dev / video0 v4l2sink设备

And if the frame rates don't match between the source and sink you'd have to add videorate:

如果帧速率不匹配源和接收器你需要添加视频

gst-launch -v ximagesrc startx=0 starty=0 endx=800 endy=600 ! videoconvert ! videorate ! video/x-raw,framerate=30/1 ! v4l2sink device=/dev/video0

gst-launch -v ximagesrc startx=0 startx=0 endx=800 endy=600 !videoconvert !videorate !视频/ x-raw,帧速率= 30/1 != / dev / video0 v4l2sink设备