linuxvideo4linux

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? Because my Camera Driver is not supporting v4l2-ctl command.


Solution

  • 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

    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.

    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