Webcam (usb cam) as security camera (32bit)

Moderator: Forum moderators

Post Reply
User avatar
greengeek
Posts: 1200
Joined: Thu Jul 16, 2020 11:06 pm
Has thanked: 340 times
Been thanked: 145 times

Webcam (usb cam) as security camera (32bit)

Post by greengeek »

A few years ago we needed a way to record what was happening on our shared driveway and I made a "sort of" security camera based on a usb connected uvc compatible webcam - recording a series of jpg images (rather than an actual movie).

I can't find any thread on the old murga forum so either it got lost or I never posted the actual jpglooprecorder and pho pets - but this is something I need again now so thought I would post again.

The recorder is designed to run from a usb stick (or even better - an SSD for reliability). The scripts know the path info for the usb stick and record the series of jpg images to that location. (ie fully portable as long as the stick/SSD are Linux formatted - I only tested EXT2 but EXT4 is probably fine )

NOTE : The pet installs a directory "jpglooprecorder_portable" into /root. To start recording use the scripts inside that directory. In most cases you will want to move the whole directory onto a usb stick or SSD rather than working within /root. The images get stored inside this directory so place it exactly where you want it.

The jpglooprecorder directory contains a ReadFirst text file that explains some of the parameters that need to be specified. (Possibly I should set up a gtk gui but this is as far as I got to at that time...)

One of the parameters is "MAXFILES" - which defaults to a value of 10. This makes testing simple (doesn't eat up too much space) - but this value should be significantly increased if the utility is actually used as as security camera. (See the ReadFirst file for coaching).

jpglooprecorderportable_gg-0.1.pet
(3.99 KiB) Downloaded 49 times

Further notes :
- At the end of each day I would stop the recorder (using the "stop" script) then rename the jpgstore directory by adding the date or other note to the directory name (eg "jpgstore-2017November28" or "jpgstore-TruckDamage") to make it easier to find important info later.

- There is no attempt to capture audio. This is a remote video capture utility only.
(When I say "remote" - what I mean is "unattended" and with the camera at the end of whatever usb cable length you have available. I had the camera duct-taped to a high window and attached via about 5 metres of usb cable but it might be possible to use a powered usb extender if you need greater length).

Viewing images :
To see a "quickview" of the images after a day's recording there are various options:

- The simplest way is you can click on one of the images then use whatever key your image viewer uses to step to next image (ie hold down the right arrow key in viewnior and watch it flick through the images...)

- I wanted a more "automatic" way of reviewing the days images so I found a utility called "pho". This allows a very quick step through of a huge number of jpg images (almost like a movie). This way I could carry on making dinner while watching the scrolling images.
(I tested this to run on Slacko 5.6 but it works on Tahr32 also)

pho_slacko56_gg-0.2.pet
(29.43 KiB) Downloaded 37 times

(only download if you wish to test "pho" viewer utility - it is not a requirement for the recorder to capture images)

Once the pho pet is installed you need to make the following script and place it in the directory that has stored the jpg images ("jpgstore" is the default directory name unless you change it). I call this script "00phoview" (the zeroes ensure it appears at the top of the files in that directory so that it is easily found)
This is what to put in the script:

Code: Select all

#!/bin/sh
pho -s0.2 -r *jpg

(remember to make it executable)
Once you click that script it will sequentially display each of the captured jpg files.
(You can change the speed by changing the "0.2" value in the script)

(For further info on pho utility see https://shallowsky.com/software/pho/)

Last edited by greengeek on Wed Jan 04, 2023 8:19 pm, edited 12 times in total.
User avatar
greengeek
Posts: 1200
Joined: Thu Jul 16, 2020 11:06 pm
Has thanked: 340 times
Been thanked: 145 times

Re: Webcam (usb cam) as security camera

Post by greengeek »

reserved for further development.

User avatar
mikewalsh
Moderator
Posts: 5575
Joined: Tue Dec 03, 2019 1:40 pm
Location: King's Lynn, UK
Has thanked: 570 times
Been thanked: 1681 times

Re: Webcam (usb cam) as security camera (32bit)

Post by mikewalsh »

@greengeek :-

Neat! :thumbup:

Mike. ;)

Puppy "stuff" ~ MORE Puppy "stuff" ~ ....and MORE! :D
_______________________________________________________

Image

Rantanplan
Posts: 104
Joined: Thu Jun 03, 2021 2:25 pm
Has thanked: 34 times
Been thanked: 22 times

Re: Webcam (usb cam) as security camera (32bit)

Post by Rantanplan »

Hello @greengeek ,

I downloaded it and tried it : very fine with ToutouLinux Slaxen 6.0 (french derivative by @esmourguit),
and Triton 8.0 (petihar's french distro [see french section]).

Many thanks to you.

In jpglrp script, I changed the value in line 108 (-ss 2 vs -ss 20) and the delay between two images is longer.
Then, to adjust for a best result in the true life. :)

:thumbup: :thumbup:

Best to you.

Post Reply

Return to “Security/Privacy”