On the web we can capture media streams from the user's camera, microphone and even desktop. We can use those media streams for real time video cha...
For further actions, you may consider blocking this person and/or reporting abuse
show us about video desktop capture please !
You can capture desktop video using
getDisplayMedia
as I show in this post on desktop capture in Edge. This works for Chrome now too, though you used to need an extension. Firefox supports desktop capture, but with an non-standard methods.Once you capture the media stream, you can use the
MediaRecorder
just like in this post.Maybe you will know this too so !
Can we stream just a part of the screen or can we take just a specific window
Do you know how to send this media stream to a rtmp flux ?
This isnβt something Iβve done, but Iβm interested!
Within the
getDisplayMedia
permissions dialog, the user gets to choose whether they share the whole screen or just a window.To stream just part of the screen, you could copy the video to a canvas element and crop it there, then export the canvas back to a
MediaStream
using the captureStream method.As for streaming to RTMP, that is not something built into the browser. Youβll need to stream to a server using webRTC or web sockets and then have the server turn it into a RTMP stream.
ok i got my response for the specific window capture
This looks great. Very interested in media. The AV1 codec looks great and it will be good when there are some hardware encoders, with acceptable latency.
That is interesting. It looks like the browsers that support
MediaRecorder
mostly also support playing video encoded with AV1But they don't yet record with it.
Will be interesting to see where this goes!
Indeed. Maybe the reason recording is unsupported (and I have no idea what I'm talking about, here) is due to the browsers not being about to cope with the level of processing the codec requires. ? An open source solution like this is certainly overdue in this space. Let's hope everyone (apple) supports it properly.
I would reckon so! Leaving browsers to hang for a long time would not be a good experience and they already suck up plenty of memory. It already takes a while when you record a video to encode it and produce it ready to play back. As you said, as hardware encoding becomes available it might become better and browsers might well be able to hand off to that hardware to process.
That's why the
MediaRecorder.isTypeSupported
method exists. So we can choose the best possible for our users and then fallback.WebM totally hung me up the first time I was playing around with MediaRecorder API. Luckily the service I was sending the audio to accepted that format and I was good to go!
Ha, that is useful. I am going to look into translating from WebM to other formats in the browser, but that's going to take some WebAssembly wrangling (which I'm sort of looking forward to)!