1

我遇到了 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

我能听到相机“咔哒”一声

4

1 回答 1

1

谢谢大家,我设法让它工作了!

video/x-raw,format=I420

查看器端(Windows):

gst-launch-1.0 -v udpsrc port=5001 caps = "application/x-rtp\,\ media\=\(string\)video\,\ clock-rate\=\(int\)90000\,\ encoding-name\=\(string\)MP4V-ES\,\ profile-level-id\=\(string\)1\,\ config\=\(string\)000001b001000001b58913000001000000012000c48d8800cd3204709443000001b24c61766335362e312e30\,\ payload\=\(int\)96\,\ ssrc\=\(uint\)2873740600\,\ timestamp-offset\=\(uint\)391825150\,\ seqnum-offset\=\(uint\)2980" ! rtpmp4vdepay ! avdec_mpeg4 ! autovideosink

相机侧(香蕉):

/usr/bin/gst-launch-1.0 -v v4l2src ! video/x-raw,format=I420,width=800,height=600,framerate=15/1 ! avenc_mpeg4 ! rtpmp4vpay config-interval=3 ! udpsink host=192.168.1.2 port=5001
于 2018-11-03T02:49:45.087 回答