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).
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)
(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/)