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

Data from device might not be in YUYV format #10

Open
kolmodin opened this issue Apr 28, 2014 · 2 comments
Open

Data from device might not be in YUYV format #10

kolmodin opened this issue Apr 28, 2014 · 2 comments

Comments

@kolmodin
Copy link

The toYUYV() and toRGB() functions assume that the data from the device is in YUYV.

Webcams may give data in other formats too, like MPEG or H264.

Currently there is no way to get the "raw" data from the frame, using toYUYV on a MPEG frame returns garbage (i.e. the mpeg data padded with zeros to fill a whole "YUYV frame").

@rafaneri
Copy link

I had the same question, my camera is MPEG, then my result is wrong.
1421023755072

@bellbind
Copy link
Owner

bellbind commented Oct 9, 2015

Added cam.frameRaw() to get raw frame data at ad1b1c9 .
(It is published at 1.0.0 for node-4)

When MJPG format camera used, the returned data(as Uint8Array) is just JPEG compressed data.
(Sorry I don't know how to handle MPEG frames, required more info for programming with MPEG)

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

No branches or pull requests

3 participants