Based on zmeventnotification docs mentioning that OpenCV 4.1.1 is the minimum version I'm going to assume this is also the case with zmMagik.
Following this manual (
https://docs.opencv.org/master/d7/d9f/t ... stall.html) I ended up with ModuleNotFoundError: No module named 'cv2' - at this point I don't know how to fix it so I searched for more tutorials...
Following this manual (
https://docs.opencv.org/master/d2/de6/t ... buntu.html) worked, although I ended up with the latest dev-version. During the installation steps I chose
-python3
-gtk3
-no optional dependencies
Result:
>>> import cv2 as cv
>>> print(cv.__version__)
4.3.0-dev
So after I had a working(?) OpenCV & zmMagik installation, I went ahead and tried to run
Code: Select all
python3 ./magik.py --monitors=7 --from "yesterday, 7am" --to "today, 10pm" --blend -c config.ini
and got
Code: Select all
2020-05-29 07:00:00
It looks like your OpenCV version does not include bgsegm. Switching to createBackgroundSubtractorMOG2
Background subtraction initialized
Detection mode is: background_extraction
-----| Arguments to be used:
config=config.ini
input=None
find=None
mask=None
skipframes=1
trailframes=10
blenddelay=2
fps=10
threshold=0.7
confidence=0.6
all=False
write=False
interactive=False
eventid=None
username=zmmagik
password=zmmagik
portal=http://localhost/zm
detection_type=background_extraction
config_file=None
weights_file=None
labels_file=None
meta_file=None
gpu=False
use_opencv_dnn_cuda=False
darknet_lib=None
from=2020-05-29 07:00:00
to=2020-05-30 22:00:00
monitors=7
resize=None
dumpjson=False
annotate=False
blend=True
detectpattern=.*
relevantonly=True
drawboxes=False
minblendarea=1500
fontscale=1
download=True
display=False
show_progress=True
objectonly=False
alarmonly=False
minalarmframes=1
duration=0
balanceintensity=False
present=True
Getting list of events using: http://localhost/zm/api/events/index/StartTime >=:2020-05-29 07:00:00/EndTime <=:2020-05-30 22: 00:00/MonitorId =:7.json?sort=StartTime&direction=asc&username=zmmagik&password=zmmagik
Traceback (most recent call last):
File "./magik.py", line 218, in <module>
process_timeline()
File "./magik.py", line 77, in process_timeline
events = resp.json()['events']
KeyError: 'events'
So I tried a different method
Code: Select all
python3 ./magik.py --monitors=7 --eventid 101 --blend -c config.ini
And got a different result
Code: Select all
It looks like your OpenCV version does not include bgsegm. Switching to createBackgroundSubtractorMOG2
Background subtraction initialized
Detection mode is: background_extraction
-----| Arguments to be used:
config=config.ini
input=None
find=None
mask=None
skipframes=1
trailframes=10
blenddelay=2
fps=10
threshold=0.7
confidence=0.6
all=False
write=False
interactive=False
eventid=101
username=zmmagik
password=zmmagik
portal=http://localhost/zm
detection_type=background_extraction
config_file=None
weights_file=None
labels_file=None
meta_file=None
gpu=False
use_opencv_dnn_cuda=False
darknet_lib=None
from=None
to=None
monitors=7
resize=None
dumpjson=False
annotate=False
blend=True
detectpattern=.*
relevantonly=True
drawboxes=False
minblendarea=1500
fontscale=1
download=True
display=False
show_progress=True
objectonly=False
alarmonly=False
minalarmframes=1
duration=0
balanceintensity=False
present=True
Downloading video from url: http://localhost/zm/index.php?view=view_video&eid=101&username=zmmagik&password=zmmagik
Blending: 101.mp4
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x2989260] moov atom not found
[ WARN:0] global /home/zonem/opencv/modules/videoio/src/cap_gstreamer.cpp (1745) handleMessage OpenCV | GStreamer warning: yo ur GStreamer installation is missing a required plugin
[ WARN:0] global /home/zonem/opencv/modules/videoio/src/cap_gstreamer.cpp (1761) handleMessage OpenCV | GStreamer warning: Em bedded video playback halted; module uridecodebin0 reported: Your GStreamer installation is missing a plug-in.
[ WARN:0] global /home/zonem/opencv/modules/videoio/src/cap_gstreamer.cpp (888) open OpenCV | GStreamer warning: unable to st art pipeline
[ WARN:0] global /home/zonem/opencv/modules/videoio/src/cap_gstreamer.cpp (480) isPipelinePlaying OpenCV | GStreamer warning: GStreamer: pipeline have not been created
Traceback (most recent call last):
File "./magik.py", line 245, in <module>
res = zmm_blend.blend_video(input_file=g.args['input'], out_file=g.out_file, eid=g.args['eventid'], mid=None, starttime=N one, delay=g.args['blenddelay'])
File "/home/zonem/zmMagik/zmMagik_helpers/blend.py", line 72, in blend_video
raise ValueError('Error reading video {}'.format(utils.secure_string(input_file)))
ValueError: Error reading video 101.mp4
I think I'm going to continue by trying to study more about this OpenCV/GStreamer issue, but if anyone has the cheat codes to get this thing going I would very much appreciate it