Streaming Facebook Live to a Roku (the hard way, but there is no easy way)

This recipe is horrible but it works for me.

You’ll need the streamlink tool, and to know the IP address of your Roku.

In your browser, open the developer console and start the facebook live stream. Look for the .mpd request, which is the MPEG-DASH manifest for the stream, listing all the different quality settings available. Copy the URL.

Use streamlink to tell you what qualities are available:

streamlink `<the url>`

It will tell you something like [cli][info] Available streams: 144p+a66k (worst), 144p+a98k, 144p+a132k, 240p+a66k, 240p+a98k, 240p+a132k, 360p+a66k, 360p+a98k, 360p+a132k, 480p+a66k, 480p+a98k, 480p+a132k (best)

Pick your poison and start streamlink proper in external player mode. I’ve chosen the 480p+a98k stream since the a132k bitrate seemed to only sometimes work for me.

streamlink '<the url>' '480p+a98k' --player-external-http --player-external-http-port 31337

The output will include URLs like this:

[cli][info] Starting server, access with one of:
[cli][info] http://10.243.163.137:31337/
[cli][info] http://10.42.42.66:31337/
[cli][info] http://127.0.0.1:31337/

Choose the one on the same network as your Roku. Now to get the Roku to play it, you will have to urlencode the URL for the stream — replace : with %3A and / with %2F. The middle URL above is included in the command below.

curl -v -X POST "http://<your roku IP>:8060/input/15985?t=v&u=http%3A%2F%2F10.42.42.66%3A31337%2F&videoName=FBLive&k=(null)&videoFormat=mkv"

You should see the Roku flash a starting screen, then retrieve enough of the stream to begin, then play the stream.