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

how to use jsmpeg.player output in object detection code. #416

Open
sazzad15-1779 opened this issue Jul 25, 2023 · 1 comment
Open

how to use jsmpeg.player output in object detection code. #416

sazzad15-1779 opened this issue Jul 25, 2023 · 1 comment

Comments

@sazzad15-1779
Copy link

can anyone help me to use jsmpeg streaming in object detection function.
const player = new JSMpeg.Player("ws://localhost:9999", { canvas: canvas, autoplay: true, loop: true, decodeFirstFrame: true, });
how to get video data from this streaming?

@phoboslab
Copy link
Owner

What is "video data"? Raw pixels?

Depending on the disableGl option, you can get pixel data from

If performance is important and black & white is enough, you may hook into the renderer interface and forward the luma plane (y) to your object detection.

If you need color information, you may also hook into the Canvas2D renderer here and forward the Uint8TypedArray with the RGBA data this.imageData.data without going through the Canvas API first. This may be slower than doing the color space conversion in WebGL and using readPixels() though.

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