从 getusermedia Web javascript 获取原始 YUV 数据
问题 - 是否可以从 USB 相机获取原始缓冲区图像而不对其进行任何处理。似乎无论相机内部输出是什么格式,当您使用 getUserMedia 抓取它时,它都会将其转换为 RGB。
问题 - 我有一个 YUV 4:2:0 相机输出,我正在通过 USB 从微控制器推出该输出。我打算做的是在 Y 通道的图像中嵌入一些数据信息,例如最后两行。但我遇到的问题是,当您使用 getUserMedia 从相机中获取图像并将其粘贴到视频帧中,然后在缓冲时使用视频帧数据时,它是 RGB 格式的。我可以尝试将 RGB 转换回 YUV,但我认为在某些边缘情况下数据是有损的,因为存在舍入错误或颜色空间不完全匹配。所以基本上我只是在寻找一种方法来保持相机的缓冲区不被编辑。
Question - is it possible to get a raw buffer image from a usb camera without any processing done to it. It seems no matter what format the camera output internally is when you grab it with getUserMedia it converts it to RGB.
Problem - I have a YUV 4:2:0 camera output that i'm pushing out over usb from a microcontroller. What i was planning to do is embedded some data information in the image on the Y channel for say the last 2 lines. But the problem i'm running into is that when you grab the image from the camera with getUserMedia and stick it into the video frame and then use the video frame data as you're buffer it's in RGB. I could try to convert the RGB back into YUV, but i think that in some edge cases the data is lossy as in there's rounding errors or the color spaces don't perfectly match up. So basically I'm just looking for a way to keep my buffer from the camera unedited.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据我所读到的内容,当浏览器获取视频流时,它会将其转换为 RGBA 格式。确实没有办法解决这个问题。
所以我正在做的是使用电子应用程序并在操作系统级别抓取图像并将图像向上传递。
我正在考虑使用 opencv 或这个库 https ://github.com/node-ffi-libraries/node-ffi-library-libuvc-v0.0.6。这是一个较低级别的 USB 摄像头接口。
From what i'm reading when a browser grabs a video stream it will convert it to a RGBA format. There doesn't really seam like a way around this.
So what i'm doing is using a electron app and grabbing the image at a os level and passing the image up.
I'm thinking of using either opencv or this library https://github.com/node-ffi-libraries/node-ffi-library-libuvc-v0.0.6 . which is a lower level usb camera interface.