Page 1 of 1

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

Posted: Tue Sep 30, 2014 2:51 pm
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()

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

Posted: Thu Oct 02, 2014 1:16 pm
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.

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

Posted: Thu Oct 02, 2014 6:00 pm
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.