如何解决如何构建 gstreamer 管道以将图像文件发送到 V4L2 接收器?
我想构建一个 gstreamer 管道,将图像文件发送到 V4L2 设备,并让该设备无限期地显示图像。
gst-launch-1.0 -v filesrc location=cat.jpg ! jpegdec ! v4l2sink device=/dev/video1
给我以下输出:
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
/GstPipeline:pipeline0/GstJpegDec:jpegdec0.GstPad:src: caps = video/x-raw,format=(string)I420,width=(int)1200,height=(int)1200,interlace-mode=(string)progressive,multiview-mode=(string)mono,multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono,pixel-aspect-ratio=(fraction)1/1,chroma-site=(string)mpeg2,colorimetry=(string)1:4:0:0,framerate=(fraction)0/1
ERROR: from element /GstPipeline:pipeline0/GstFileSrc:filesrc0: Internal data stream error.
Additional debug info:
gstbasesrc.c(3072): gst_base_src_loop (): /GstPipeline:pipeline0/GstFileSrc:filesrc0:
streaming stopped,reason not-negotiated (-4)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...
我怀疑我遗漏了与 [not] 将图像数据转换为视频数据相关的内容,因为用 v4l2sink
替换 fakesink
似乎有效。
解决方法
经过一番摆弄后,似乎我只是从我的管道中遗漏了 videoconvert
(去图!):
gst-launch-1.0 \
filesrc location=cat.jpg \
! jpegdec \
! videoconvert \
! v4l2sink device=/dev/video1
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。