Use WebCam to record (Including movement detection)

Solution 1:

You could try using motion (V4L capture program supporting motion detection), a command line only utility.

To install this from the standard repository, execute:

sudo apt install motion

It's been pretty useful for me. Keep in mind motion will not record any audio.

Solution 2:

  • ffmpeg

    for video only:

    ffmpeg -f video4linux2 -s 320x240 -i /dev/video0 out.
    

    for audio and video:

    ffmpeg -f oss -i /dev/dsp -f video4linux2 -s 320x240 -i /dev/video0 out.mpg
    
  • ZoneMinder surveillance system. Maybe the best and most complex open source tool.