zm decoding color mjpeg stream in grayscale sometimes

Discussions related to the 1.36.x series of ZoneMinder
Post Reply
maddios
Posts: 30
Joined: Wed Oct 27, 2021 7:18 am

zm decoding color mjpeg stream in grayscale sometimes

Post by maddios »

I'm running ZM 1.36.33
The stream is coming from a python script which is streaming a color MJPG video at 1080p
stream plays just fine in chrome and VLC (both show it in color)

The issue is for some reason zoneminder shows the stream in grayscale (and records it grayscale when alarmed) if the stream is restarted after zoneminder starts, this doesn't happen every time, but probably 50% of the time. It almost seems like ffmpeg isn't able to determine a frame boundary because i can sometimes see the image sliding and change colors a few times (like, red things show up green/blue) then it'll stabilize, almost like an old VCR that had tracking way off.

I used to have an older c++ script which sent a nearly identical stream (it had 2x the bitrate) with all the same codec parameters but that one never had an issue, so I'm clearly doing something wrong (I'm assuming) but I can't figure out what.

For completeness I'm using this python project to do the mjpg stream: https://pypi.org/project/mjpeg-streamer/

Let me know what relevant debug logs would help sort this out.

Thanks!
maddios
Posts: 30
Joined: Wed Oct 27, 2021 7:18 am

Re: zm decoding color mjpeg stream in grayscale sometimes

Post by maddios »

Some stuff I've tried, raising the Image Buffer Size to 5 from 3.

tried setting pix_fmt in Source -> Options to a few different kinds of formats (rgb24, bgr24, bt470bg, etc)

Played around with Target colorspace (tried 24 and 32 bit)

So far nothing I've tried has helped.
Post Reply