]> pere.pagekite.me Git - homepage.git/blobdiff - blog/index.rss
Generated.
[homepage.git] / blog / index.rss
index 7715f464455f9ae068908ff7154ebe237dff462e..4629eda7659ac59e3cc98bc912a541e8f1c131d1 100644 (file)
@@ -6,6 +6,264 @@
                 <link>http://people.skolelinux.org/pere/blog/</link>
                 <atom:link href="http://people.skolelinux.org/pere/blog/index.rss" rel="self" type="application/rss+xml" />
        
+       <item>
+               <title>Streaming the Linux desktop to Kodi using VLC and RTSP</title>
+               <link>http://people.skolelinux.org/pere/blog/Streaming_the_Linux_desktop_to_Kodi_using_VLC_and_RTSP.html</link>
+               <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/Streaming_the_Linux_desktop_to_Kodi_using_VLC_and_RTSP.html</guid>
+                <pubDate>Thu, 12 Jul 2018 02:00:00 +0200</pubDate>
+               <description>&lt;p&gt;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 is a start.&lt;/p&gt;
+
+&lt;p&gt;I had a look at several approaches, for example
+&lt;a href=&quot;https://github.com/mfoetsch/dlna_live_streaming&quot;&gt;using uPnP
+DLNA as described in 2011&lt;/a&gt;, 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.&lt;/p&gt;
+
+&lt;p&gt;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.&lt;/p&gt;
+
+&lt;p&gt;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.&lt;/p&gt;
+
+&lt;p&gt;I did not spend much time investigating codeces.  I combined the
+rtp and rtsp recipes from
+&lt;a href=&quot;https://wiki.videolan.org/Documentation:Streaming_HowTo/Command_Line_Examples/&quot;&gt;the
+VLC Streaming HowTo/Command Line Examples&lt;/a&gt;, and was able to get
+this working on the desktop/streaming end.&lt;/p&gt;
+
+&lt;blockquote&gt;&lt;pre&gt;
+vlc screen:// --sout \
+  &#39;#transcode{vcodec=mp4v,acodec=mpga,vb=800,ab=128}:rtp{dst=projector.local,port=1234,sdp=rtsp://192.168.11.4:8080/test.sdp}&#39;
+&lt;/pre&gt;&lt;/blockquote&gt;
+
+&lt;p&gt;I ssh-ed into my Kodi box and created a file like this with the
+same IP address:&lt;/p&gt;
+
+&lt;blockquote&gt;&lt;pre&gt;
+echo rtsp://192.168.11.4:8080/test.sdp \
+  &gt; /storage/videos/screenstream.m3u
+&lt;/pre&gt;&lt;/blockquote&gt;
+
+&lt;p&gt;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.m4u 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. :)&lt;/p&gt;
+
+&lt;p&gt;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.&lt;/p&gt;
+
+&lt;p&gt;&lt;strong&gt;Update 2018-07-12&lt;/strong&gt;: Johannes Schauer send me a few
+succestions and reminded me about an important step.  The &quot;screen:&quot;
+input source is only available once the vlc-plugin-access-extra
+package is installed on Debian.  Without it, you will see this error
+message: &quot;VLC is unable to open the MRL &#39;screen://&#39;.  Check the log
+for details.&quot;  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
+
+&lt;blockquote&gt;&lt;pre&gt;
+cvlc screen:// --sout \
+  &#39;#transcode{vcodec=mp4v,acodec=mpga,vb=800,ab=128}:rtp{sdp=rtsp://:8080/}&#39;
+&lt;/pre&gt;&lt;/blockquote&gt;
+
+&lt;p&gt;and this on the Kodi end&lt;p&gt;
+
+&lt;blockquote&gt;&lt;pre&gt;
+echo rtsp://192.168.11.4:8080/ \
+  &gt; /storage/videos/screenstream.m3u
+&lt;/pre&gt;&lt;/blockquote&gt;
+
+&lt;p&gt;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&#39;ve tried to change the vb and ab
+parameters to use more bandwidth, but it did not make a
+difference.&lt;/p&gt;
+
+&lt;p&gt;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:
+
+&lt;blockquote&gt;&lt;pre&gt;
+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=0 auto-multicast=1 sync=0 \
+  pulsesrc device=$(pactl list | grep -A2 &#39;Source #&#39; | \
+    grep &#39;Name: .*\.monitor$&#39; |  cut -d&quot; &quot; -f2|head -1) ! \
+  audioconvert ! queue2 ! avenc_aac ! queue2 ! mux.
+&lt;/pre&gt;&lt;/blockquote&gt;
+
+&lt;p&gt;and this on the Kodi end&lt;p&gt;
+
+&lt;blockquote&gt;&lt;pre&gt;
+echo udp://@239.255.0.1:1234 \
+  &gt; /storage/videos/screenstream.m3u
+&lt;/pre&gt;&lt;/blockquote&gt;
+
+&lt;p&gt;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=0 setting, which limit the multicast packages to the
+local network.  If the value is increased, your screen will be
+broadcasted further, one network &quot;hop&quot; for each increase (read up on
+multicast to learn more. :)!&lt;/p&gt;
+
+&lt;p&gt;Having cracked how to get Kodi to receive multicast streams, I
+could use this VLC command to stream to the same multicast address.
+The image quality is way better than the rtsp approach.&lt;/p&gt;
+
+&lt;blockquote&gt;&lt;pre&gt;
+cvlc screen:// --sout &#39;#transcode{vcodec=mp4v,acodec=mpga,vb=800,ab=128}:rtp{mux=ts,dst=239.255.0.1,port=1234,sdp=sap}&#39;
+&lt;/pre&gt;&lt;/blockquote&gt;
+
+&lt;p&gt;As usual, if you use Bitcoin and want to show your support of my
+activities, please send Bitcoin donations to my address
+&lt;b&gt;&lt;a href=&quot;bitcoin:15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&quot;&gt;15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&lt;/a&gt;&lt;/b&gt;.&lt;/p&gt;
+</description>
+       </item>
+       
+       <item>
+               <title>What is the most supported MIME type in Debian in 2018?</title>
+               <link>http://people.skolelinux.org/pere/blog/What_is_the_most_supported_MIME_type_in_Debian_in_2018_.html</link>
+               <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/What_is_the_most_supported_MIME_type_in_Debian_in_2018_.html</guid>
+                <pubDate>Mon, 9 Jul 2018 08:05:00 +0200</pubDate>
+               <description>&lt;p&gt;Five years ago,
+&lt;a href=&quot;http://people.skolelinux.org/pere/blog/What_is_the_most_supported_MIME_type_in_Debian_.html&quot;&gt;I
+measured what the most supported MIME type in Debian was&lt;/a&gt;, by
+analysing the desktop files in all packages in the archive.  Since
+then, the DEP-11 AppStream system has been put into production, making
+the task a lot easier.  This made me want to repeat the measurement,
+to see how much things changed.  Here are the new numbers, for
+unstable only this time:
+
+&lt;p&gt;&lt;strong&gt;Debian Unstable:&lt;/strong&gt;&lt;/p&gt;
+
+&lt;pre&gt;
+  count MIME type
+  ----- -----------------------
+     56 image/jpeg
+     55 image/png
+     49 image/tiff
+     48 image/gif
+     39 image/bmp
+     38 text/plain
+     37 audio/mpeg
+     34 application/ogg
+     33 audio/x-flac
+     32 audio/x-mp3
+     30 audio/x-wav
+     30 audio/x-vorbis+ogg
+     29 image/x-portable-pixmap
+     27 inode/directory
+     27 image/x-portable-bitmap
+     27 audio/x-mpeg
+     26 application/x-ogg
+     25 audio/x-mpegurl
+     25 audio/ogg
+     24 text/html
+&lt;/pre&gt;
+
+&lt;p&gt;The list was created like this using a sid chroot: &quot;cat
+/var/lib/apt/lists/*sid*_dep11_Components-amd64.yml.gz| zcat | awk &#39;/^
+- \S+\/\S+$/ {print $2 }&#39; | sort | uniq -c | sort -nr | head -20&quot;&lt;/p&gt;
+
+&lt;p&gt;It is interesting to see how image formats have passed text/plain
+as the most announced supported MIME type.  These days, thanks to the
+AppStream system, if you run into a file format you do not know, and
+want to figure out which packages support the format, you can find the
+MIME type of the file using &quot;file --mime &amp;lt;filename&amp;gt;&quot;, and then
+look up all packages announcing support for this format in their
+AppStream metadata (XML or .desktop file) using &quot;appstreamcli
+what-provides mimetype &amp;lt;mime-type&amp;gt;.  For example if you, like
+me, want to know which packages support inode/directory, you can get a
+list like this:&lt;/p&gt;
+
+&lt;p&gt;&lt;blockquote&gt;&lt;pre&gt;
+% appstreamcli what-provides mimetype inode/directory | grep Package: | sort
+Package: anjuta
+Package: audacious
+Package: baobab
+Package: cervisia
+Package: chirp
+Package: dolphin
+Package: doublecmd-common
+Package: easytag
+Package: enlightenment
+Package: ephoto
+Package: filelight
+Package: gwenview
+Package: k4dirstat
+Package: kaffeine
+Package: kdesvn
+Package: kid3
+Package: kid3-qt
+Package: nautilus
+Package: nemo
+Package: pcmanfm
+Package: pcmanfm-qt
+Package: qweborf
+Package: ranger
+Package: sirikali
+Package: spacefm
+Package: spacefm
+Package: vifm
+%
+&lt;/pre&gt;&lt;/blockquote&gt;&lt;/p&gt;
+
+&lt;p&gt;Using the same method, I can quickly discover that the Sketchup file
+format is not yet supported by any package in Debian:&lt;/p&gt;
+
+&lt;p&gt;&lt;blockquote&gt;&lt;pre&gt;
+% appstreamcli what-provides mimetype  application/vnd.sketchup.skp
+Could not find component providing &#39;mimetype::application/vnd.sketchup.skp&#39;.
+%
+&lt;/pre&gt;&lt;/blockquote&gt;&lt;/p&gt;
+
+&lt;p&gt;Yesterday I used it to figure out which packages support the STL 3D
+format:&lt;/p&gt;
+
+&lt;p&gt;&lt;blockquote&gt;&lt;pre&gt;
+% appstreamcli what-provides mimetype  application/sla|grep Package
+Package: cura
+Package: meshlab
+Package: printrun
+%
+&lt;/pre&gt;&lt;/blockquote&gt;&lt;/p&gt;
+
+&lt;p&gt;PS: A new version of Cura was uploaded to Debian yesterday.&lt;/p&gt;
+
+&lt;p&gt;As usual, if you use Bitcoin and want to show your support of my
+activities, please send Bitcoin donations to my address
+&lt;b&gt;&lt;a href=&quot;bitcoin:15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&quot;&gt;15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&lt;/a&gt;&lt;/b&gt;.&lt;/p&gt;
+</description>
+       </item>
+       
        <item>
                <title>Debian APT upgrade without enough free space on the disk...</title>
                <link>http://people.skolelinux.org/pere/blog/Debian_APT_upgrade_without_enough_free_space_on_the_disk___.html</link>
@@ -70,6 +328,14 @@ the packages that are simply too large to unpack.  Today this was
 &#39;ghc&#39;, but I have run into other large packages causing similar
 problems earlier (like TeX).&lt;/p&gt;
 
+&lt;p&gt;Update 2018-07-08: Thanks to Paul Wise, I am aware of two
+alternative ways to handle this.  The &quot;unattended-upgrades
+--minimal-upgrade-steps&quot; option will try to calculate upgrade sets for
+each package to upgrade, and then upgrade them in order, smallest set
+first.  It might be a better option than my above mentioned script.
+Also, &quot;aptutude upgrade&quot; can upgrade single packages, thus avoiding
+the need for using &quot;dpkg -i&quot; in the script above.&lt;/p&gt;
+
 &lt;p&gt;As usual, if you use Bitcoin and want to show your support of my
 activities, please send Bitcoin donations to my address
 &lt;b&gt;&lt;a href=&quot;bitcoin:15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&quot;&gt;15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&lt;/a&gt;&lt;/b&gt;.&lt;/p&gt;
@@ -374,124 +640,5 @@ messages with strangers like Facebook and Google.&lt;/p&gt;
 </description>
        </item>
        
-       <item>
-               <title>H, Ap, Frp og Venstre går for DNA-innsamling av hele befolkningen</title>
-               <link>http://people.skolelinux.org/pere/blog/H__Ap__Frp_og_Venstre_g_r_for_DNA_innsamling_av_hele_befolkningen.html</link>
-               <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/H__Ap__Frp_og_Venstre_g_r_for_DNA_innsamling_av_hele_befolkningen.html</guid>
-                <pubDate>Wed, 14 Mar 2018 14:15:00 +0100</pubDate>
-               <description>&lt;p&gt;I går kom det nok et argument for å holde seg unna det norske
-helsevesenet.  Da annonserte et stortingsflertall, bestående av Høyre,
-Arbeiderpartiet, Fremskrittspartiet og Venstre, at de går inn for å
-samle inn og lagre DNA-prøver fra hele befolkningen i Norge til evig
-tid.  Endringen gjelder innsamlede blodprøver fra nyfødte i Norge.
-Det vil dermed ta litt tid før en har hele befolkningen, men det er
-dit vi havner gitt nok tid.  I dag er det nesten hundre prosent
-oppslutning om undersøkelsen som gjøres like etter fødselen, på
-bakgrunn av blodprøven det er snakk om å lagre, for å oppdage endel
-medfødte sykdommer.  Blodprøven lagres i dag i inntil seks år.
-&lt;a href=&quot;https://www.stortinget.no/no/Saker-og-publikasjoner/Publikasjoner/Innstillinger/Stortinget/2017-2018/inns-201718-182l/?all=true&quot;&gt;Stortingets
-flertallsinnstilling&lt;/a&gt; er at tidsbegrensingen skal fjernes, og mener
-at tidsubegrenset lagring ikke vil påvirke oppslutningen om
-undersøkelsen.&lt;/p&gt;
-
-&lt;p&gt;Datatilsynet har ikke akkurat applaudert forslaget:&lt;/p&gt;
-
-&lt;p&gt;&lt;blockquote&gt;
-
-  &lt;p&gt;«Datatilsynet mener forslaget ikke i tilstrekkelig grad
-  synliggjør hvilke etiske og personvernmessige utfordringer som må
-  diskuteres før en etablerer en nasjonal biobank med blodprøver fra
-  hele befolkningen.»&lt;/p&gt;
-  
-&lt;/blockquote&gt;&lt;/p&gt;
-
-&lt;p&gt;Det er flere historier om hvordan innsamlet biologisk materiale har
-blitt brukt til andre formål enn de ble innsamlet til, og historien om
-&lt;a href=&quot;https://www.aftenposten.no/norge/i/Ql0WR/Na-ma-Folkehelsa-slette-uskyldiges-DNA-info&quot;&gt;folkehelseinstituttets
-lagring på vegne av politiet (Kripos) av innsamlet biologisk materiale
-og DNA-informasjon i strid med loven&lt;/a&gt; viser at en ikke kan være
-trygg på at lover og intensjoner beskytter de som blir berørt mot
-misbruk av slik privat og personlig informasjon.&lt;/p&gt;
-
-&lt;p&gt;Det er verdt å merke seg at det kan forskes på de innsamlede
-blodprøvene uten samtykke fra den det gjelder (eller foreldre når det
-gjelder barn), etter en lovendring for en stund tilbake, med mindre
-det er sendt inn skjema der en reserverer seg mot forskning uten
-samtykke.  Skjemaet er tilgjengelig fra
-&lt;a href=&quot;https://www.fhi.no/arkiv/publikasjoner/for-pasienter-skjema-for-reservasjo/&quot;&gt;folkehelseinstituttets
-websider&lt;/a&gt;, og jeg anbefaler, uavhengig av denne saken, varmt alle å
-sende inn skjemaet for å dokumentere hvor mange som ikke synes det er
-greit å fjerne krav om samtykke.&lt;/p&gt;
-
-&lt;p&gt;I tillegg bør en kreve destruering av alt biologisk materiale som
-er samlet inn om en selv, for å redusere eventuelle negative
-konsekvenser i fremtiden når materialet kommer på avveie eller blir
-brukt uten samtykke, men det er så vidt jeg vet ikke noe system for
-dette i dag.&lt;/p&gt;
-
-&lt;p&gt;Som vanlig, hvis du bruker Bitcoin og ønsker å vise din støtte til
-det jeg driver med, setter jeg pris på om du sender Bitcoin-donasjoner
-til min adresse
-&lt;b&gt;&lt;a href=&quot;bitcoin:15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&quot;&gt;15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&lt;/a&gt;&lt;/b&gt;.&lt;/p&gt;
-</description>
-       </item>
-       
-       <item>
-               <title>First rough draft Norwegian and Spanish edition of the book Made with Creative Commons</title>
-               <link>http://people.skolelinux.org/pere/blog/First_rough_draft_Norwegian_and_Spanish_edition_of_the_book_Made_with_Creative_Commons.html</link>
-               <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/First_rough_draft_Norwegian_and_Spanish_edition_of_the_book_Made_with_Creative_Commons.html</guid>
-                <pubDate>Tue, 13 Mar 2018 13:00:00 +0100</pubDate>
-               <description>&lt;p&gt;I am working on publishing yet another book related to Creative
-Commons.  This time it is a book filled with interviews and histories
-from those around the globe making a living using Creative
-Commons.&lt;/p&gt;
-
-&lt;p&gt;Yesterday, after many months of hard work by several volunteer
-translators, the first draft of a Norwegian Bokmål edition of the book
-&lt;a href=&quot;https://madewith.cc&quot;&gt;Made with Creative Commons from 2017&lt;/a&gt;
-was complete.  The Spanish translation is also complete, while the
-Dutch, Polish, German and Ukraine edition need a lot of work.  Get in
-touch if you want to help make those happen, or would like to
-translate into your mother tongue.&lt;/p&gt;
-
-&lt;p&gt;The whole book project started when
-&lt;a href=&quot;http://gwolf.org/node/4102&quot;&gt;Gunnar Wolf announced&lt;/a&gt; that he
-was going to make a Spanish edition of the book.  I noticed, and
-offered some input on how to make a book, based on my experience with
-translating the
-&lt;a href=&quot;https://www.lulu.com/shop/lawrence-lessig/fri-kultur/paperback/product-22441576.html&quot;&gt;Free
-Culture&lt;/a&gt; and
-&lt;a href=&quot;https://debian-handbook.info/get/#norwegian&quot;&gt;The Debian
-Administrator&#39;s Handbook&lt;/a&gt; books to Norwegian Bokmål.  To make a
-long story short, we ended up working on a Bokmål edition, and now the
-first rough translation is complete, thanks to the hard work of
-Ole-Erik Yrvin, Ingrid Yrvin, Allan Nordhøy and myself.  The first
-proof reading is almost done, and only the second and third proof
-reading remains.  We will also need to translate the 14 figures and
-create a book cover.  Once it is done we will publish the book on
-paper, as well as in PDF, ePub and possibly Mobi formats.&lt;/p&gt;
-
-&lt;p&gt;The book itself originates as a manuscript on Google Docs, is
-downloaded as ODT from there and converted to Markdown using pandoc.
-The Markdown is modified by a script before is converted to DocBook
-using pandoc.  The DocBook is modified again using a script before it
-is used to create a Gettext POT file for translators.  The translated
-PO file is then combined with the earlier mentioned DocBook file to
-create a translated DocBook file, which finally is given to dblatex to
-create the final PDF.  The end result is a set of editions of the
-manuscript, one English and one for each of the translations.&lt;/p&gt;
-
-&lt;p&gt;The translation is conducted using
-&lt;a href=&quot;https://hosted.weblate.org/projects/madewithcc/translation/&quot;&gt;the
-Weblate web based translation system&lt;/a&gt;.  Please have a look there
-and get in touch if you would like to help out with proof
-reading. :)&lt;/p&gt;
-
-&lt;p&gt;As usual, if you use Bitcoin and want to show your support of my
-activities, please send Bitcoin donations to my address
-&lt;b&gt;&lt;a href=&quot;bitcoin:15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&quot;&gt;15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&lt;/a&gt;&lt;/b&gt;.&lt;/p&gt;
-</description>
-       </item>
-       
         </channel>
 </rss>