What Ubuntu software is there to use a webcam as a recording camera (Like a Security System). It NEEDS to detect movement in the room, take pictures and/or record.
7 Answers
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.
Notes
By default
target_dir
(defined in/etc/motion/motion.conf
) is/var/lib/motion/
.On Debian based systems on the config file you might need to change
/usr/etc/motion/
to/etc/motion/
. Then restart motion service.Remove old files with a cron job. To keep last 60 days would be something like:
/usr/bin/find /var/lib/motion/ -mtime +60 -and -type f -and -name "*mkv" -delete

- 15,657
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.

- 15,657

- 7,274
-
-
1How is the provided solutions capture the motion detection, please explain, I tried it and it did not work in motion detection. – Ashish Sharma Aug 28 '13 at 18:22
-
wxCam supports the movement detection.
Last release: 2011-11.
wxCam is a webcam application for linux. It supports video recording (in an avi uncompressed and Xvid format), snapshot taking, and some special commands for philips webcams, so you can also use the program for astronomy purposes. It supports both video4linux 1 and 2 drivers, so it should work on a very large number of devices.

- 15,657

- 2,406
Shinobi (source)
Shinobi is a ZoneMinder alternative.
The Open Source CCTV platform written in Node.JS (Camera Recorder - Security Surveillance Software). From its site:
- Records IP Cameras and Local Cameras
- Streams by WebSocket
- Save to WebM and MP4: Other formats will be added after codec choices are less confusing.
- API
- Get videos
- Get monitors
- Change monitor modes : Disabled, Watch, Record
- Embedding streams
Also: Webcamoid is a full featured and multiplatform webcam suite. Check here how to install.

- 15,657
Try Cheese, the standard webcam app in Ubuntu.
Its installed by default, go to Applications > Sound & Video
It has recording capabilities (video and sound), and it take snapshots as pictures. But i guess it lacks motion sensor.

- 20,086
ffmpeg, Cheese, V4L are all great tools - simple to the max - and yet they lack motion detection capability.
If motion detection is a must you should really take a look at ZoneMinder (open source) and/or Xeoma (closed source but has a very simple free mode with motion detector and some notifications).
sudo sh -c "mkdir /var/log/motion && chown motion /var/log/motion"
to avoid these errors on service start – Pablo Bianchi Jan 04 '24 at 19:23