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

Support monochrome cameras #170

Open
gudvinr opened this issue Sep 9, 2022 · 3 comments · May be fixed by #171
Open

Support monochrome cameras #170

gudvinr opened this issue Sep 9, 2022 · 3 comments · May be fixed by #171
Assignees
Labels
type:feature New feature or request

Comments

@gudvinr
Copy link

gudvinr commented Sep 9, 2022

I have this monochrome camera: http://withrobot.com/en/camera/ocam-1mgn-u

It is quite unusual in a sense that it doesn't provide color image formats supported by ustreamer (YUYV, UYVY, RGB565, RGB24, JPEG).
Its only output pixelformat is GREY which is 8-bit monochrome image

This fact leads to ustreamer not being able to consume stream from the camera:

-- ERROR [2233.317    stream] -- Could not obtain the requested pixelformat=YUYV; driver gave us unsupported
-- ERROR [2233.317    stream] -- Unsupported pixelformat=GREY (fourcc)

$ uvcdynctrl -f output:

Listing available frame formats for device video0:
Pixel format: GREY (8-bit Greyscale)
  Frame size: 1280x960
    Frame rates: 30, 25, 15
  Frame size: 1280x720
    Frame rates: 30, 25, 15
  Frame size: 640x480
    Frame rates: 100, 90, 60, 50, 30, 25, 15
  Frame size: 320x240
    Frame rates: 180, 150, 120, 100, 60, 50
@gudvinr gudvinr changed the title Supper monochrome cameras Support monochrome cameras Sep 9, 2022
gudvinr added a commit to gudvinr/ustreamer that referenced this issue Sep 10, 2022
Fixes pikvm#170

Monochrome cameras send only Y component of YUV image
@gudvinr gudvinr linked a pull request Sep 10, 2022 that will close this issue
@mdevaev mdevaev added the type:feature New feature or request label Sep 11, 2022
@mdevaev mdevaev self-assigned this Sep 11, 2022
@mdevaev
Copy link
Member

mdevaev commented Sep 11, 2022

Interesting. Btw can this camera generate mjpeg independently? Please show me v4l2 --list-formats. And what is the point of using this camera? Just wondering. To accept your patch, all encoders must support grayscale to avoid asserts. Otherwise, we will need some mechanism that restricts encoders for certain formats.

@gudvinr
Copy link
Author

gudvinr commented Sep 11, 2022

Btw can this camera generate mjpeg independently?

No, it can't. That's basically only reason why I am asking for this.

Please show me v4l2 --list-formats.

uvcdynctrl basically does same thing, output just slightly different

what is the point of using this camera?

Point is that I have this laying around and it has global shutter and no IR filter.

To accept your patch, all encoders must support grayscale to avoid asserts. Otherwise, we will need some mechanism that restricts encoders for certain formats.

In its current state no, I just reused YUYV decoder and write luma in R, G and B channels so it still produces 24-bit data. I am okay with this but since JPEG can work with 8-bit images natively I think that should be more effective in terms of throughput and performance.

Otherwise, we will need some mechanism that restricts encoders for certain formats.

Yes, that's why I didn't do any modifications other than adding image processor. I am not familiar with project and how things work so if you have suggestion on appropriate solution for this it'd be great.

@mdevaev
Copy link
Member

mdevaev commented Sep 11, 2022

Got it. I like the idea of adding this, but I have to think about how to do it right.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:feature New feature or request
Development

Successfully merging a pull request may close this issue.

2 participants