该管道是我与 Logitech C920 摄像头一起使用的流水线 H264 视频,如下所示:
gst-launch-1.0 -v -e v4l2src device=/dev/video1 ! video/x-h264,width=1280,height=720,framerate=30/1 ! h264parse ! tee name=t ! queue ! rtph264pay ! udpsink host=127.0.0.1 port=1234
(三通用于拆分以便稍后保存流)
该管道有效。但是,一段时间后,管道会崩溃:
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
libv4l2: error dequeuing buf: No such device
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data flow error.
Additional debug info:
gstbasesrc.c(2865): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
streaming task paused, reason error (-5)
EOS on shutdown enabled -- waiting for EOS after Error
Waiting for EOS...
Got EOS from element "pipeline0".
EOS received - stopping pipeline...
Execution ended after 0:12:06.806371505
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
libv4l2: error turning off stream: No such device
libv4l2: error turning off stream: No such device
libv4l2: error turning off stream: No such device
libv4l2: error querying buffer 0: No such device
libv4l2: error turning off stream: No such device
Setting pipeline to NULL ...
Freeing pipeline ...
这通常没问题,但是通过这种方式崩溃,视频对象(/dev/video1)被破坏并消失。一旦我拔下并重新插入相机,它就会再次出现。我正在远程控制它,所以我无法以这种方式重置相机。
这怎么发生的?有没有办法解决这个问题?某种重建 /dev/video* 对象的方法?
Edit1:在弄乱了管道之后,这显然有效:
gst-launch-1.0 -v -e v4l2src device=/dev/video1 !视频/x-h264,宽度=1280,高度=720,帧率=30/1!三通名称=t!队列 !h264解析!rtph264pay!udpsink 主机=127.0.0.1 端口=1234
我只是将 h264parse 移到了发球台之后。仍然不知道为什么会这样,或者最初的问题是什么。