[SOLVED] Monitoring high resolution/high fps feed
Posted: Fri Feb 17, 2017 3:13 am
I am using Ubuntu 14.04LTS, with ZoneMinder 1.30.2.
I used the easy install method (then upgraded using ppa Zoneminder-master, as only 1.26.5 was available on stable, for 14.04) EDIT: I realise now that 1.30.0 was only temporarily not available for 14.04 when I was trying to get a current version, with only the software center version available at the time. When I check the stable ppa now, trusty is there with 1.30.0. I have stopped subscribing to the zoneminder-master ppa, so will just get upgrades from the stable ppa from now. However, this problem existed with my previous install that was a recent version, possibly 1.30.0, or the previous version to that on the stable ppa. The reinstall had to do with an ubuntu issue, where I had to reinstall many things, not specifically to do with the issue listed below. END OF EDIT.
I have got various cameras and setups to work without issue, but I am not an expert, so I can't get rid of this one issue.
My intended use is to VIEW ONLY, with no motion detection or recording needed (I will do that through other means).
My understanding is that this should be done with the "Monitor" function. I don't need the pause and rewind functions, I just want to view the feed live. I want to have the monitor window open during waking hours. This works, with one caveat.
This concerns my main camera, a foscam R2 (V3) (running as a remote rtsp/unicast (EDIT: same results with remote rtp/rtsp and Ffmpeg rtp/rtsp, btw)--other values in monitor setup as default), which I want to use high resolution for my viewing (sometimes 720p and sometimes 1080p), and I believe my computer can handle high fps, since it works with both VLC and Xeoma. The camera's Mainstream is set at 1080p/25fps and the Substream is 720p/11fps. When I initiate a viewing window, all runs smoothly.
Then (based on logging of the capture) after 2000 captured frames or so, the problem starts.
I have a constant system monitor on my gnome panel, and I see that moderate activity is being written to disk. Then after 3000 captured frames, this becomes worse and so on. It ends up having 60% or more of the disk in use, for minutes at a time. Which is obviously not a good thing. And of course using the disk constantly ends up causing the computer to heat up over time.
I believe this is because there is not enough memory being used, and so it is writing to disk instead. But I have 16GB memory, as well as the same in SWAP, even when most is not used, this still occurs. I've hunted for a solution, and the closest thing that I've stumbled upon that might affect this is the setting FRAME_SOCKET_SIZE, but I can't find any example values for when the default 0 doesn't work. It suggests:
"You can use
this option to indicate that a larger buffer size should be used. Note
that you may have to change the existing maximum socket buffer size on
your system via sysctl (or in /proc/sys/net/core/wmem_max) to allow
this new size to be set"
But I really don't know enough about this to mess around with the system settings without advice, even though I tried to read up on it. So I don't want to experiment, unless I know that this definitely is the issue, or at least what values might be good to try.
The camera itself works, when this problem shows up, Zoneminder doesn't produce any errors, just states something like "2017-02-16 20:55:34.020023 zmc_m13 12095 INF HumLANSub: 6000 - Capturing at 11.36 fps zm_monitor.cpp 3125" every few minutes.
Looking through my log shows lots of errors, but they are from when I was trying to fix this by changing settings, and then changing back. If I restart my zoneminder, and then just view a camera, I don't think it has any errors to show something is going wrong. If someone wants me to perform certain actions, and then post the log, I can do that.
If the above setting is relevant, my cat /proc/sys/net/core/wmem_max is 212992
If any one can give me any advice, suggestions or help, I would really appreciate it. I want to get this camera viewing smoothly before the return period is up. I'm not a linux expert, but I do use Ubuntu pretty much exclusively.
Thanks in advance
Edit: There are some warnings and errors when starting up the monitor, but while viewing, there are only the logs listed above. However I'm attaching a log showing the errors and warnings as well. This is with the R2 camera @720p/11fps and a low fps/620x480 res android phone turned ip cam (both in a dark room, so no activity) . Each with a window open, in monitoring state.
I used the easy install method (then upgraded using ppa Zoneminder-master, as only 1.26.5 was available on stable, for 14.04) EDIT: I realise now that 1.30.0 was only temporarily not available for 14.04 when I was trying to get a current version, with only the software center version available at the time. When I check the stable ppa now, trusty is there with 1.30.0. I have stopped subscribing to the zoneminder-master ppa, so will just get upgrades from the stable ppa from now. However, this problem existed with my previous install that was a recent version, possibly 1.30.0, or the previous version to that on the stable ppa. The reinstall had to do with an ubuntu issue, where I had to reinstall many things, not specifically to do with the issue listed below. END OF EDIT.
I have got various cameras and setups to work without issue, but I am not an expert, so I can't get rid of this one issue.
My intended use is to VIEW ONLY, with no motion detection or recording needed (I will do that through other means).
My understanding is that this should be done with the "Monitor" function. I don't need the pause and rewind functions, I just want to view the feed live. I want to have the monitor window open during waking hours. This works, with one caveat.
This concerns my main camera, a foscam R2 (V3) (running as a remote rtsp/unicast (EDIT: same results with remote rtp/rtsp and Ffmpeg rtp/rtsp, btw)--other values in monitor setup as default), which I want to use high resolution for my viewing (sometimes 720p and sometimes 1080p), and I believe my computer can handle high fps, since it works with both VLC and Xeoma. The camera's Mainstream is set at 1080p/25fps and the Substream is 720p/11fps. When I initiate a viewing window, all runs smoothly.
Then (based on logging of the capture) after 2000 captured frames or so, the problem starts.
I have a constant system monitor on my gnome panel, and I see that moderate activity is being written to disk. Then after 3000 captured frames, this becomes worse and so on. It ends up having 60% or more of the disk in use, for minutes at a time. Which is obviously not a good thing. And of course using the disk constantly ends up causing the computer to heat up over time.
I believe this is because there is not enough memory being used, and so it is writing to disk instead. But I have 16GB memory, as well as the same in SWAP, even when most is not used, this still occurs. I've hunted for a solution, and the closest thing that I've stumbled upon that might affect this is the setting FRAME_SOCKET_SIZE, but I can't find any example values for when the default 0 doesn't work. It suggests:
"You can use
this option to indicate that a larger buffer size should be used. Note
that you may have to change the existing maximum socket buffer size on
your system via sysctl (or in /proc/sys/net/core/wmem_max) to allow
this new size to be set"
But I really don't know enough about this to mess around with the system settings without advice, even though I tried to read up on it. So I don't want to experiment, unless I know that this definitely is the issue, or at least what values might be good to try.
The camera itself works, when this problem shows up, Zoneminder doesn't produce any errors, just states something like "2017-02-16 20:55:34.020023 zmc_m13 12095 INF HumLANSub: 6000 - Capturing at 11.36 fps zm_monitor.cpp 3125" every few minutes.
Looking through my log shows lots of errors, but they are from when I was trying to fix this by changing settings, and then changing back. If I restart my zoneminder, and then just view a camera, I don't think it has any errors to show something is going wrong. If someone wants me to perform certain actions, and then post the log, I can do that.
If the above setting is relevant, my cat /proc/sys/net/core/wmem_max is 212992
If any one can give me any advice, suggestions or help, I would really appreciate it. I want to get this camera viewing smoothly before the return period is up. I'm not a linux expert, but I do use Ubuntu pretty much exclusively.
Thanks in advance
Edit: There are some warnings and errors when starting up the monitor, but while viewing, there are only the logs listed above. However I'm attaching a log showing the errors and warnings as well. This is with the R2 camera @720p/11fps and a low fps/620x480 res android phone turned ip cam (both in a dark room, so no activity) . Each with a window open, in monitoring state.