Stream wpesrc source to YouTube with audio?

Hi all,

I’ve got a static HTML page that I made. I want to use wpesrc to capture the audio and video output of the webpage and stream it to YouTube. I’ve gotten it partially work by using wpesrc and an audio test source, but I need the audio to come from the webpage, and I can’t figure out how to do that, even with extensive web searching. I can do this with an OBS browser source, but it needs to be a fully headless solution. Is this possible?

Thank you!

Yes. There’s an example in subprojects/gst-plugins-bad/tests/examples/wpe/wpe.c · main · GStreamer / gstreamer · GitLab

wpesrc will expose an audio source pad when the webpage contains a playing media element outputing audio.

When such audio pad appears you can connect it to a an aac encoder, then flvmux (iirc?) and the rtmp2sink to youtube.

Thank you so much! Is there a way to adapt this to the gst-launch command, or should I learn the C API?

Well usually the gst-launch tool is meant for quick experimentation with command-line. Ideally if you’re building an app you should use the API, either from C, Rust, Python, etc.