ZoneMinder / zoneminder

ZoneMinder is a free, open source Closed-circuit television software application developed for Linux which supports IP, USB and Analog cameras.
http://www.zoneminder.com/
GNU General Public License v2.0
4.94k stars 1.2k forks source link

Color MJPEG cv2 stream being decoded in grayscale sometimes #3810

Open maddios opened 5 months ago

maddios commented 5 months ago

Describe Your Environment

If the issue concerns a camera

Describe the bug I'm running a yolov8 python app which processes my camera stream then outputs it via cv2 using this command:

cv2.imencode(".jpg", frame, [cv2.IMWRITE_JPEG_QUALITY, 50])

chrome opens the stream just fine and it's always color, however in zoneminder when I restart the stream it'll be grayscale, to fix I have to restart my zm, sometimes restarting the stream fixes it but mostly not.

I've tried streaming these streams to a mjpg file via ffmpeg and it grabs them just fine in color I've never had this issue with any other streams to zm, so I'm really confused what could cause it to go grayscale

Debug Logs

I'm trying to figure out which logs would be relevant to this bug, I tried dumping some debug logs but there's nothing in there regarding ffmpeg decode problems

baudneo commented 4 months ago

This is not a zm issue but, I can help. Can you post a snippet of the code you use to ingest the stream? How do you pull images?

I have a custom ml setup and have no issues with zm being greyscale.