Zoneminder Storage space reduction settings - SOLVED

Discussions related to the 1.36.x series of ZoneMinder
Post Reply
erew
Posts: 10
Joined: Wed May 06, 2020 4:39 pm

Zoneminder Storage space reduction settings - SOLVED

Post by erew »

UPDATE - This is solved a few posts down this page
EXAMPLE.jpg
EXAMPLE.jpg (23.86 KiB) Viewed 3282 times
Sorry for sounding salty, but I am really struggling here......

I made this post a couple of months ago (if you want more detail) viewtopic.php?t=31506

Long and short is, I upgraded from an earlier version of ZM to 1.36.x and all of a sudden, my 1080p recordings size went up by a factor of 10x

So what was a 1.7mb file for 10 seconds, is now a 50mb file for 10 seconds. The quality looks the same, but my storage is crippled to hell.

So whereas I could record weeks of video, I can barely squeeze out 1 day now.

What gets me, is I can download a video off the internet that lasts 5 minutes, at 1080p 23FPS, with audio and the size of the video is about 120mb. Currently, 120MB at 1080p 10FPS is is about 20 seconds in ZM without audio. This is clearly not right!!

Please Please, if anyone can, help me with this......I cannot figure out for the life of me how to get FFMPEG to compress/record correctly

If anyone will take pity to help me...

I am on UBUNTU 20.xx
I have an Intel 5100 (6th gen processor capable of H264 encoding)
ffmpeg version 4.2.4-1ubuntu0.1
Zoneminder is v1.36.12
Camera source, is a standard HTTP stream from a RaspberryPi @ 1080p 10 fps, no audio.

Because none of the settings I put into either ZM > Camera > Storage > Optional Encoder Parameters OR Zm > Options > Images > FFMPEG_OUTPUT_OPTIONS seems to provide any benefit, things are just back at standard crf=23 settings.

Can anyone help, please please please? Or should I just give up on ZM?

Thanks
Last edited by erew on Sun Feb 20, 2022 7:17 pm, edited 3 times in total.
User avatar
Andyrh
Posts: 247
Joined: Sat Oct 28, 2017 3:55 am

Re: Giving up on ZM? Or can someone help me?

Post by Andyrh »

Camera | Storage | Save JPEGs <- uses extra space if enabled. Mine is disabled
Options | Images | JPEG_ALARM_FILE_QUALITY <- this controls the compression on the event and will affect the size. Mine is set to 100.

Those are the only 2 I know that will affect the event size.

I do not know if it affects size, but:
Camera | Storage | Video Writer is set to: Camera Passthrough

I have a 91 frame event and it is 6.48MB on a 3MP camera.
Andy
o||||o

Ubuntu 22.04
ZM 1.36.33
E5-1650-v4 Xeon
16 GB RAM
6 cameras -> 54 FPS modect
SkippyDo
Posts: 221
Joined: Mon Nov 20, 2017 6:49 pm

Re: Giving up on ZM? Or can someone help me?

Post by SkippyDo »

Reduce your FPS. 10 is rather high. I'm running at 5 (and this is probably higher than needed).
User avatar
Andyrh
Posts: 247
Joined: Sat Oct 28, 2017 3:55 am

Re: Giving up on ZM? Or can someone help me?

Post by Andyrh »

Reducing the frame rate will make the event smaller, but will not help the fact there is a 10x difference for the same number of frames when compared to mine.
Andy
o||||o

Ubuntu 22.04
ZM 1.36.33
E5-1650-v4 Xeon
16 GB RAM
6 cameras -> 54 FPS modect
Magic919
Posts: 1381
Joined: Wed Sep 18, 2013 6:56 am

Re: Giving up on ZM? Or can someone help me?

Post by Magic919 »

I'm presuming OP is capturing MJPEG as it's "HTTP from a Pi".

I've run some tests on my typical 30 seconds of H.264 video pulled out of ZM.

Original file - 22M 311910-video.mp4

Convert to MJPEG (quality 3 is quite high)

Code: Select all

ffmpeg -i 311910-video.mp4 -c:v mjpeg -q:v 3 -an mjpeg_test.mov
391M mjpeg_test.mov

Convert to H.264 with CRF 23

Code: Select all

ffmpeg -i mjpeg_test.mov -c:v libx264 -crf 23 -an 264_test.mp4
45M 264_test.mp4

Convert to H.264 but constrain to about 2Mbps.

Code: Select all

ffmpeg -i mjpeg_test.mov -c:v libx264 -b:v 2M -maxrate 2M  -an 264_test_2M.mp4
8.1M 264_test_2M.mp4
-
User avatar
iconnor
Posts: 2904
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Giving up on ZM? Or can someone help me?

Post by iconnor »

You aren't reading his previous post, which is why we don't start new post when we don't get a satisfactory answer.

He is encoding without bothering to set any encoding settings. He needs to read the docs on the encoder he is using and set things accordingly.

Or just use Passthrough.
erew
Posts: 10
Joined: Wed May 06, 2020 4:39 pm

Re: Giving up on ZM? Or can someone help me?

Post by erew »

SkippyDo wrote: Thu Feb 17, 2022 5:06 pm Reduce your FPS. 10 is rather high. I'm running at 5 (and this is probably higher than needed).
This is the solution that worked.

I did try multiple encoder settings, having to give it time between each one to see what the overall result was.

Whilst I have adjusted the CRF= to a higher number on each individual camera (resulting in a lower quality, but better space usage), the main difference has been in changing the frame rate of the recordings. I assume this parameter was introduced or reset on my upgrade.

As my cameras are recording at 10 frames per second, there is little point in storing a recording at 25 frames per second.

The global setting to change this is Options > Images > FFMPEG_OUTPUT_OPTIONS and to change the -r 25 to -r 10 (in my case)

This has resulted in a huge drop in storage used and I have included some other settings which work fine for the quality I need.

-r 10 -b 800k -minrate 400k -maxrate 2000k

Thankyou everyone for your help.
Last edited by erew on Sun Feb 20, 2022 7:21 pm, edited 1 time in total.
erew
Posts: 10
Joined: Wed May 06, 2020 4:39 pm

Re: Giving up on ZM? Or can someone help me?

Post by erew »

Also... to everyone who did reply, sorry for my late reply, however I had a medical emergency to deal with!

And iConnor thankyou for your work on this project.
Post Reply