From 6d11b8850e3f9dafecec47d05236f3681364e376 Mon Sep 17 00:00:00 2001 From: Petter Reinholdtsen Date: Thu, 12 Jul 2018 01:52:06 +0200 Subject: [PATCH] New post. --- ...ux_desktop_to_Kodi_using_VLC_and_RTSP.html | 522 ++++++++++++++++++ .../2018-07-12-kodi-linux-desktop-vlc.txt | 61 ++ 2 files changed, 583 insertions(+) create mode 100644 blog/Streaming_the_Linux_desktop_to_Kodi_using_VLC_and_RTSP.html create mode 100644 blog/data/2018-07-12-kodi-linux-desktop-vlc.txt diff --git a/blog/Streaming_the_Linux_desktop_to_Kodi_using_VLC_and_RTSP.html b/blog/Streaming_the_Linux_desktop_to_Kodi_using_VLC_and_RTSP.html new file mode 100644 index 0000000000..e0c702c2b6 --- /dev/null +++ b/blog/Streaming_the_Linux_desktop_to_Kodi_using_VLC_and_RTSP.html @@ -0,0 +1,522 @@ + + + + + Petter Reinholdtsen: Streaming the Linux desktop to Kodi using VLC and RTSP + + + + + + +
+

+ Petter Reinholdtsen + +

+ +
+ + +
+
Streaming the Linux desktop to Kodi using VLC and RTSP
+
12th July 2018
+

A while back, I was asked by a friend how to stream the desktop to +my projector connected to Kodi. I sadly had to admit that I had no +idea, as it was a task I never had tried. Since then, I have been +looking for a way to do so, preferable without much extra software to +install on either side. Today I found a way that seem to kind of +work. Not great, but it si a start.

+ +

I had a look at several approaches, for example +using uPnP +DLNA as described in 2011, but it required a uPnP server, fuse and +local storage enough to store the stream locally. This is not going +to work well for me, lacking enough free space, and it would +impossible for my friend to get working.

+ +

Next, it occurred to me that perhaps I could use VLC to create a +video stream that Kodi could play. Preferably using +broadcast/multicast, to avoid having to change any setup on the Kodi +side when starting such stream. Unfortunately, the only recipe I +could find using multicast used the rtp protocol, and this protocol +seem to not be supported by Kodi.

+ +

On the other hand, the rtsp protocol is working! Unfortunately I +have to specify the IP address of the streaming machine in both the +sending command and the file on the Kodi server. But it is showing my +desktop, and thus allow us to have a shared look on the big screen at +the programs I work on.

+ +

I did not spend much time investigating codeces. I combined the +rtp and rtsp recipes from +the +VLC Streaming HowTo/Command Line Examples, and was able to get +this working on the desktop/streaming end. Note the 192.168.0.4 IP +address is my desktops IP address:

+ +
+vlc screen:// --sout '#transcode{vcodec=mp4v,acodec=mpga,vb=800,ab=128}:rtp{dst=projector.local,port=1234,sdp=rtsp://192.168.0.4:8080/test.sdp}'
+
+ +

I ssh-ed into my Kodi box and created a file like this with the +same IP address:

+ +
+echo rtsp://192.168.0.4:8080/test.sdp > /storage/videos/screenstream.m3u
+
+ +

Next, first locate the file in Kodi and select the m3u file while +the VLC stream is running. The desktop then show up in my big +screen. :)

+ +

When using the same technique to stream a video file with audio, +the audio quality is really bad. No idea if the problem is package +loss or bad parameters for the transcode. I do not know VLC nor Kodi +enough to tell.

+ +

As usual, if you use Bitcoin and want to show your support of my +activities, please send Bitcoin donations to my address +15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b.

+
+ + + + +
+ + + + + +

+ Created by Chronicle v4.6 +

+ + + diff --git a/blog/data/2018-07-12-kodi-linux-desktop-vlc.txt b/blog/data/2018-07-12-kodi-linux-desktop-vlc.txt new file mode 100644 index 0000000000..5d67362b62 --- /dev/null +++ b/blog/data/2018-07-12-kodi-linux-desktop-vlc.txt @@ -0,0 +1,61 @@ +Title: Streaming the Linux desktop to Kodi using VLC and RTSP +Tags: english, debian, video +Date: 2018-07-12 02:00 + +

A while back, I was asked by a friend how to stream the desktop to +my projector connected to Kodi. I sadly had to admit that I had no +idea, as it was a task I never had tried. Since then, I have been +looking for a way to do so, preferable without much extra software to +install on either side. Today I found a way that seem to kind of +work. Not great, but it si a start.

+ +

I had a look at several approaches, for example +using uPnP +DLNA as described in 2011, but it required a uPnP server, fuse and +local storage enough to store the stream locally. This is not going +to work well for me, lacking enough free space, and it would +impossible for my friend to get working.

+ +

Next, it occurred to me that perhaps I could use VLC to create a +video stream that Kodi could play. Preferably using +broadcast/multicast, to avoid having to change any setup on the Kodi +side when starting such stream. Unfortunately, the only recipe I +could find using multicast used the rtp protocol, and this protocol +seem to not be supported by Kodi.

+ +

On the other hand, the rtsp protocol is working! Unfortunately I +have to specify the IP address of the streaming machine in both the +sending command and the file on the Kodi server. But it is showing my +desktop, and thus allow us to have a shared look on the big screen at +the programs I work on.

+ +

I did not spend much time investigating codeces. I combined the +rtp and rtsp recipes from +the +VLC Streaming HowTo/Command Line Examples, and was able to get +this working on the desktop/streaming end. Note the 192.168.0.4 IP +address is my desktops IP address:

+ +
+vlc screen:// --sout '#transcode{vcodec=mp4v,acodec=mpga,vb=800,ab=128}:rtp{dst=projector.local,port=1234,sdp=rtsp://192.168.0.4:8080/test.sdp}'
+
+ +

I ssh-ed into my Kodi box and created a file like this with the +same IP address:

+ +
+echo rtsp://192.168.0.4:8080/test.sdp > /storage/videos/screenstream.m3u
+
+ +

Next, first locate the file in Kodi and select the m3u file while +the VLC stream is running. The desktop then show up in my big +screen. :)

+ +

When using the same technique to stream a video file with audio, +the audio quality is really bad. No idea if the problem is package +loss or bad parameters for the transcode. I do not know VLC nor Kodi +enough to tell.

+ +

As usual, if you use Bitcoin and want to show your support of my +activities, please send Bitcoin donations to my address +15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b.

-- 2.47.2