can ZM work from a saved file, not a stream?

Forum for questions and support relating to the 1.26.x releases only.
Locked
jbeale
Posts: 1
Joined: Tue Sep 30, 2014 2:14 pm

can ZM work from a saved file, not a stream?

Post by jbeale »

I just installed ZM 1.26.5 running on Ubuntu and my first test with a Logitech HD720p webcam works fine. I am wondering if ZM can work from a file saved on disc, instead of a live stream. That is, if I tell ZM the frame rate and the start time of the file, can it go through and do motion-detection on it?

I have a Raspberry Pi which has a good quality 5Mpix camera. I have a program that saves two files simultaneously (high-res H264 format and low-res MJPEG format) but I don't know how to stream the MJPEG in that mode. There is mjpeg-streamer to make it like a basic webcam but I want to keep the high-res file also, so I can get the full detail from a given frame.

if anyone's curious, here is the program that saves two resolutions at once. for 1 hour:

Code: Select all

#!/usr/bin/python
# Python program for Raspberry Pi using picamera library
    import picamera

    with picamera.PiCamera() as camera:
        camera.resolution = (1920, 1080)
        camera.framerate = 8
        camera.annotate_background = True # black rectangle behind white text for readibility
        camera.annotate_frame_num = True # set 'True' if we should show the frame number on the video
        camera.start_recording('highres.h264')
        camera.start_recording('lowres.mjpeg', splitter_port=2, format='mjpeg', resize=(256, 144))
        camera.wait_recording(3600)
        camera.stop_recording(splitter_port=2)
        camera.stop_recording()
Nerre
Posts: 100
Joined: Thu Sep 25, 2014 10:22 am

Re: can ZM work from a saved file, not a stream?

Post by Nerre »

Do you need to save the stream zoneminder uses? Zoneminder can use File as a source, but from what I understand the file must be a JPEG and not a video.

If you can make it save one frame at a time as JPEG instead of the MJPEG stream you should be set.
mikb
Posts: 661
Joined: Mon Mar 25, 2013 12:34 pm

Re: can ZM work from a saved file, not a stream?

Post by mikb »

Nerre wrote:Zoneminder can use File as a source, but from what I understand the file must be a JPEG and not a video.
Untrue, at least in 1.25 -- I used a many-minute example video from my cameras as input to fine-tune the motion detection, running the same video through over and over until it was reliably detecting stuff (and ignoring little things). The video had a hand-selected set of "events" that should have been picked up, for test purposes.

According to my notes, a raw "MJPEG" file returned from the camera (at 5FPS, 640x480) was dumped into a temp file, then

Set up a camera called "FileTest" with Source type: FFMPEG and FPS "5/5" to control rate to match camera (or 25/25 to test at faster than real time). When camera is set to "monitor" or "modetect", input file is processed as events. Return camera to mode "none" to reset.
Locked