I'm trying to develop a web application with WebRTC and I'm getting video from my webcam through WebRTC and I want to do live streaming on Facebook and YouTube with my browser I have searched python and node js libraries but I haven't find any library for that. I want to build an application like streamyard. I have watched ffmpeg
I'm trying to develop a web application with WebRTC and I'm getting video from my webcam through WebRTC and I want to do live streaming on Facebook and YouTube with my browser I have searched python and node js libraries but I haven't find any library for that. I want to build an application like streamyard.. I have watched ffmpeg
Share Improve this question edited Apr 3, 2020 at 2:34 Penny Liu 17.6k5 gold badges86 silver badges108 bronze badges asked Apr 3, 2020 at 0:55 Ali MuhammadAli Muhammad 1592 silver badges11 bronze badges 2- 1 Since WebRTC and RTMP are different protocols, you can't do it directly. – Jaromanda X Commented Apr 3, 2020 at 0:59
- Duplicated to stackoverflow./questions/56238148/… – Winlin Commented Mar 8, 2023 at 10:47
1 Answer
Reset to default 8You can do this using Pion WebRTC and ffmpeg!
I have created a demo here. If you have ffmpeg installed and the Go piler this should just work!
This takes audio/video from the browser, and then constructs a webm in memory. It then passes this WebM to ffmpeg via a stdin pipe, which then is transcode and sent to Twitch!
There are a lot of optimizations we could make here (like taking H264 from the browser directly) but H264 isn't supported everywhere, so this just makes the sample easier to reason with.