如何构建 gstreamer 管道以将图像文件发送到 V4L2 接收器?

how do I build a gstreamer pipeline to send an image file to a V4L2 sink?

我想构建一个 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 ...

我怀疑我遗漏了与[不]将图像数据转换为视频数据相关的内容,因为用 fakesink 替换 v4l2sink 似乎可行。

经过一些摆弄后,似乎我只是从我的管道中丢失了 videoconvert(看图!):

gst-launch-1.0 \
  filesrc location=cat.jpg \
  ! jpegdec \
  ! videoconvert \
  ! v4l2sink device=/dev/video1