Page 1 of 1

Take snapshot from webcam from cron

Posted: 27 Mar 2015 15:37
by lavorrick
I have been searching hard but cannot find a solution to this - I want to take a snapshot from my webcam via cron, on Ubuntu using vlc 2.1.6.

This works from the command line, but produces video output within the terminal window for one second and exits, having also created my snapshot:

vlc -I dummy --run-time=1 v4l2:///dev/video0 --video-filter scene --no-audio --scene-path /tmp --scene-prefix cam --scene-format jpeg vlc://quit

It won't work from cron though, as it's unable to open a terminal from there for the video output, I think.

I also tried this (adding -V dummy), now I don't get video output in the terminal any more, but now vlc never exits, and I get multiple snapshots, one every couple of seconds or so:

vlc -I dummy -V dummy --run-time=1 v4l2:///dev/video0 --video-filter scene --no-audio --scene-path /tmp --scene-prefix cam --scene-format jpeg vlc://quit

This also works from cron, but of course it's no good like that as it never exits!

Thanks in advance for any help.