英文:
v4l2-ctl won't respond if device disconnect
问题
我可以捕获视频
v4l2-ctl -d 0 --set-fmt-video=width=1280,height=720,pixelformat=MJPG --stream-mmap --set-parm 25 --stream-to=video.yuvj422p --stream-count=1000
在捕获过程中,我从电脑上断开相机连接。在我的Ubuntu中,v4l2-ctl进程永远不会响应(我等了大约10分钟)。但在Buildroot(内核版本4.19.269)中,v4l2-ctl停止并显示消息
VIDIOC_DQBUF: failed: No such device
为什么在Ubuntu中v4l2-ctl不会响应?
我正在等待v4l2-ctl-streaming.cpp中的消息。
Ubuntu版本为linux 6.2.0-26-generic #26~22.04.1-Ubuntu
两台计算机中的v4l2-ctl版本相同。
v4l2-ctl --version
v4l2-ctl 1.22.1
英文:
I can capture video
v4l2-ctl -d 0 --set-fmt-video=width=1280,height=720,pixelformat=MJPG --stream-mmap --set-parm 25 --stream-to=video.yuvj422p --stream-count=1000
While capturing I disconnect camera from PC. In my Ubuntu v4l2-ctl process do won't respond forever (I am waiting about 10 minutes). But in Buildroot (kernel 4.19.269) v4l2-ctl stops with message
VIDIOC_DQBUF: failed: No such device
Why in case of Ubuntu v4l2-ctl won't respond?
I am waiting message from v4l2-ctl-streaming.cpp.
Ubuntu version linux 6.2.0-26-generic #26~22.04.1-Ubuntu
v4l2-ctl in both computers has the same version.
v4l2-ctl --version
v4l2-ctl 1.22.1
答案1
得分: 1
如果我添加--stream-poll选项,那么在Ubuntu中,如果相机断开连接,v4l2-ctl会完成。我应该总是使用--stream-poll选项吗?
这是我在Ubuntu中的命令和输出:
v4l2-ctl -d 0 --set-fmt-video=width=1280,height=720,pixelformat=MJPG --stream-mmap --set-parm 25 --stream-to=video.yuvj422p --stream-count=1000 --stream-poll
帧率设置为25.000 fps
<<<<< 3.91 fps
<<<<<<VIDIOC_DQBUF: 失败:没有这样的设备
英文:
If I add --stream-poll option then in Ubuntu v4l2-ctl finish if camera will disconnect. Should I always use --stream-poll option?
This is my cmd and output in Ubuntu:
v4l2-ctl -d 0 --set-fmt-video=width=1280,height=720,pixelformat=MJPG --stream-mmap --set-parm 25 --stream-to=video.yuvj422p --stream-count=1000 --stream-poll
Frame rate set to 25.000 fps
<<<<< 3.91 fps
<<<<<<VIDIOC_DQBUF: failed: No such device
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论