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.com. I have watched ffmpeg
Asked
Active
Viewed 7,744 times
2
-
1Since WebRTC and RTMP are different protocols, you can't do it directly. – Jaromanda X Apr 03 '20 at 00:59
-
Duplicated to https://stackoverflow.com/questions/56238148/how-to-use-webrtc-to-stream-video-to-rtmp – Winlin Mar 08 '23 at 10:47
1 Answers
8
You can do this using Pion WebRTC and ffmpeg!
I have created a demo here. If you have ffmpeg installed and the Go compiler 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.

Sean DuBois
- 3,972
- 1
- 11
- 22