"Fadein" events

Current Development version likely to have breaking changes
Post Reply
BigKuma
Posts: 12
Joined: Fri Jan 21, 2022 8:48 pm

"Fadein" events

Post by BigKuma »

I will try the released version, if you guys think it matters. I am on 1.37.10~20220128153843-focal

I have 2 cameras, both USB, and they installed fine, stream fine. One is a junky built in camera on a Dell Laptop.
Second one is a nicer IR Dome 1080p stand along type.

Once I turn on Modect, I start getting periodic "Fade in" events. Nothing is going on in the video, but a fade from black to image, then a few seconds of video where there is no motion. The alarm frames are marked in red in the beginning of the fade in.

I first saw this problem on the built in camera. So, disabled it. But, now I see it on the Dome camera as well.

Is this ZoneMinder or is it related to my V4L2 ? I have libv4l2rds0:amd64/focal 1.18.0-2build1
Or is my host too slow ?

Thanks!
User avatar
iconnor
Posts: 2949
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: "Fadein" events

Post by iconnor »

That sounds suspiciously like an automatic white balance adjustment.

https://itectec.com/unixlinux/how-to-ma ... in-webcam/
BigKuma
Posts: 12
Joined: Fri Jan 21, 2022 8:48 pm

Re: "Fadein" events

Post by BigKuma »

You were right, I turned off all auto functions:
v4l2-ctl -d2 -c white_balance_temperature_auto=0
v4l2-ctl -d2 -c white_balance_temperature=4600
v4l2-ctl -d2 -c exposure_auto_priority=0
v4l2-ctl -d2 -c exposure_auto=0
v4l2-ctl -d2 -c exposure_absolute=1023

And spurious events went away.

But, now when night changes into day and the other way, the camera doesn't adjust. Do I need to have a chron job to move the exposure a few times through the 24h period ?
BigKuma
Posts: 12
Joined: Fri Jan 21, 2022 8:48 pm

Re: "Fadein" events

Post by BigKuma »

Update: during the day, with exposure set higher, I still see flicker and lots of spurious events.

I thing the problem is the CPU/Mem utilization. I am running on dual 1.6GHz Celerons w 2GB of memory (soon to be upgraded to 8GB, but CPU I can't change)

1280x1024 MJPEG , Monitor Only -> 80% CPU for the zmc process. 15-20 frames/s
1280x1024 YUYV , Monitor Only -> 15% CPU for the zmc process. 4-5 frames/s

1280x1024 MJPEG , Modect -> more then 100% CPU for the zmc process.
1280x1024 YUYV , Modect -> 40% CPU for the zmc process.

In MJPEG/Modect mode, as events occur or processing maxes out memory and CPU, flicker happens. That causes more events, some are "New Events", where they don't even get renamed. Eventually machine becomes unresponsive, and I struggle to stop zmc process. Once stopped, everything settles down.

Logs show dropped frames, failed sockets, failed queues and missing semaphores.

Do you think that I need to play with these settings to limit processing speed attempted by ZM ?
Analysis FPS
Maximum FPS
Alarm Maximum FPS
User avatar
iconnor
Posts: 2949
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: "Fadein" events

Post by iconnor »

Dual celerons? Really dual or is it a single real core + hyper threading?

80% cpu for monitoring an mjpeg stream seems like a lot. Definitely leaves no room for motion detection.
BigKuma
Posts: 12
Joined: Fri Jan 21, 2022 8:48 pm

Re: "Fadein" events

Post by BigKuma »

N3050
Burst Frequency 2.16 GHz
Processor Base Frequency 1.60 GHz
Total Cores 2
Total Threads 2 ( I guess Hyperthreading isn't supported here)

So, 100% isn't max, 200% is. But, by around 150% I can't even get SSH to respond properly. It also starts to run out of swap (after running out of memory).

What is the advantage of using MJPEG ? To improve frames per second sent from the camera ?
Since, zmc has to decode every frame, it seems that raw YUYV would be easier to process ?
User avatar
iconnor
Posts: 2949
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: "Fadein" events

Post by iconnor »

yeah mjpeg has no advantage. We decode then re-encode when saving to disk. yuv is better although rgba is best. Many cameras don't offer rgba due to bandwidth constraint.

We could probably implement mjpeg passthrough but you probably want timestamping etc.
BigKuma
Posts: 12
Joined: Fri Jan 21, 2022 8:48 pm

Re: "Fadein" events

Post by BigKuma »

Timestamps are neat, but it was nice to have 24-30 fps with MJPEG, as opposed to 5fps with YUVU.

I went back to MJPEG, and auto adjust on all cam video functions, reduced Analysis FPS to 4fps and I am now at 70% on zmc on Modect.
It's not making bogus events yet, but I'll test this out for a while.
Post Reply