Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add timestamp to capture #86

Open
drtorchwood opened this issue Jan 9, 2021 · 4 comments
Open

Add timestamp to capture #86

drtorchwood opened this issue Jan 9, 2021 · 4 comments
Labels
enhancement New feature or request wontfix This will not be worked on
Milestone

Comments

@drtorchwood
Copy link

drtorchwood commented Jan 9, 2021

Hi there,

I use my unix machine to take regular captures with wget -O capture_$(date) <ip>/capture. In principle, this is fine but I would be great if the time would not only be part of the filename but directly printed in the picture. Alternatively, it might be added to the exif data of the file.

Perhaps (if at some time an ntp module is included) this feature could be added. Thanks!

@easytarget
Copy link
Owner

easytarget commented Jan 21, 2021

Good suggestion, I'd considered this before as I started this project, and decided it was not possible due to memory constraints.

But now I know the code better; I think it is entirely possible to write to the framebuffer before sending images and streams. This is (after all) done for face recognition to put boxes and labels on detected items. So the code is (sorta) already present.

Something for V4, I'll add this to the issues for that.

Meanwhile...

I also capture images on my home server, I do the timestamping on the server side;

Here is an adapted fragment of the script I use (my actual script serves multiple cameras and does some additional sanity/error checking, archive cleaning, and logging)

# Note; this is a bash script for FreeBSD, toolpaths will differ on linux; see comments
# 'convert' is part of the ImageMagick toolset

set URI= http://1.2.3.4/capture/
set CAMERA = Workshop                     # camera name! No spaces...
set TIME = `date "+%d-%b-%Y"`
set DATE = `date "+%H:%M"`
set CONVERT = /usr/local/bin/convert     # /usr/bin/convert on linux
set WGET = /usr/local/bin/wget                # /usr/bin/wget on linux
set CAMHOME = /home/cam/$CAMERA/

$WGET --no-check-certificate --no-verbose "$URI" --output-document=$CAMHOME/capture.jpg

if ( $? == 0 ) then
    convert -quiet $CAMHOME/capture.jpg -gravity South -pointsize 16 -fill White -undercolor Black 
-annotate +0+10 "$CAMERA    $DATE $TIME" $CAMHOME/webcam.jpg
    cp $CAMHOME/webcam.jpg $CAMHOME/archive/$DATE-$TIME.jpg
else 
    cp -f $CAMHOME/webcam-fail-image.jpg $CAMHOME/webcam.jpg
endif

Edit: One advantage of this is control over position, background blending and size. Plus; the standard font used by ImageMagic is quite nice, but if I wanted to change fonts, orientation, etc it is easy; https://legacy.imagemagick.org/Usage/text/#text_operators

@easytarget easytarget added the enhancement New feature or request label Jan 21, 2021
@easytarget easytarget added this to the V4 milestone Jan 21, 2021
@easytarget
Copy link
Owner

See also #38

@Semmu
Copy link

Semmu commented Apr 11, 2021

also take a look at fswebcam, as it can do timestamping too.

Repository owner deleted a comment from flaviopuhl Dec 15, 2021
@easytarget easytarget added the wontfix This will not be worked on label Dec 9, 2024
@easytarget
Copy link
Owner

Still a good idea, but wont be worked on now.
I am leaving this issue open for reference; although I am archiving the project

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants