Page 1 of 1

Capture one frame minute overwriting the previous one

Posted: Wed Jan 27, 2021 7:20 am
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

Re: Capture one frame minute overwriting the previous one

Posted: Wed Jan 27, 2021 9:35 am
by Magic919
Is there a reason to do this rather than grab a JPEG once a minute?

Re: Capture one frame minute overwriting the previous one

Posted: Wed Jan 27, 2021 4:25 pm
by LastStarDust
Not really, so the next question is how to grab a JPEG once a minute?

Re: Capture one frame minute overwriting the previous one

Posted: Wed Jan 27, 2021 4:38 pm
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

Re: Capture one frame minute overwriting the previous one

Posted: Wed Jan 27, 2021 5:34 pm
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

Re: Capture one frame minute overwriting the previous one

Posted: Thu Jan 28, 2021 5:54 am
by LastStarDust
Thank you for the hints. That seems pretty straightforward. I will try.