Record High-res H264 streams 24/7 with low CPU Load
Re: Record High-res H264 streams 24/7 with low CPU Load
@iconnor That is great news. Is 1.35 stable going to be released any time soon?
Re: Record High-res H264 streams 24/7 with low CPU Load
@iconnor
In record mode with analysis and decoding disabled, I get buffer errors "Buffer too small" etc. I can't increase the buffers to the requested size because they're too large (9GB for 4K cams@ 20fps). If fast, resource friendly recording is the goal of these two new options, disabling buffering altogether and writing the stream straight to disk is preferable, no? If not, the script is still the better option, here.
*** If you've upgraded to 1.35:
The script will fail to create proper filenames due to database column renaming. Replace instances of "StartTime" with "StartDateTime" and "EndTime" with "EndDateTime".
Re: Record High-res H264 streams 24/7 with low CPU Load
reduced ram requirements is coming soon.
Re: Record High-res H264 streams 24/7 with low CPU Load
Been playing with this script for a few days, and made some additions. It's a bit rough, but thought I'd post a diff regardless.
Changes:
- record audio on /off toggle
- 'linked monitor' id
- update Events row with 1 alarm frame, if an alarm happens on 'linked monitor'
- insert of 1 frame on start, so you can watch the event via the GUI
- bulk/etc frames inserted upon stream completion
- mysql auth/password in script
- upon start, name='New Event', which then changes to the desired event prefix upon completion
Why the alarm frames, and New Event change? The alarm frames help me with filters + deleting, as I want to keep alarm events longer. New Events text is something else I can filter against, to ensure I do not delete streaming events.
The 1 frame on start allows me to go into Events and start streaming a new event. For whatever reason, I needed this for it to work.
Not sure if further changes are forthcoming, although there is still some tidy up work to do.
Changes:
- record audio on /off toggle
- 'linked monitor' id
- update Events row with 1 alarm frame, if an alarm happens on 'linked monitor'
- insert of 1 frame on start, so you can watch the event via the GUI
- bulk/etc frames inserted upon stream completion
- mysql auth/password in script
- upon start, name='New Event', which then changes to the desired event prefix upon completion
Why the alarm frames, and New Event change? The alarm frames help me with filters + deleting, as I want to keep alarm events longer. New Events text is something else I can filter against, to ensure I do not delete streaming events.
The 1 frame on start allows me to go into Events and start streaming a new event. For whatever reason, I needed this for it to work.
Not sure if further changes are forthcoming, although there is still some tidy up work to do.
- Attachments
-
- f4d305996756336ff85d6f5ea1fb4c76.zmrecord.sh.diff.gz
- (2.92 KiB) Downloaded 336 times
Re: Record High-res H264 streams 24/7 with low CPU Load
Hello. Something does not want to be added to my service. Or I misunderstood. How to enable for all cameras?
Or do you need each one separately?
Code: Select all
# systemctl start zmrecord @ <MonitorID ..>. service
bash: MonitorID ..: No such file or directory
Re: Record High-res H264 streams 24/7 with low CPU Load
A second diff. A minor fix.
Frames update/info wasn't done, if a linked camera wasn't provided. Now it is.
Frames update/info wasn't done, if a linked camera wasn't provided. Now it is.
- Attachments
-
- f4d305996756336ff85d6f5ea1fb4c76.zmrecord.sh.rev2.diff.gz
- (341 Bytes) Downloaded 347 times
Re: Record High-res H264 streams 24/7 with low CPU Load
The readme.txt shows how to do this. There are examples right at the end of the file.Cramac1 wrote: ↑Sat Mar 27, 2021 6:48 am Hello. Something does not want to be added to my service. Or I misunderstood. How to enable for all cameras?Or do you need each one separately?Code: Select all
# systemctl start zmrecord @ <MonitorID ..>. service bash: MonitorID ..: No such file or directory
Re: Record High-res H264 streams 24/7 with low CPU Load
Another small fix. Sometimes, I'd end up with a 0 prefacing the frame count remainder. This would get interpreted as octal.
- Attachments
-
- f4d305996756336ff85d6f5ea1fb4c76.zmrecord.sh.rev3.diff.gz
- (229 Bytes) Downloaded 323 times
Re: Record High-res H264 streams 24/7 with low CPU Load
but did not think how to show an online picture?
tried ffmpeg
but it loads the cpu
tried ffmpeg
Code: Select all
ffmpeg -i "'.$cam.'" -b:v 2048k -crf 50 -f mpjpeg pipe:
Re: Record High-res H264 streams 24/7 with low CPU Load
You're not really reading, or at least understanding the documentation here. You might also be thinking this is for something other than it is for.
This might not be right for you.
This might not be right for you.
Re: Record High-res H264 streams 24/7 with low CPU Load
this is not a question for this script. If you run it, instead of zmс, access to online viewing of the picture from the camera is lost.
Or is it just me?
works view through https://video.site/zm/cgi-bin/nph-zms ?
Re: Record High-res H264 streams 24/7 with low CPU Load
Hello!
I'm trying to use this script on a zoneminder 1.35.21 setup. I've applied the patched from @bbarnett as well the correction mentioned by @ernball.
BTW I'm getting:
Ideas?
Thanks!
Simon
I'm trying to use this script on a zoneminder 1.35.21 setup. I've applied the patched from @bbarnett as well the correction mentioned by @ernball.
BTW I'm getting:
Code: Select all
TS: FPS: BW: FRAME:
ERROR 1366 (22007) at line 1: Incorrect decimal value: '' for column `zm`.`Monitor_Status`.`CaptureFPS` at row 1
Thanks!
Simon
Re: Record High-res H264 streams 24/7 with low CPU Load
Sorry, I'm back on 1.23.
Re: Record High-res H264 streams 24/7 with low CPU Load
Uh, far away from me. BTW Meanwhile I've noticed that my test cam has not audio, but looking to the vlc stream it seems to have it, so I've added it and now it works, at least in recording. BTW the events are correctly shown in the event view, but they are not shown in the console view.
The console view is not reporting even numbers and not the size as well. I'll look in the script if there are some failed queries.
So the linked monitor is not used correctly as well.
Meanwhile thanks for any suggestion.
Simon
The console view is not reporting even numbers and not the size as well. I'll look in the script if there are some failed queries.
So the linked monitor is not used correctly as well.
Meanwhile thanks for any suggestion.
Simon
Re: Record High-res H264 streams 24/7 with low CPU Load
Just to be clear.. there are three patches to apply, on top of the initial post.xefil wrote: ↑Sat Apr 10, 2021 11:16 am Uh, far away from me. BTW Meanwhile I've noticed that my test cam has not audio, but looking to the vlc stream it seems to have it, so I've added it and now it works, at least in recording. BTW the events are correctly shown in the event view, but they are not shown in the console view.
The console view is not reporting even numbers and not the size as well. I'll look in the script if there are some failed queries.
So the linked monitor is not used correctly as well.
Meanwhile thanks for any suggestion.
Simon
There was another post about changes with mysql/a new version of ZM, so not sure on that. Also, you are running on the command line? It will help, and show potentially more info. Lastly, there is a debug switch, which I might have used or not (sorry)... and there may be some commented out echos for debugging...