Search code examples
inputresourcescameradevicemotion

Motion and fswebcam running


I am using fswebcam to capture and image, when an email is received. I thought that it would be nice to have Motion running as well. I installed Motion, and that worked fine. However, when I tried to use fswebcam to take a picture,

I received the error:

Error selecting input 0
VIDIOC_S_INPUT: Device or resource busy

then I stopped Motion, and tried it again. It worked. So, I can only have one program accessing the camera at a time. Is there any way round this?


Solution

  • Use one or the other, two apps can't read the same video camera device at the same time.

    Motion is capable of running a script on event detection, so if you want to do that look in the config for on_area_detected or on_movie_start

    Then get it to call some kind of shell script that attaches the current photo and emails it to you.

    Hope you don't get too many events, else there will be too many emails to find the important ones.