connortechnology / ZoneMinder

ZoneMinder is a free, open source Closed-circuit television software application developed for Linux which supports IP, USB and Analog cameras.
http://www.zoneminder.com/
GNU General Public License v2.0
9 stars 9 forks source link

Only load imageFeed if needed #26

Closed digital-gnome closed 6 years ago

digital-gnome commented 6 years ago

When an event uses video.js to play the video file the page still loads the imageFeed div and hides it. This triggers nph-zms to use a lot of resources to render an invisible duplicate video. I made the entire imageFeed block conditional.

connortechnology commented 6 years ago

There used to be a reason for it to be there. I forget what now. Ideally a person should be able to switch between the video.js and the non-video .js view. But that should probably be done in a dynamic content way. I'll have to look more closely before I go merging.

digital-gnome commented 6 years ago

I figured there was a reason, I just couldn't find it. I thought it was meant as a backup if the browser couldn't play the video type but there doesn't seem to be anything to trigger that. I can say that removing it hasn't caused any problems for me so far.

I noticed it because when I'm running near capacity on load watching videos would start to crash things. When nph-zms would eat enough cpu on 1080p streams I'd get zma crashing which would leave /dev/shm full and then the whole thing was a mess.

It should be simple enough to dump the imageFeed content into a javascript var and swap it out on request. I'm sure there's a more elegant way to do it but it would probably work with minimal changes.

connortechnology commented 6 years ago

We can always put it back. I really appreciate your help btw.

digital-gnome commented 6 years ago

Oh good. Trying to wrap that in js was uglier than I thought. It really wants something more in depth to switch properly. Honestly I can't imagine wanting to use the older way.

Glad I can help.