< Back to Blog

Live streaming with headless chrome

I recently learned about headless chrome and started playing a bit with it to see what could be done.

As I looked closer, got excited about things you can do with it, and started thinking on different use cases. At the time, I was working on a project with a live streaming component, so I got some inspiration from there and I came up with a challenge.

How to use headless chrome to stream a website (video + audio) to an RTMP endpoint.

It was a nice challenge, mainly to figure out how to first get the audio from the website and second to have the video and audio in sync.

It was not trivial, at least for me, needed to get familiar with PulseAudio, and how it works to get the sound from a particular browser tab. It actually became a personal challenge, and I finally got something working.

Here is a presentation where I show a little bit of background of this experiment:

https://docs.google.com/presentation/d/1b-HvxKmeFYE3qoNDJDHfbgVwEbi0QgmTvpH8w4CK5Tw/edit?usp=sharing

I think it can be useful for a few use cases.

I would love any feedback or ideas you might have on how we could use this POC.

Demos:

Streaming to Facebook Live
Here is a demo where I am triggering the recording of a website that embeds a video from youtube and then sends it to Facebook: 
https://www.youtube.com/watch?v=V4TVfMjMy_k

Streaming to Youtube Live
Here is a demo of a recording of a Bitcoin Ticker and sending the stream live to youtube: 
https://www.youtube.com/watch?v=K943cKvEmuI&t=21s

See other articles

  • Tech Leadership: Preventing Burnout and Fostering a Thriving Culture

    Tech Leadership: Preventing Burnout and Fostering a Thriving Culture

    As tech leaders often times we face a unique set of challenges that, if not carefully managed, can lead to burnout. This issue is compounded by the frequent disconnect between technology departments and executive leadership, where the complexities of software development are often underestimated, and the critical role of technology officers in strategic decision-making is…

  • The Three Types of Software Engineers: Sprinters, Architects, and Unicorns

    The Three Types of Software Engineers: Sprinters, Architects, and Unicorns

    In the dynamic world of software engineering, professionals often embody one of three distinct archetypes. Understanding these archetypes is crucial for both managers and team members, as it aids in appreciating their unique contributions and fostering a productive work environment.

  • The Rise of Product Engineers in the Tech Industry

    The Rise of Product Engineers in the Tech Industry

    Product Engineers are the architects of innovation, blending technical expertise with a strategic mindset. Unlike traditional engineers who might focus solely on a specific aspect of a project, a Product Engineer takes a holistic approach. They are the bridge between the technical and business aspects of a company, ensuring that a product not only functions…