我試圖從本地安裝的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視頻非常流暢。 –