我试图从本地安装的Logitech C920摄像机从/dev/video0
与Gstreamer 1.0
v4l2src
元素捕获H264流。从Gstreamer摄像头捕获h.264流
v4l2-ctl --list-formats
显示,相机能够给H264视频格式:
# v4l2-ctl --list-formats
ioctl: VIDIOC_ENUM_FMT
...
Index : 1
Type : Video Capture
Pixel Format: 'H264' (compressed)
Name : H.264
...
但管道
# gst-launch-1.0 -vvv v4l2src device=/dev/video0 ! video/x-h264, width=800, height=448, framerate=30/1 ! fakesink
一直给我not-negotiated (-4)
错误:
/GstPipeline:pipeline0/GstV4l2Src:v4l2src0.GstPad:src: caps = video/x-h264, width=(int)800, height=(int)448, interlace-mode=(string)progressive, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = video/x-h264, width=(int)800, height=(int)448, interlace-mode=(string)progressive, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1
/GstPipeline:pipeline0/GstFakeSink:fakesink0.GstPad:sink: caps = video/x-h264, width=(int)800, height=(int)448, interlace-mode=(string)progressive, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = video/x-h264, width=(int)800, height=(int)448, interlace-mode=(string)progressive, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data flow error.
Additional debug info:
gstbasesrc.c(2809): gst_base_src_loop(): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
streaming task paused, reason not-negotiated (-4)
Execution ended after 67687169 ns.
任何帮助!
非常感谢! 'cvlc'就像一个魅力!我在Rasperry Pi上使用它。 –
C920处于H264模式?你确定?由于Raspberry Pi上的USB问题,我在使用Raspberry Pi启用相机的H264模式时遇到了很多问题。由于这个问题,一些H264帧丢失了,所以视频很奇怪。事实上,正因为如此,我在一个Beaglebone上使用了C920。 无论如何,如果它适合你,我想在固件中有一个更新来解决这个问题。 –
我以前有丢帧的USB问题。我在这里安装了新的Rapbian内核(https://github.com/raspberrypi/linux/issues/238)。丢帧问题消失。现在流式传输H264视频非常流畅。 –