我遇到了 v4l2 无法正确读取摄像头馈送的问题。或者更可能 gstreamer 没有正确启动 v4l2 ctl。
基础设施:
香蕉派 M2+ OV5640 相机
modprobe ov5640
modprobe vfe_v4l2
我的问题:相机可以很好地处理运动,但我无法让它与 gstreamer 一起工作。
这是我手动编译的 gstreamer:
$ gst-launch-1.0 -v v4l2src ! "image/jpeg,width=160,height=120,framerate=30/1" ! rtpjpegpay ! udpsink host=192.168.1.2 port=5001
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.
Additional debug info:
gstbasesrc.c(3064): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
streaming stopped, reason not-negotiated (-4)
Execution ended after 0:00:00.003571242
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...
ben@bananapim2plus:~/src/gst-plugins-good/tests/examples/v4l2$ ./v4l2src-renegotiate
Setting resolution to '320x240'
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:src: Device '/dev/video0' failed during initialization
Additional debug info:
gstv4l2object.c(3785): gst_v4l2_object_set_format_full (): /GstPipeline:pipeline0/GstV4l2Src:src:
Call to S_FMT failed for YUYV @ 320x240: Operation not permitted
ben@bananapim2plus:~/src/gst-plugins-good/tests/examples/v4l2$ ./camctrl
ERROR: from element /GstPipeline:camera/GstV4l2Src:v4l2src0: Device '/dev/video0' failed during initialization
Additional debug info:
gstv4l2object.c(3785): gst_v4l2_object_set_format_full (): /GstPipeline:camera/GstV4l2Src:v4l2src0:
Call to S_FMT failed for YUYV @ 640x480: Operation not permitted
我能听到相机“咔哒”一声