matthias-wandel / imgcomp Goto Github PK
View Code? Open in Web Editor NEWMotion triggered timelapses for security camera
Motion triggered timelapses for security camera
Compiling this on some old raspberry pi distribution (not sure how to check which version it is) on Raspberry Pi Zero W.
Getting some errors so I had to do the following changes to make it compile:
Using latest raspberry os lite fully apt-get updated . The tree statement that appends the ramdisk into the fstab put a series of null characters (^@ in vi) preceding the line.. had to manually remove to get mount to understand fstab.
I do not see any overt problem with the tee command. Not sure why it is happening. easy enough post break fix if you use an editor that can see null characters.
Just an FYI. The new canvas method that was merged in earlier today breaks in Safari. The entire histogram just doesn't show at all.
Tried compiling imgcomp on the latest pi os Bullseye
PRETTY_NAME="Raspbian GNU/Linux 11 (bullseye)"
NAME="Raspbian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
Receiving this error when imgcomp is compiled
cc -o imgcomp obj/main.o obj/config.o obj/compare.o obj/compare_util.o obj/jpeg2mem.o obj/jpgfile.o obj/exif.o obj/start_raspistill.o obj/util.o obj/send_udp.o obj/exposure.o -ljpeg -lm
/usr/bin/ld: obj/config.o:(.bss+0xa24): multiple definition of `WeightMap'; obj/main.o:(.bss+0x858): first defined here
/usr/bin/ld: obj/config.o:(.bss+0xa28): multiple definition of `MemImage'; obj/main.o:(.bss+0x85c): first defined here
/usr/bin/ld: obj/compare.o:(.bss+0x4): multiple definition of `WeightMap'; obj/main.o:(.bss+0x858): first defined here
/usr/bin/ld: obj/compare.o:(.bss+0x28): multiple definition of `MemImage'; obj/main.o:(.bss+0x85c): first defined here
/usr/bin/ld: obj/compare_util.o:(.bss+0x0): multiple definition of `WeightMap'; obj/main.o:(.bss+0x858): first defined here
/usr/bin/ld: obj/compare_util.o:(.bss+0x4): multiple definition of `MemImage'; obj/main.o:(.bss+0x85c): first defined here
/usr/bin/ld: obj/jpeg2mem.o:(.bss+0x0): multiple definition of `WeightMap'; obj/main.o:(.bss+0x858): first defined here
/usr/bin/ld: obj/jpeg2mem.o:(.bss+0x4): multiple definition of `MemImage'; obj/main.o:(.bss+0x85c): first defined here
/usr/bin/ld: obj/jpgfile.o:(.bss+0x4cc): multiple definition of `WeightMap'; obj/main.o:(.bss+0x858): first defined here
/usr/bin/ld: obj/jpgfile.o:(.bss+0x4d0): multiple definition of `MemImage'; obj/main.o:(.bss+0x85c): first defined here
/usr/bin/ld: obj/start_raspistill.o:(.bss+0x150): multiple definition of `WeightMap'; obj/main.o:(.bss+0x858): first defined here
/usr/bin/ld: obj/start_raspistill.o:(.bss+0x154): multiple definition of `MemImage'; obj/main.o:(.bss+0x85c): first defined here
/usr/bin/ld: obj/util.o:(.bss+0x7f8): multiple definition of `WeightMap'; obj/main.o:(.bss+0x858): first defined here
/usr/bin/ld: obj/util.o:(.bss+0x7fc): multiple definition of `MemImage'; obj/main.o:(.bss+0x85c): first defined here
/usr/bin/ld: obj/send_udp.o:(.bss+0x14): multiple definition of `WeightMap'; obj/main.o:(.bss+0x858): first defined here
/usr/bin/ld: obj/send_udp.o:(.bss+0x18): multiple definition of `MemImage'; obj/main.o:(.bss+0x85c): first defined here
/usr/bin/ld: obj/exposure.o:(.bss+0x54): multiple definition of `WeightMap'; obj/main.o:(.bss+0x858): first defined here
/usr/bin/ld: obj/exposure.o:(.bss+0x58): multiple definition of `MemImage'; obj/main.o:(.bss+0x85c): first defined here
collect2: error: ld returned 1 exit status
make: *** [makefile:27: imgcomp] Error 1
The browsing program compiled without error, but it does look funny.
Thoughts?
An extra null pointer check is not needed in functions like the following.
When following the docs for using a rtsp stream instead of the raspi camera, I encountered an error with the aquire_cmd options.
I get this error ffmpeg unrecognized option 'o'
, it seems that start_raspistill
appends the output options if not present, but ffmpeg doesnt understand the -o option and the aquire_cmd
config value already has the output defined in the example.
RTSP Example: aquire_cmd = ffmpeg -rtsp_transport tcp -i rtsp://192.168.1.15:554/user=admin&password=&channel=1&stream=0.sdp -q:v 1 -r 2 /tmp/in2/%06d.jpg
To fix this quickly I commented out this line:
imgcomp/src/start_raspistill.c
Line 117 in 25a07a3
But there is probably a better solution, potentially just checking if the aquire_cmd config is using ffmpeg and has the output already defined.
There always a chance I've missed a step during setup and this isnt actually an issue.
Hi,
Can someone please tell me:
How should --pathname look to get timelapse for whole day not just one hour?
the only issue here is my ignorance :-)
thx
I was able to get imgcomp working and writing images. I rebooted my pi and now when i run $ imgcom/imgcomp
i get an error /ramdisk/out00394.jpg: No such file or directory
Matthias,
Would you be interested in an alert feature for imgcomp?
I have a working prototype and I am wondering if you would be interested. The basic design is as follows:
imgcomp.conf
<alert_program> <flags>
mail.alert -s "alert subject" -r [email protected]
The external alert program doesn't have to be limited to email. Alternative alert programs could be written to do other things, since the alert program and its flags are user-defined in the config and passed along from imgcomp. For example, other alert programs could upload the image to an external server (scp.alert
) or send the image via text message (text.alert
).
Just wondering if there was a way to have multiple conf files? reason is to have one conf set up for daylight hours
example:
aquire_cmd = raspistill -q 20 -n -th none -p 1000,0,600,450 -w 1600 -h 1200 -o /ramdisk/out%05d.jpg -t 0 -tl 500
and then a different conf setup for nighttime image capture
aquire_cmd = raspistill -q 20 -n -th none -p 1000,0,600,450 -w 1600 -h 1200 -o /ramdisk/out%05d.jpg -t 0 -tl 3000 -ISO 800 -ss 3000000 -br 80 -co 100
My current work around was to terminate the existing daemon, copy over the conf with a nighttime template at a certain time, then do the reverse in the mornings.
I've been tinkering with the code a little to get this to run on a Pi running the latest version of Raspberry Pi OS with a Pi Camera Module v3 and haven't had any luck. From what I understand libcamera-still
should mostly be a drop in replacement for raspistill
. I tried updating the acquire_cmd
in the conf file and then replaced various references to raspistill
in src/start_raspistill.c and I was still seeing some errors on startup.
Hello Dacian.
I'm trying to reinstall imgcomp with the updated libcamera-still instead of raspistill but I'm facing problem to access the apache server.
It keeps sending me back the same message : Forbidden You don't have permission to access this resource. Apache/2.4.59 (Raspbian) Server at 192.168.1.40 Port 80.
I ran a full new install of imgcomp on the Pi.
Would you have any idea or advice maybe to properly reinstall from the begining ?
It would be nice to have this as an option for those already using it to save the complexity of running two web servers.
PS - as a long time MotionEye user - I like this a lot Matthias, particularly your “actagram”!
Would you like to add more error handling for return values from functions like the following?
Great software btw.
One minor issue so far; after activating the Web interface , I then click on the "Realtime" link and get a popup message saying "Error! No log.txt file"
The photo does appear after dismissing the popup.
Browser is Firefox v 77 on windows 10. Raspberry Pi model 3 model B.
Regards,
Peter
Hi,
Just a suggestion here. It would be convenient to have the ability to delete image directories from the browser. I’ve looked at the browsing source code, but I’m just not proficient enough in c to modify the code to add the functionality.
Hi
How do you make it start when the Pi boots?
I suggest to add the key word “const” to the type specifiers for parameters like the following.
Would you like to apply the advices from an article to more places in your source files?
After upgrade to current version, getting the below error and showpic.js is not displaying image. typed "make" in /imgcomp/browse as per above issue which solved bargraph not appearing. Problem in Firefox and chrome on Debian Buster, Windows chrome and FF also
any ideas?
Uncaught ReferenceError: ShwH is not defined PicMouse http://192.168.5.33/showpic.js:220 picMouseMove http://192.168.5.33/showpic.js:347
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.