Próbuję przechwycić strumień H264 z zainstalowanej lokalnie kamery Logitech C920 z elementu /dev/video0
z elementem Gstreamer 1.0
v4l2src
.Przechwytywanie strumienia h.264 z kamery za pomocą Gstreamer
v4l2-ctl --list-formats
pokazuje, że kamera jest w stanie dać H264 format wideo:
# v4l2-ctl --list-formats
ioctl: VIDIOC_ENUM_FMT
...
Index : 1
Type : Video Capture
Pixel Format: 'H264' (compressed)
Name : H.264
...
Ale rurociąg
# gst-launch-1.0 -vvv v4l2src device=/dev/video0 ! video/x-h264, width=800, height=448, framerate=30/1 ! fakesink
utrzymuje dając mi not-negotiated (-4)
błąd:
/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.
pomoc!
Wielkie dzięki! 'cvlc' działa jak urok! Używam go na Rasperry Pi. –
Z C920 w trybie H264? Jesteś pewny? Miałem wiele problemów z włączeniem trybu H264 kamery z Raspberry Pi, z powodu problemów z portem USB w Raspberry Pi. Niektóre klatki H264 są tracone z powodu tego problemu, więc wideo jest dziwne. Właściwie z tego powodu używam C920 na Beaglebone. W każdym razie, jeśli to działa, zakładam, że aktualizacja oprogramowania układowego rozwiązała ten problem. –
Miałem taki problem z USB przed upuszczeniem klatek. Zainstalowałem tutaj nowe jądro Rapbian (https://github.com/raspberrypi/linux/issues/238). Upadek ramki zniknął. Teraz streaming wideo H264 jest bardzo płynny. –