简体   繁体   English

如何在Linux中检测相机断开连接?

[英]How to detect the camera disconnection in linux?

How will you detect the camera signal disconnection (not the module disconnection or hardware disconnection) without the support of V4l2-ctl command? 在不支持V4l2-ctl命令的情况下,如何检测摄像机信号断开(不是模块断开或硬件断开)? Because my Camera Driver is not supporting v4l2-ctl command. 因为我的相机驱动程序不支持v4l2-ctl命令。

Found the temporary solution for camera disconnection in linux.First let me explain how to find the camera disconnection(signal disconnection) from your linux with the support of v4l2-ctl command 在linux中找到了摄像机断开连接的临时解决方案。首先让我解释一下如何在v4l2-ctl命令的支持下从Linux查找摄像机断开连接(信号断开连接)

Command is :- 命令是:-

$v4l2-ctl -d <device name>(for ex-/dev/video0) --all

will list all the parameters of the camera where in the video input you can find the camera signal value changes when you disconnect the camera signal. 将列出摄像机的所有参数,在视频输入中您可以找到断开摄像机信号时摄像机信号值的变化。

For without the support of v4l2 it takes 2 seconds with the help of ffmpeg command to find out. 如果没有v4l2的支持,则需要2秒钟的时间借助ffmpeg命令进行查找。

With ffmpeg command we can take pictures of the camera devices every second and through shell script we can find out the space of the image taken for the latest file.If the image is less than 1KB then we can say that the camera signal is disconnected 使用ffmpeg命令,我们可以每秒拍摄一次摄像头设备的图片,并通过shell脚本找出最新文件所拍摄图像的空间。如果图像小于1KB,则可以说摄像头信号已断开

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM