Capture one frame minute overwriting the previous one

Forum for questions and support relating to the 1.34.x releases only.
Post Reply
LastStarDust
Posts: 3
Joined: Wed Jan 27, 2021 6:58 am

Capture one frame minute overwriting the previous one

Post by LastStarDust »

Hello!
I know this very question or something similar has been asked before here viewtopic.php?f=5&t=6049 and here viewtopic.php?f=5&t=6049. However even after reading those threads, I still cannot understand where to set the FPS.

I would like to record one frame per minute from a webcam and store it locally. The same JPEG file should be overwritten over and over.
If I click on the camera in the console view I can correctly see the video. If I fiddle with the Mocord mode, I can see that events are created inside the local folder but only when something moves (I guess) ...

What I am asking is: is it possible to do this in ZoneMinder? If so, where should I tweak the FSP?

Here you can take a look at the configuration of the camera: https://photos.app.goo.gl/nfiGLPWbyKxZcgV56.

Other info:
  • ZoneMinder version: v1.34.22
  • OS: Centos 7
  • Camera: Reolink E1 pro
  • Connection: wired ethernet
  • Camera resolution and frame rate: 1920x1080 4fps
Magic919
Posts: 1381
Joined: Wed Sep 18, 2013 6:56 am

Re: Capture one frame minute overwriting the previous one

Post by Magic919 »

Is there a reason to do this rather than grab a JPEG once a minute?
-
LastStarDust
Posts: 3
Joined: Wed Jan 27, 2021 6:58 am

Re: Capture one frame minute overwriting the previous one

Post by LastStarDust »

Not really, so the next question is how to grab a JPEG once a minute?
Magic919
Posts: 1381
Joined: Wed Sep 18, 2013 6:56 am

Re: Capture one frame minute overwriting the previous one

Post by Magic919 »

Run the wget command as a cronjob once a minute.

Code: Select all

* * * * * /usr/bin/grab_the_jpegs.sh
Put the wget command in a little script for ease.

Code: Select all

wget https://<url to grab the jpegs> -O oneframe.jpeg
-
User avatar
knight-of-ni
Posts: 2406
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: Capture one frame minute overwriting the previous one

Post by knight-of-ni »

Here is the script I run via cron to upload photos from one of my outdoor cameras to weather underground:

Code: Select all

#!/bin/bash
# This scripts takes a snapshot of a zoneminder camera and uploads it to
# weather underground

# User variables
SNAP_URL="https://{server name or ip}/cgi-bin-zm/zms?mode=single&monitor={id}&user={zmuser}&pass={zmpwd}"
FTP_USER="ftpusername"
FTP_PWD="ftppwd"
FTP_SITE="webcam.wunderground.com"

# required binaries
WGET="/usr/bin/wget"
CURL="/usr/bin/curl"

# Check to see if this script has access to all the commands it needs
for CMD in $CURL $WGET; do
  type $CMD &> /dev/null

  if [ $? -ne 0 ]; then
    echo
    echo "ERROR: The script cannot find the required command \"${CMD}\"."
    echo
    exit 1
  fi
done

# Grab a snapshot from zoneminder
echo
echo "Using wget to grab a snapshot from the zoneminder server..."
echo

$WGET ${SNAP_URL} -O /tmp/image.jpg

if [ $? -ne 0 ]; then
    echo
    echo "Wget Failed!"
    echo
    exit 99
else
    echo
    echo "Success!"
    echo
fi

# Upload to weather underground's ftp site using my credentials
echo
echo "Using curl to upload snapshot to weather underground..."
echo
$CURL -T /tmp/image.jpg ftp://${FTP_USER}:${FTP_PWD}@${FTP_SITE}

if [ $? -ne 0 ]; then
    echo
    echo "Curl Failed!"
    echo
else
    echo
    echo "Success!"
    echo
fi
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
LastStarDust
Posts: 3
Joined: Wed Jan 27, 2021 6:58 am

Re: Capture one frame minute overwriting the previous one

Post by LastStarDust »

Thank you for the hints. That seems pretty straightforward. I will try.
Post Reply