2

This weekend I wanted to stream my monitor to Kodi, mainly to have somebody watch me play a game on a TV without having to sit awkwardly next to me.

My setup is a PI2 "Retropie" (wheezy) install, with the kodi app running. I downloaded and started up limelight (I have a Nvidia GPU). This worked briefly and badly. The stream was opaque with the kodi menu still displaying in the background. And it crashed about twice.

This made me realise that I don't need "cloud gaming" stuff. I just want to stream my display to Kodi. A few google sessions didn't really supply me with what I need.

Is there some project that does this already?

I was thinking of maybe streaming to twitch and then in turn, stream from twitch to my kodi, but that just seemed a bit of a workaround.

RESOLVED (but not answered)

My "fix" isn't the answer to this question so I will keep it open for now.

A bug in GFE prevents steam from properly opening, instead on your windows machine stream "C:\Windows\System32\mstsc.exe" instead of Steam. This will just cast your whole desktop, this works with all games aswell. All I have to do is figure out if can have audio on both the client and host at the same time. This is not the case now.

But bottom line is, on a Pi (moonlight-embedded, installed as an app in emulationstation) works. After pairing:

moonlight stream -1080 -60fps $ip -app Windows

Streams my whole desktop, this is what I needed. It does still crash from time to time but works with 1080p @ 60fps!

  • I've added a resolved section – Havnar Feb 9 '16 at 20:17
3

There's a complete walkthrough here on using VLC to capture and stream the desktop of a PC to a second machine. At the time of writing there is a bug in versions subsequent to 2.1.5 which prevent this from working. Install 2.1.5 from here first. It may be necessary to tweak the settings provided there to reduce the video stream resolution and/or quality to achieve reasonable results on the Pi.

In summary:

Server side:

  • Open VLC Media Player.
  • Select Media | Open Capture Device.
  • The default Capture Mode is DirectShow. Change the Capture Mode to Desktop.
  • Change the Desired Frame Rate for the Capture to 15. (Customize the Frame Rate according to your needs.)
  • Select Stream by clicking on the small tab towards the right side of the Play tab in the bottom right hand corner.
  • Select Next.
  • Check the box for Display Locally. Then click on the drop-down arrow next to New Destination and set it to UDP. (The default is File)
  • Click on Add.
  • Specify the IP address of the destination machine (client machine) on which you are streaming the desktop to.
  • Specify the Port Number as 1234 (Note: With UDP, do not enter the IP Address of the Server. Instead, enter the IP Address of the Receiving Computer or Multicast).
  • Activate Transcoding.
  • Specify the video options by clicking on the Tools icon , located next to the Profile dropdown.
  • Update the Bit rate, Frame Rate & Resolution/Filters to optimize the video quality.
  • Go to the Audio codec tab and Click Save.
  • Click on the Next tab in the bottom right hand corner.
  • Click on the tab Stream.
  • Now select the play button.

Client side:

  • Open VLC Media Player on the client machine.
  • Click on Media | Open Network Stream.
  • Specify the Protocol as UDP.

    a. Click on the drop-down arrow below Protocol.

    b. Specify the IP Address of the machine. This is the same IP Address that was specified while configuring the VLC Server.

    c. Specify the Port Number to 1234. NOTE: The Protocol (UDP), IP Address (IP Address of the machine on which you want to stream the Desktop) & the Port (1234) remains the same as specified earlier during the set up.

  • Click Play, located on the bottom right hand corner of the window.
  • You are viewing the other (server) computer's desktop on this (client) computer using VLC video player.

If you want to use the command line interface for VLC on the receiving Pi, rather than the GUI specified in the tutorial, there are tutorials for streaming here, and more complete VLC documentation here.

To open the stream using Kodi:

Create a .strm file with the session parameters in an accessible location:

sudo nano mystream.strm

udp://[yourIP]:1234

Ctrl+X

Y

Use Kodi to open the .strm file.

  • what's the performance on this? Isn't this creating massive overhead and slow performance? Also, the client is Kodi, not VLC. – Havnar Feb 8 '16 at 15:53
  • I will try this when I get home, I have also tried installing moonlight as an app in retropie. I'll try and compare the results. – Havnar Feb 8 '16 at 15:57
  • Performance will be entirely dependent on the performance of the sending and receiving machines, as well as all of the network hardware in between them. I'm afraid I can't speculate on how it'll fare on your specific setup. Kodi is capable of opening network streams - I'll update the answer as appropriate. – goobering Feb 8 '16 at 15:57
  • results: attempting the UDP streaming over VLC with 60 1080p fps initially worked but was really slow, the delay was horrid. Then I tried to update VLC, just in case. Now, it crashes when I click "stream" so, that's broken ... :) the moonlight road didn't go smooth either. Manged to not have the overlay when starting out of retropie but it crashes often .... – Havnar Feb 8 '16 at 18:44
  • 60fps@1080 is a big ask even for a full sized desktop! Pick one setting (fps/resolution/bps/etc) and half it. If it doesn't improve things, then half it again. Repeat until you get something usable. Repeat for the other settings to give you some idea of how each affects your stream quality. Then you can try and pin down a good setup. It should be possible to achieve something that's usable if not ideal. – goobering Feb 8 '16 at 18:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.