-<p><blockquote><pre>
-[...]
-device /dev/mapper/Debian-var mounted on /var with fstype ext3
-device nfsserver:/mnt/nfsserver/home0 mounted on /mnt/nfsserver/home0 with fstype nfs statvers=1.1
- opts: rw,vers=3,rsize=65536,wsize=65536,namlen=255,acregmin=3,acregmax=60,acdirmin=30,acdirmax=60,soft,nolock,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=129.240.3.145,mountvers=3,mountport=4048,mountproto=udp,local_lock=all
- age: 7863311
- caps: caps=0x3fe7,wtmult=4096,dtsize=8192,bsize=0,namlen=255
- sec: flavor=1,pseudoflavor=1
- events: 61063112 732346265 1028140 35486205 16220064 8162542 761447191 71714012 37189 3891185 45561809 110486139 4850138 420353 15449177 296502 52736725 13523379 0 52182 9016896 1231 0 0 0 0 0
- bytes: 166253035039 219519120027 0 0 40783504807 185466229638 11677877 45561809
- RPC iostats version: 1.0 p/v: 100003/3 (nfs)
- xprt: tcp 925 1 6810 0 0 111505412 111480497 109 2672418560317 0 248 53869103 22481820
- per-op statistics
- NULL: 0 0 0 0 0 0 0 0
- GETATTR: 61063106 61063108 0 9621383060 6839064400 453650 77291321 78926132
- SETATTR: 463469 463470 0 92005440 66739536 63787 603235 687943
- LOOKUP: 17021657 17021657 0 3354097764 4013442928 57216 35125459 35566511
- ACCESS: 14281703 14290009 5 2318400592 1713803640 1709282 4865144 7130140
- READLINK: 125 125 0 20472 18620 0 1112 1118
- READ: 4214236 4214237 0 715608524 41328653212 89884 22622768 22806693
- WRITE: 8479010 8494376 22 187695798568 1356087148 178264904 51506907 231671771
- CREATE: 171708 171708 0 38084748 46702272 873 1041833 1050398
- MKDIR: 3680 3680 0 773980 993920 26 23990 24245
- SYMLINK: 903 903 0 233428 245488 6 5865 5917
- MKNOD: 80 80 0 20148 21760 0 299 304
- REMOVE: 429921 429921 0 79796004 61908192 3313 2710416 2741636
- RMDIR: 3367 3367 0 645112 484848 22 5782 6002
- RENAME: 466201 466201 0 130026184 121212260 7075 5935207 5961288
- LINK: 289155 289155 0 72775556 67083960 2199 2565060 2585579
- READDIR: 2933237 2933237 0 516506204 13973833412 10385 3190199 3297917
- READDIRPLUS: 1652839 1652839 0 298640972 6895997744 84735 14307895 14448937
- FSSTAT: 6144 6144 0 1010516 1032192 51 9654 10022
- FSINFO: 2 2 0 232 328 0 1 1
- PATHCONF: 1 1 0 116 140 0 0 0
- COMMIT: 0 0 0 0 0 0 0 0
-
-device binfmt_misc mounted on /proc/sys/fs/binfmt_misc with fstype binfmt_misc
-[...]
-</pre></blockquote></p>
+<blockquote><pre>
+vlc screen:// --sout \
+ '#transcode{vcodec=mp4v,acodec=mpga,vb=800,ab=128}:rtp{dst=projector.local,port=1234,sdp=rtsp://192.168.11.4:8080/test.sdp}'
+</pre></blockquote>
+
+<p>I ssh-ed into my Kodi box and created a file like this with the
+same IP address:</p>
+
+<blockquote><pre>
+echo rtsp://192.168.11.4:8080/test.sdp \
+ > /storage/videos/screenstream.m3u
+</pre></blockquote>
+
+<p>Note the 192.168.11.4 IP address is my desktops IP address. As far
+as I can tell the IP must be hardcoded for this to work. In other
+words, if someone elses machine is going to do the steaming, you have
+to update screenstream.m3u on the Kodi machine and adjust the vlc
+recipe. To get started, 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. :)</p>
+
+<p>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.</p>
+
+<p><strong>Update 2018-07-12</strong>: Johannes Schauer send me a few
+succestions and reminded me about an important step. The "screen:"
+input source is only available once the vlc-plugin-access-extra
+package is installed on Debian. Without it, you will see this error
+message: "VLC is unable to open the MRL 'screen://'. Check the log
+for details." He further found that it is possible to drop some parts
+of the VLC command line to reduce the amount of hardcoded information.
+It is also useful to consider using cvlc to avoid having the VLC
+window in the desktop view. In sum, this give us this command line on
+the source end
+
+<blockquote><pre>
+cvlc screen:// --sout \
+ '#transcode{vcodec=mp4v,acodec=mpga,vb=800,ab=128}:rtp{sdp=rtsp://:8080/}'
+</pre></blockquote>
+
+<p>and this on the Kodi end<p>
+
+<blockquote><pre>
+echo rtsp://192.168.11.4:8080/ \
+ > /storage/videos/screenstream.m3u
+</pre></blockquote>
+
+<p>Still bad image quality, though. But I did discover that streaming
+a DVD using dvdsimple:///dev/dvd as the source had excellent video and
+audio quality, so I guess the issue is in the input or transcoding
+parts, not the rtsp part. I've tried to change the vb and ab
+parameters to use more bandwidth, but it did not make a
+difference.</p>
+
+<p>I further received a suggestion from Einar Haraldseid to try using
+gstreamer instead of VLC, and this proved to work great! He also
+provided me with the trick to get Kodi to use a multicast stream as
+its source. By using this monstrous oneliner, I can stream my desktop
+with good video quality in reasonable framerate to the 239.255.0.1
+multicast address on port 1234:
+
+<blockquote><pre>
+gst-launch-1.0 ximagesrc use-damage=0 ! video/x-raw,framerate=30/1 ! \
+ videoconvert ! queue2 ! \
+ x264enc bitrate=8000 speed-preset=superfast tune=zerolatency qp-min=30 \
+ key-int-max=15 bframes=2 ! video/x-h264,profile=high ! queue2 ! \
+ mpegtsmux alignment=7 name=mux ! rndbuffersize max=1316 min=1316 ! \
+ udpsink host=239.255.0.1 port=1234 ttl-mc=1 auto-multicast=1 sync=0 \
+ pulsesrc device=$(pactl list | grep -A2 'Source #' | \
+ grep 'Name: .*\.monitor$' | cut -d" " -f2|head -1) ! \
+ audioconvert ! queue2 ! avenc_aac ! queue2 ! mux.
+</pre></blockquote>
+
+<p>and this on the Kodi end<p>
+
+<blockquote><pre>
+echo udp://@239.255.0.1:1234 \
+ > /storage/videos/screenstream.m3u
+</pre></blockquote>
+
+<p>Note the trick to pick a valid pulseaudio source. It might not
+pick the one you need. This approach will of course lead to trouble
+if more than one source uses the same multicast port and address.
+Note the ttl-mc=1 setting, which limit the multicast packages to the
+local network. If the value is increased, your screen will be
+broadcasted further, one network "hop" for each increase (read up on
+multicast to learn more. :)!</p>