Feeding YUV camera images to WebRTC

210 views
Skip to first unread message

Zhaorui Yuan

unread,
Jun 8, 2023, 4:56:33 AM6/8/23
to discuss-webrtc
Hello everyone,

I have a web camera producing YUV images. Is it possible to feed those images via Chrome to WebRTC, or browsers can only grab RGB camera inputs as indicated here?

Furthermore, before the images are fed to the encoder, it is converted to 'I420' format. Is it possible to disable this conversion? The stream getVideoTracks() API and device getUserMedia() don't seem to have such an option.

Thanks a lot in advance!
Zhaorui


guest271314

unread,
Jun 10, 2023, 11:56:07 AM6/10/23
to discuss-webrtc
See https://github.com/brion/yuv-canvashttps://stackoverflow.com/questions/74136241/how-does-the-canvas-drawimage-function-convert-yuv-to-srgb? From there you can use canvas.captureStream() to create a MediaStream from the canvas and pass the MediaStreamTrack to other applications.
Reply all
Reply to author
Forward
0 new messages