Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Color MJPEG cv2 stream being decoded in grayscale sometimes #3810

Open
maddios opened this issue Feb 2, 2024 · 1 comment
Open

Color MJPEG cv2 stream being decoded in grayscale sometimes #3810

maddios opened this issue Feb 2, 2024 · 1 comment

Comments

@maddios
Copy link
Contributor

maddios commented Feb 2, 2024

Describe Your Environment

  • Version of ZoneMinder: 1.36.33
  • How you installed ZoneMinder: docker image: ghcr.io/zoneminder-containers/zoneminder-base:1.36.33@sha256:8ee8031bc387fa8e67d10ce0202424c1b8cfc0dd6bada70aa237d1698ce28a2e
  • Full name and version of OS: not 100% sure which os this container runs

If the issue concerns a camera

  • Python cv2 mjpeg stream (opencv version 4.9.0.80)
  • 5 fps
  • 1920x1080, but happens in all the streams (i have a total of 5)
  • ZoneMinder Source Type: ffmpeg

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
Copy link
Contributor

baudneo commented Mar 6, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants