Watching Netflix and Co on a Raspberry Pi which is connected to a TV or projector? Seems impossible, after scrolling through Stack Exchange and bulletin boards. The best option is to buy a Chrome Cast, plug it into your TV and stream from your Android device or the Chrome browser.

But! From the hardware it is totally possible to watch Netflix with a Raspberry. And it is already connected to the stereo system.

Stream screencast including audio from Ubuntu to Raspberry

Some solutions for this question are based on (proprietary) streaming servers and other keywords are f.i. DLNA. But we want to keep it simple and fast. And use only on-site tools.
After a lot of googling my first working approach was to stream the full screen of my desktop PC with VLC via UDP to a omxplayer running on the Raspberry. Since audio is missing here, I switched to the command-line based avconv (or ffmpeg).

Here is what you need to do.

  1. Create virtual sink
    pactl load-module module-null-sink sink_name="Stream" sink_properties=device.description="Streaming"

    and switch the output on your desktop PC to this sink

  2. Start streaming (the IP ** must be your Raspberry)
    avconv -f pulse -i Stream.monitor -f x11grab -r 30 -s `xdpyinfo | grep dimensions: |awk '{print $2}'` -i :0.0 -vcodec libx264 -s 1280x720 -preset ultrafast -tune film -acodec mp3 -threads auto -f mpegts udp://192.168.1.**:1234
  3. Listen to stream (the IP ** is your desktop PC)
    omxplayer -o alsa udp://191.168.1.**:1234

The option -o alsa is because on my Pi the default audio sink is HDMI and I want to listen via the USB soundcard.

Now, start watching Netflix on your desktop PC and it will be streamed in full quality to your Raspberry. This should work with Kodi as well, but I’ll probably just put the omxplayer on a button of the LIRC daemon and that’s all.


Tagged with:

One Response to Stream Netflix to Raspberry Pi

  1. Kex says:

    A short description about the LIRC stuff will follow.