H264 Pass through VS X264 Server Load

Forum for questions and support relating to the 1.32.x releases only.
Post Reply
racelife
Posts: 84
Joined: Mon Mar 22, 2010 11:38 pm

H264 Pass through VS X264 Server Load

Post by racelife »

I got a used rack server that I thought would be my one box to rule them all thing with everything running on VMs. I thought I would finally have a system I could add plenty of cameras to and not have any worry about load but I am maxing out 12 cores on a xenon with the VM set to use 20gigs of ram out of the 48gigs on the machine
Machine is running Xeon X5690 with 12 cores showing at 3.47GHz 48Gigs of DDR3 EEC ram with Proxmox
Virtual Machine is set to 12 CPUs (I would like to reduce this so I have room to run other things like plex etc.) and 20GiB Ram
Running Ubuntu server 18.04 and using the easy install script from the Wiki
Cameras:
1. Hikvision 1920x1080 32bit colour 8fps
2. Hik 1920x1080 32bit colour 8fps
3. Reolink 2048x1536 5fps
4. Sv3c 1920x1080 5fps
5. Hik 2048x1536 8fps
6. Dahua 1920x1080 8fps
7. Dahua 1920x1080 8fps
All cameras using the stock full screen zone set to mocord.
Yes I know that trimming down the zones and such will help but the point was to worst case stress test the machine...
I figured it should handle it fine... apparently not.
Getting back to the Subject... I have the stock settings in the storage section under the monitor source tab (X264 Encode) on another test server I changed cameras to H264 Pass through and noticed a huge drop in load. Should I be using the Pass through? Is there a reason that that isn't the stock config?
Side question. I get errors in the logs if I hover over the timeline and warnings just opening the timeline (mode: overlay) if I enable saving jpeg will that help and also make the timeline scroll or show more frames? Timeline is my favorite...
I appreceate all the hard work that everyone has done in keeping this project going!
Thanks,
Race
P.S.
Is there a tutorial that us laymen folk can understand to get LPR up and running?
Attachments
Screenshot at 2019-07-02 00-54-20.png
Screenshot at 2019-07-02 00-54-20.png (137.41 KiB) Viewed 6079 times
Screenshot at 2019-07-02 00-55-14.png
Screenshot at 2019-07-02 00-55-14.png (134.44 KiB) Viewed 6079 times
Screenshot at 2019-07-07 21-38-24.png
Screenshot at 2019-07-07 21-38-24.png (90.9 KiB) Viewed 6079 times
User avatar
knight-of-ni
Posts: 2404
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: H264 Pass through VS X264 Server Load

Post by knight-of-ni »

The short answer is yes, you should be using passthrough. As the name implies it passes the stream through, straight to storage, w/o modification, because modifying it in any way requires the stream to be decompressed, and decompressing h264/265 streams is expensive.

I have nearly the same setup as you.

Supermicro 2U X8DTN board with 12 real cores, Xeon X5675, 48GB Ram.
Nine cameras, all Hikvision & Dahua
All 1080p resolution, except for one 4MP
Frame rate is 5-7fps, depending on what the camera supports

Underlying storage is an 8 disk, striped-mirrored ZFS volume.

The only thing I am not doing is using proxmox. I'm running zoneminder right on the server, but I don't expect that to matter unless you've got a bottleneck writing to storage outside the vm or you aren't giving all 12 cores to the vm.

All nine cameras are set to passthrough, and the server is barely breaking a sweat. At the moment, my system load is just 2.64 (22% load), but a lot of that load is due to other tasks I am running on the server right now.

Oh, and I think we fixed overlay issues in master.

I've never set up LPR with zoneminder. If you don't get an answer in the user forum, then try asking in our Slack channel.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
User avatar
snake
Posts: 337
Joined: Sat May 21, 2016 2:20 am

Re: H264 Pass through VS X264 Server Load

Post by snake »

Realize, that if you enable saving JPEGs, you are now using more CPU which defeats the purpose of H264 passthrough. It's not that you can't do it, but understand it has a trade off. Writing 1920x1080 pixel JPEGs at 8FPS will be CPU intensive.

Saving JPEGs is how ZM =<1.30.4 worked - save JPEG of each frame.

H264 encode is used for turning streams into compressed MP4 files, so you can get long term storage.

H264 passthrough is used for above (long term storage), and additionally uses less CPU / has a significant performance benefit.
User avatar
kitkat
Posts: 193
Joined: Sun Jan 27, 2019 5:17 pm

Re: H264 Pass through VS X264 Server Load

Post by kitkat »

Surely decoding always happens anyway, passthrough or otherwise, so that the streams can be analysed for motion, etc.?

Decoding H264 is relatively cheap though - it's the encoding that's expensive, and passthrough avoids that step.
racelife
Posts: 84
Joined: Mon Mar 22, 2010 11:38 pm

Re: H264 Pass through VS X264 Server Load

Post by racelife »

Sounds good! I'll do passthrough for a bit and then add jpeg saving to see what the load increase is.
racelife
Posts: 84
Joined: Mon Mar 22, 2010 11:38 pm

Re: H264 Pass through VS X264 Server Load

Post by racelife »

I enabled passthrough but now I get all sorts of errors... they mostly seem to be coming from the 2 Dahua cams and the Reolink. They jump between not Not Capturing to Capturing at 100fps but super weird stuff. see pictures. I can ssh in and grab any logs if you can tell me what to do to get them.
Attachments
Screenshot at 2019-07-10 12-57-56.png
Screenshot at 2019-07-10 12-57-56.png (92.3 KiB) Viewed 5980 times
Screenshot at 2019-07-10 13-00-54.png
Screenshot at 2019-07-10 13-00-54.png (185.49 KiB) Viewed 5980 times
Screenshot at 2019-07-10 13-01-14.png
Screenshot at 2019-07-10 13-01-14.png (190.46 KiB) Viewed 5980 times
racelife
Posts: 84
Joined: Mon Mar 22, 2010 11:38 pm

Re: H264 Pass through VS X264 Server Load

Post by racelife »

One more
Attachments
Screenshot at 2019-07-10 13-19-13.png
Screenshot at 2019-07-10 13-19-13.png (133.54 KiB) Viewed 5980 times
User avatar
kitkat
Posts: 193
Joined: Sun Jan 27, 2019 5:17 pm

Re: H264 Pass through VS X264 Server Load

Post by kitkat »

If you have values set for "Maximum FPS" and/or "Alarm Maximum FPS," try clearing them.
racelife
Posts: 84
Joined: Mon Mar 22, 2010 11:38 pm

Re: H264 Pass through VS X264 Server Load

Post by racelife »

kitkat wrote: Wed Jul 10, 2019 9:43 pm If you have values set for "Maximum FPS" and/or "Alarm Maximum FPS," try clearing them.
That worked! Thanks!

I thought that it was best practice to put a value in a little above what your camera is set to so that if something went wrong it would keep frame rates down... Seems like I read that somewhere.
Post Reply