]> pere.pagekite.me Git - homepage.git/blob - blog/index.rss
Generated.
[homepage.git] / blog / index.rss
1 <?xml version="1.0" encoding="utf-8"?>
2 <rss version='2.0' xmlns:lj='http://www.livejournal.org/rss/lj/1.0/' xmlns:atom="http://www.w3.org/2005/Atom">
3 <channel>
4 <title>Petter Reinholdtsen</title>
5 <description></description>
6 <link>http://people.skolelinux.org/pere/blog/</link>
7 <atom:link href="http://people.skolelinux.org/pere/blog/index.rss" rel="self" type="application/rss+xml" />
8
9 <item>
10 <title>Using the Kodi API to play Youtube videos</title>
11 <link>http://people.skolelinux.org/pere/blog/Using_the_Kodi_API_to_play_Youtube_videos.html</link>
12 <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/Using_the_Kodi_API_to_play_Youtube_videos.html</guid>
13 <pubDate>Sun, 2 Sep 2018 23:40:00 +0200</pubDate>
14 <description>&lt;p&gt;I continue to explore my Kodi installation, and today I wanted to
15 tell it to play a youtube URL I received in a chat, without having to
16 insert search terms using the on-screen keyboard. After searching the
17 web for API access to the Youtube plugin and testing a bit, I managed
18 to find a recipe that worked. If you got a kodi instance with its API
19 available from http://kodihost/jsonrpc, you can try the following to
20 have check out a nice cover band.&lt;/p&gt;
21
22 &lt;p&gt;&lt;blockquote&gt;&lt;pre&gt;curl --silent --header &#39;Content-Type: application/json&#39; \
23 --data-binary &#39;{ &quot;id&quot;: 1, &quot;jsonrpc&quot;: &quot;2.0&quot;, &quot;method&quot;: &quot;Player.Open&quot;,
24 &quot;params&quot;: {&quot;item&quot;: { &quot;file&quot;:
25 &quot;plugin://plugin.video.youtube/play/?video_id=LuRGVM9O0qg&quot; } } }&#39; \
26 http://projector.local/jsonrpc&lt;/pre&gt;&lt;/blockquote&gt;&lt;/p&gt;
27
28 &lt;p&gt;I&#39;ve extended kodi-stream program to take a video source as its
29 first argument. It can now handle direct video links, youtube links
30 and &#39;desktop&#39; to stream my desktop to Kodi. It is almost like a
31 Chromecast. :)&lt;/p&gt;
32
33 &lt;p&gt;As usual, if you use Bitcoin and want to show your support of my
34 activities, please send Bitcoin donations to my address
35 &lt;b&gt;&lt;a href=&quot;bitcoin:15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&quot;&gt;15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&lt;/a&gt;&lt;/b&gt;.&lt;/p&gt;
36 </description>
37 </item>
38
39 <item>
40 <title>Software created using taxpayers’ money should be Free Software</title>
41 <link>http://people.skolelinux.org/pere/blog/Software_created_using_taxpayers__money_should_be_Free_Software.html</link>
42 <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/Software_created_using_taxpayers__money_should_be_Free_Software.html</guid>
43 <pubDate>Thu, 30 Aug 2018 13:50:00 +0200</pubDate>
44 <description>&lt;p&gt;It might seem obvious that software created using tax money should
45 be available for everyone to use and improve. Free Software
46 Foundation Europe recentlystarted a campaign to help get more people
47 to understand this, and I just signed the petition on
48 &lt;a href=&quot;https://publiccode.eu/&quot;&gt;Public Money, Public Code&lt;/a&gt; to help
49 them. I hope you too will do the same.&lt;/p&gt;
50 </description>
51 </item>
52
53 <item>
54 <title>A bit more on privacy respecting health monitor / fitness tracker</title>
55 <link>http://people.skolelinux.org/pere/blog/A_bit_more_on_privacy_respecting_health_monitor___fitness_tracker.html</link>
56 <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/A_bit_more_on_privacy_respecting_health_monitor___fitness_tracker.html</guid>
57 <pubDate>Mon, 13 Aug 2018 09:00:00 +0200</pubDate>
58 <description>&lt;p&gt;A few days ago, I wondered if there are any privacy respecting
59 health monitors and/or fitness trackers available for sale these days.
60 I would like to buy one, but do not want to share my personal data
61 with strangers, nor be forced to have a mobile phone to get data out
62 of the unit. I&#39;ve received some ideas, and would like to share them
63 with you.
64
65 One interesting data point was a pointer to a Free Software app for
66 Android named
67 &lt;a href=&quot;https://github.com/Freeyourgadget/Gadgetbridge/&quot;&gt;Gadgetbridge&lt;/a&gt;.
68 It provide cloudless collection and storing of data from a variety of
69 trackers. Its
70 &lt;a href=&quot;https://github.com/Freeyourgadget/Gadgetbridge/#supported-devices&quot;&gt;list
71 of supported devices&lt;/a&gt; is a good indicator for units where the
72 protocol is fairly open, as it is obviously being handled by Free
73 Software. Other units are reportedly encrypting the collected
74 information with their own public key, making sure only the vendor
75 cloud service is able to extract data from the unit. The people
76 contacting me about Gadgetbirde said they were using
77 &lt;a href=&quot;https://us.amazfit.com/shop/bip?variant=336750&quot;&gt;Amazfit
78 Bip&lt;/a&gt; and
79 &lt;a href=&quot;http://www.xiaomimi6phone.com/xiaomi-mi-band-3-features-release-date-rumors/&quot;&gt;Xiaomi
80 Band 3&lt;/a&gt;.&lt;/p&gt;
81
82 &lt;p&gt;I also got a suggestion to look at some of the units from Garmin.
83 I was told their GPS watches can be connected via USB and show up as a
84 USB storage device with
85 &lt;a href=&quot;https://www.gpsbabel.org/htmldoc-development/fmt_garmin_fit.html&quot;&gt;Garmin
86 FIT files&lt;/a&gt; containing the collected measurements. While
87 proprietary, FIT files apparently can be read at least by
88 &lt;a href=&quot;https://www.gpsbabel.org&quot;&gt;GPSBabel&lt;/a&gt; and the
89 &lt;a href=&quot;https://apps.nextcloud.com/apps/gpxpod&quot;&gt;GpxPod&lt;/a&gt; Nextcloud
90 app. It is unclear to me if they can read step count and heart rate
91 data. The person I talked to was using a
92 &lt;a href=&quot;https://buy.garmin.com/en-US/US/p/564291&quot;&gt;Garmin Forerunner
93 935&lt;/a&gt;, which is a fairly expensive unit. I doubt it is worth it for
94 a unit where the vendor clearly is trying its best to move from open
95 to closed systems. I still remember when Garmin dropped NMEA support
96 in its GPSes.&lt;/p&gt;
97
98 &lt;p&gt;A final idea was to build ones own unit, perhaps by basing it on a
99 wearable hardware platforms like
100 &lt;a href=&quot;https://learn.adafruit.com/flora-geo-watch&quot;&gt;the Flora Geo
101 Watch&lt;/a&gt;. Sound like fun, but I had more money than time to spend on
102 the topic, so I suspect it will have to wait for another time.&lt;/p&gt;
103
104 &lt;p&gt;While I was working on tracking down links, I came across an
105 inspiring TED talk by Dave Debronkart about
106 &lt;a href=&quot;https://archive.org/details/DavedeBronkart_2010X&quot;&gt;being a
107 e-patient&lt;/a&gt;, and discovered the web site
108 &lt;a href=&quot;https://participatorymedicine.org/epatients/&quot;&gt;Participatory
109 Medicine&lt;/a&gt;. If you too want to track your own health and fitness
110 without having information about your private life floating around on
111 computers owned by others, I recommend checking it out.&lt;/p&gt;
112
113 &lt;p&gt;As usual, if you use Bitcoin and want to show your support of my
114 activities, please send Bitcoin donations to my address
115 &lt;b&gt;&lt;a href=&quot;bitcoin:15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&quot;&gt;15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&lt;/a&gt;&lt;/b&gt;.&lt;/p&gt;
116 </description>
117 </item>
118
119 <item>
120 <title>Privacy respecting health monitor / fitness tracker?</title>
121 <link>http://people.skolelinux.org/pere/blog/Privacy_respecting_health_monitor___fitness_tracker_.html</link>
122 <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/Privacy_respecting_health_monitor___fitness_tracker_.html</guid>
123 <pubDate>Tue, 7 Aug 2018 16:00:00 +0200</pubDate>
124 <description>&lt;p&gt;Dear lazyweb,&lt;/p&gt;
125
126 &lt;p&gt;I wonder, is there a fitness tracker / health monitor available for
127 sale today that respect the users privacy? With this I mean a
128 watch/bracelet capable of measuring pulse rate and other
129 fitness/health related values (and by all means, also the correct time
130 and location if possible), which is &lt;strong&gt;only&lt;/strong&gt; provided for
131 me to extract/read from the unit with computer without a radio beacon
132 and Internet connection. In other words, it do not depend on a cell
133 phone app, and do make the measurements available via other peoples
134 computer (aka &quot;the cloud&quot;). The collected data should be available
135 using only free software. I&#39;m not interested in depending on some
136 non-free software that will leave me high and dry some time in the
137 future. I&#39;ve been unable to find any such unit. I would like to buy
138 it. The ones I have seen for sale here in Norway are proud to report
139 that they share my health data with strangers (aka &quot;cloud enabled&quot;).
140 Is there an alternative? I&#39;m not interested in giving money to people
141 requiring me to accept &quot;privacy terms&quot; to allow myself to measure my
142 own health.&lt;/p&gt;
143
144 &lt;p&gt;As usual, if you use Bitcoin and want to show your support of my
145 activities, please send Bitcoin donations to my address
146 &lt;b&gt;&lt;a href=&quot;bitcoin:15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&quot;&gt;15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&lt;/a&gt;&lt;/b&gt;.&lt;/p&gt;
147 </description>
148 </item>
149
150 <item>
151 <title>Sharing images with friends and family using RSS and EXIF/XMP metadata</title>
152 <link>http://people.skolelinux.org/pere/blog/Sharing_images_with_friends_and_family_using_RSS_and_EXIF_XMP_metadata.html</link>
153 <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/Sharing_images_with_friends_and_family_using_RSS_and_EXIF_XMP_metadata.html</guid>
154 <pubDate>Tue, 31 Jul 2018 23:30:00 +0200</pubDate>
155 <description>&lt;p&gt;For a while now, I have looked for a sensible way to share images
156 with my family using a self hosted solution, as it is unacceptable to
157 place images from my personal life under the control of strangers
158 working for data hoarders like Google or Dropbox. The last few days I
159 have drafted an approach that might work out, and I would like to
160 share it with you. I would like to publish images on a server under
161 my control, and point some Internet connected display units using some
162 free and open standard to the images I published. As my primary
163 language is not limited to ASCII, I need to store metadata using
164 UTF-8. Many years ago, I hoped to find a digital photo frame capable
165 of reading a RSS feed with image references (aka using the
166 &amp;lt;enclosure&amp;gt; RSS tag), but was unable to find a current supplier
167 of such frames. In the end I gave up that approach.&lt;/p&gt;
168
169 &lt;p&gt;Some months ago, I discovered that
170 &lt;a href=&quot;https://www.jwz.org/xscreensaver/&quot;&gt;XScreensaver&lt;/a&gt; is able to
171 read images from a RSS feed, and used it to set up a screen saver on
172 my home info screen, showing images from the Daily images feed from
173 NASA. This proved to work well. More recently I discovered that
174 &lt;a href=&quot;https://kodi.tv&quot;&gt;Kodi&lt;/a&gt; (both using
175 &lt;a href=&quot;https://www.openelec.tv/&quot;&gt;OpenELEC&lt;/a&gt; and
176 &lt;a href=&quot;https://libreelec.tv&quot;&gt;LibreELEC&lt;/a&gt;) provide the
177 &lt;a href=&quot;https://github.com/grinsted/script.screensaver.feedreader&quot;&gt;Feedreader&lt;/a&gt;
178 screen saver capable of reading a RSS feed with images and news. For
179 fun, I used it this summer to test Kodi on my parents TV by hooking up
180 a Raspberry PI unit with LibreELEC, and wanted to provide them with a
181 screen saver showing selected pictures from my selection.&lt;/p&gt;
182
183 &lt;p&gt;Armed with motivation and a test photo frame, I set out to generate
184 a RSS feed for the Kodi instance. I adjusted my &lt;a
185 href=&quot;https://freedombox.org/&quot;&gt;Freedombox&lt;/a&gt; instance, created
186 /var/www/html/privatepictures/, wrote a small Perl script to extract
187 title and description metadata from the photo files and generate the
188 RSS file. I ended up using Perl instead of python, as the
189 libimage-exiftool-perl Debian package seemed to handle the EXIF/XMP
190 tags I ended up using, while python3-exif did not. The relevant EXIF
191 tags only support ASCII, so I had to find better alternatives. XMP
192 seem to have the support I need.&lt;/p&gt;
193
194 &lt;p&gt;I am a bit unsure which EXIF/XMP tags to use, as I would like to
195 use tags that can be easily added/updated using normal free software
196 photo managing software. I ended up using the tags set using this
197 exiftool command, as these tags can also be set using digiKam:&lt;/p&gt;
198
199 &lt;blockquote&gt;&lt;pre&gt;
200 exiftool -headline=&#39;The RSS image title&#39; \
201 -description=&#39;The RSS image description.&#39; \
202 -subject+=for-family photo.jpeg
203 &lt;/pre&gt;&lt;/blockquote&gt;
204
205 &lt;p&gt;I initially tried the &quot;-title&quot; and &quot;keyword&quot; tags, but they were
206 invisible in digiKam, so I changed to &quot;-headline&quot; and &quot;-subject&quot;. I
207 use the keyword/subject &#39;for-family&#39; to flag that the photo should be
208 shared with my family. Images with this keyword set are located and
209 copied into my Freedombox for the RSS generating script to find.&lt;/p&gt;
210
211 &lt;p&gt;Are there better ways to do this? Get in touch if you have better
212 suggestions.&lt;/p&gt;
213
214 &lt;p&gt;As usual, if you use Bitcoin and want to show your support of my
215 activities, please send Bitcoin donations to my address
216 &lt;b&gt;&lt;a href=&quot;bitcoin:15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&quot;&gt;15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&lt;/a&gt;&lt;/b&gt;.&lt;/p&gt;
217 </description>
218 </item>
219
220 <item>
221 <title>Simple streaming the Linux desktop to Kodi using GStreamer and RTP</title>
222 <link>http://people.skolelinux.org/pere/blog/Simple_streaming_the_Linux_desktop_to_Kodi_using_GStreamer_and_RTP.html</link>
223 <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/Simple_streaming_the_Linux_desktop_to_Kodi_using_GStreamer_and_RTP.html</guid>
224 <pubDate>Thu, 12 Jul 2018 17:55:00 +0200</pubDate>
225 <description>&lt;p&gt;Last night, I wrote
226 &lt;a href=&quot;http://people.skolelinux.org/pere/blog/Streaming_the_Linux_desktop_to_Kodi_using_VLC_and_RTSP.html&quot;&gt;a
227 recipe to stream a Linux desktop using VLC to a instance of Kodi&lt;/a&gt;.
228 During the day I received valuable feedback, and thanks to the
229 suggestions I have been able to rewrite the recipe into a much simpler
230 approach requiring no setup at all. It is a single script that take
231 care of it all.&lt;/p&gt;
232
233 &lt;p&gt;This new script uses GStreamer instead of VLC to capture the
234 desktop and stream it to Kodi. This fixed the video quality issue I
235 saw initially. It further removes the need to add a m3u file on the
236 Kodi machine, as it instead connects to
237 &lt;a href=&quot;https://kodi.wiki/view/JSON-RPC_API/v8&quot;&gt;the JSON-RPC API in
238 Kodi&lt;/a&gt; and simply ask Kodi to play from the stream created using
239 GStreamer. Streaming the desktop to Kodi now become trivial. Copy
240 the script below, run it with the DNS name or IP address of the kodi
241 server to stream to as the only argument, and watch your screen show
242 up on the Kodi screen. Note, it depend on multicast on the local
243 network, so if you need to stream outside the local network, the
244 script must be modified. Also note, I have no idea if audio work, as
245 I only care about the picture part.&lt;/p&gt;
246
247 &lt;blockquote&gt;&lt;pre&gt;
248 #!/bin/sh
249 #
250 # Stream the Linux desktop view to Kodi. See
251 # http://people.skolelinux.org/pere/blog/Streaming_the_Linux_desktop_to_Kodi_using_VLC_and_RTSP.html
252 # for backgorund information.
253
254 # Make sure the stream is stopped in Kodi and the gstreamer process is
255 # killed if something go wrong (for example if curl is unable to find the
256 # kodi server). Do the same when interrupting this script.
257 kodicmd() {
258 host=&quot;$1&quot;
259 cmd=&quot;$2&quot;
260 params=&quot;$3&quot;
261 curl --silent --header &#39;Content-Type: application/json&#39; \
262 --data-binary &quot;{ \&quot;id\&quot;: 1, \&quot;jsonrpc\&quot;: \&quot;2.0\&quot;, \&quot;method\&quot;: \&quot;$cmd\&quot;, \&quot;params\&quot;: $params }&quot; \
263 &quot;http://$host/jsonrpc&quot;
264 }
265 cleanup() {
266 if [ -n &quot;$kodihost&quot; ] ; then
267 # Stop the playing when we end
268 playerid=$(kodicmd &quot;$kodihost&quot; Player.GetActivePlayers &quot;{}&quot; |
269 jq .result[].playerid)
270 kodicmd &quot;$kodihost&quot; Player.Stop &quot;{ \&quot;playerid\&quot; : $playerid }&quot; &gt; /dev/null
271 fi
272 if [ &quot;$gstpid&quot; ] &amp;&amp; kill -0 &quot;$gstpid&quot; &gt;/dev/null 2&gt;&amp;1; then
273 kill &quot;$gstpid&quot;
274 fi
275 }
276 trap cleanup EXIT INT
277
278 if [ -n &quot;$1&quot; ]; then
279 kodihost=$1
280 shift
281 else
282 kodihost=kodi.local
283 fi
284
285 mcast=239.255.0.1
286 mcastport=1234
287 mcastttl=1
288
289 pasrc=$(pactl list | grep -A2 &#39;Source #&#39; | grep &#39;Name: .*\.monitor$&#39; | \
290 cut -d&quot; &quot; -f2|head -1)
291 gst-launch-1.0 ximagesrc use-damage=0 ! video/x-raw,framerate=30/1 ! \
292 videoconvert ! queue2 ! \
293 x264enc bitrate=8000 speed-preset=superfast tune=zerolatency qp-min=30 \
294 key-int-max=15 bframes=2 ! video/x-h264,profile=high ! queue2 ! \
295 mpegtsmux alignment=7 name=mux ! rndbuffersize max=1316 min=1316 ! \
296 udpsink host=$mcast port=$mcastport ttl-mc=$mcastttl auto-multicast=1 sync=0 \
297 pulsesrc device=$pasrc ! audioconvert ! queue2 ! avenc_aac ! queue2 ! mux. \
298 &gt; /dev/null 2&gt;&amp;1 &amp;
299 gstpid=$!
300
301 # Give stream a second to get going
302 sleep 1
303
304 # Ask kodi to start streaming using its JSON-RPC API
305 kodicmd &quot;$kodihost&quot; Player.Open \
306 &quot;{\&quot;item\&quot;: { \&quot;file\&quot;: \&quot;udp://@$mcast:$mcastport\&quot; } }&quot; &gt; /dev/null
307
308 # wait for gst to end
309 wait &quot;$gstpid&quot;
310 &lt;/pre&gt;&lt;/blockquote&gt;
311
312 &lt;p&gt;I hope you find the approach useful. I know I do.&lt;/p&gt;
313
314 &lt;p&gt;As usual, if you use Bitcoin and want to show your support of my
315 activities, please send Bitcoin donations to my address
316 &lt;b&gt;&lt;a href=&quot;bitcoin:15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&quot;&gt;15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&lt;/a&gt;&lt;/b&gt;.&lt;/p&gt;
317 </description>
318 </item>
319
320 <item>
321 <title>Streaming the Linux desktop to Kodi using VLC and RTSP</title>
322 <link>http://people.skolelinux.org/pere/blog/Streaming_the_Linux_desktop_to_Kodi_using_VLC_and_RTSP.html</link>
323 <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/Streaming_the_Linux_desktop_to_Kodi_using_VLC_and_RTSP.html</guid>
324 <pubDate>Thu, 12 Jul 2018 02:00:00 +0200</pubDate>
325 <description>&lt;p&gt;PS: See
326 &lt;ahref=&quot;http://people.skolelinux.org/pere/blog/Simple_streaming_the_Linux_desktop_to_Kodi_using_GStreamer_and_RTP.html&quot;&gt;the
327 followup post&lt;/a&gt; for a even better approach.&lt;/p&gt;
328
329 &lt;p&gt;A while back, I was asked by a friend how to stream the desktop to
330 my projector connected to Kodi. I sadly had to admit that I had no
331 idea, as it was a task I never had tried. Since then, I have been
332 looking for a way to do so, preferable without much extra software to
333 install on either side. Today I found a way that seem to kind of
334 work. Not great, but it is a start.&lt;/p&gt;
335
336 &lt;p&gt;I had a look at several approaches, for example
337 &lt;a href=&quot;https://github.com/mfoetsch/dlna_live_streaming&quot;&gt;using uPnP
338 DLNA as described in 2011&lt;/a&gt;, but it required a uPnP server, fuse and
339 local storage enough to store the stream locally. This is not going
340 to work well for me, lacking enough free space, and it would
341 impossible for my friend to get working.&lt;/p&gt;
342
343 &lt;p&gt;Next, it occurred to me that perhaps I could use VLC to create a
344 video stream that Kodi could play. Preferably using
345 broadcast/multicast, to avoid having to change any setup on the Kodi
346 side when starting such stream. Unfortunately, the only recipe I
347 could find using multicast used the rtp protocol, and this protocol
348 seem to not be supported by Kodi.&lt;/p&gt;
349
350 &lt;p&gt;On the other hand, the rtsp protocol is working! Unfortunately I
351 have to specify the IP address of the streaming machine in both the
352 sending command and the file on the Kodi server. But it is showing my
353 desktop, and thus allow us to have a shared look on the big screen at
354 the programs I work on.&lt;/p&gt;
355
356 &lt;p&gt;I did not spend much time investigating codeces. I combined the
357 rtp and rtsp recipes from
358 &lt;a href=&quot;https://wiki.videolan.org/Documentation:Streaming_HowTo/Command_Line_Examples/&quot;&gt;the
359 VLC Streaming HowTo/Command Line Examples&lt;/a&gt;, and was able to get
360 this working on the desktop/streaming end.&lt;/p&gt;
361
362 &lt;blockquote&gt;&lt;pre&gt;
363 vlc screen:// --sout \
364 &#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;
365 &lt;/pre&gt;&lt;/blockquote&gt;
366
367 &lt;p&gt;I ssh-ed into my Kodi box and created a file like this with the
368 same IP address:&lt;/p&gt;
369
370 &lt;blockquote&gt;&lt;pre&gt;
371 echo rtsp://192.168.11.4:8080/test.sdp \
372 &gt; /storage/videos/screenstream.m3u
373 &lt;/pre&gt;&lt;/blockquote&gt;
374
375 &lt;p&gt;Note the 192.168.11.4 IP address is my desktops IP address. As far
376 as I can tell the IP must be hardcoded for this to work. In other
377 words, if someone elses machine is going to do the steaming, you have
378 to update screenstream.m3u on the Kodi machine and adjust the vlc
379 recipe. To get started, locate the file in Kodi and select the m3u
380 file while the VLC stream is running. The desktop then show up in my
381 big screen. :)&lt;/p&gt;
382
383 &lt;p&gt;When using the same technique to stream a video file with audio,
384 the audio quality is really bad. No idea if the problem is package
385 loss or bad parameters for the transcode. I do not know VLC nor Kodi
386 enough to tell.&lt;/p&gt;
387
388 &lt;p&gt;&lt;strong&gt;Update 2018-07-12&lt;/strong&gt;: Johannes Schauer send me a few
389 succestions and reminded me about an important step. The &quot;screen:&quot;
390 input source is only available once the vlc-plugin-access-extra
391 package is installed on Debian. Without it, you will see this error
392 message: &quot;VLC is unable to open the MRL &#39;screen://&#39;. Check the log
393 for details.&quot; He further found that it is possible to drop some parts
394 of the VLC command line to reduce the amount of hardcoded information.
395 It is also useful to consider using cvlc to avoid having the VLC
396 window in the desktop view. In sum, this give us this command line on
397 the source end
398
399 &lt;blockquote&gt;&lt;pre&gt;
400 cvlc screen:// --sout \
401 &#39;#transcode{vcodec=mp4v,acodec=mpga,vb=800,ab=128}:rtp{sdp=rtsp://:8080/}&#39;
402 &lt;/pre&gt;&lt;/blockquote&gt;
403
404 &lt;p&gt;and this on the Kodi end&lt;p&gt;
405
406 &lt;blockquote&gt;&lt;pre&gt;
407 echo rtsp://192.168.11.4:8080/ \
408 &gt; /storage/videos/screenstream.m3u
409 &lt;/pre&gt;&lt;/blockquote&gt;
410
411 &lt;p&gt;Still bad image quality, though. But I did discover that streaming
412 a DVD using dvdsimple:///dev/dvd as the source had excellent video and
413 audio quality, so I guess the issue is in the input or transcoding
414 parts, not the rtsp part. I&#39;ve tried to change the vb and ab
415 parameters to use more bandwidth, but it did not make a
416 difference.&lt;/p&gt;
417
418 &lt;p&gt;I further received a suggestion from Einar Haraldseid to try using
419 gstreamer instead of VLC, and this proved to work great! He also
420 provided me with the trick to get Kodi to use a multicast stream as
421 its source. By using this monstrous oneliner, I can stream my desktop
422 with good video quality in reasonable framerate to the 239.255.0.1
423 multicast address on port 1234:
424
425 &lt;blockquote&gt;&lt;pre&gt;
426 gst-launch-1.0 ximagesrc use-damage=0 ! video/x-raw,framerate=30/1 ! \
427 videoconvert ! queue2 ! \
428 x264enc bitrate=8000 speed-preset=superfast tune=zerolatency qp-min=30 \
429 key-int-max=15 bframes=2 ! video/x-h264,profile=high ! queue2 ! \
430 mpegtsmux alignment=7 name=mux ! rndbuffersize max=1316 min=1316 ! \
431 udpsink host=239.255.0.1 port=1234 ttl-mc=1 auto-multicast=1 sync=0 \
432 pulsesrc device=$(pactl list | grep -A2 &#39;Source #&#39; | \
433 grep &#39;Name: .*\.monitor$&#39; | cut -d&quot; &quot; -f2|head -1) ! \
434 audioconvert ! queue2 ! avenc_aac ! queue2 ! mux.
435 &lt;/pre&gt;&lt;/blockquote&gt;
436
437 &lt;p&gt;and this on the Kodi end&lt;p&gt;
438
439 &lt;blockquote&gt;&lt;pre&gt;
440 echo udp://@239.255.0.1:1234 \
441 &gt; /storage/videos/screenstream.m3u
442 &lt;/pre&gt;&lt;/blockquote&gt;
443
444 &lt;p&gt;Note the trick to pick a valid pulseaudio source. It might not
445 pick the one you need. This approach will of course lead to trouble
446 if more than one source uses the same multicast port and address.
447 Note the ttl-mc=1 setting, which limit the multicast packages to the
448 local network. If the value is increased, your screen will be
449 broadcasted further, one network &quot;hop&quot; for each increase (read up on
450 multicast to learn more. :)!&lt;/p&gt;
451
452 &lt;p&gt;Having cracked how to get Kodi to receive multicast streams, I
453 could use this VLC command to stream to the same multicast address.
454 The image quality is way better than the rtsp approach, but gstreamer
455 seem to be doing a better job.&lt;/p&gt;
456
457 &lt;blockquote&gt;&lt;pre&gt;
458 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;
459 &lt;/pre&gt;&lt;/blockquote&gt;
460
461 &lt;p&gt;As usual, if you use Bitcoin and want to show your support of my
462 activities, please send Bitcoin donations to my address
463 &lt;b&gt;&lt;a href=&quot;bitcoin:15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&quot;&gt;15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&lt;/a&gt;&lt;/b&gt;.&lt;/p&gt;
464 </description>
465 </item>
466
467 <item>
468 <title>What is the most supported MIME type in Debian in 2018?</title>
469 <link>http://people.skolelinux.org/pere/blog/What_is_the_most_supported_MIME_type_in_Debian_in_2018_.html</link>
470 <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/What_is_the_most_supported_MIME_type_in_Debian_in_2018_.html</guid>
471 <pubDate>Mon, 9 Jul 2018 08:05:00 +0200</pubDate>
472 <description>&lt;p&gt;Five years ago,
473 &lt;a href=&quot;http://people.skolelinux.org/pere/blog/What_is_the_most_supported_MIME_type_in_Debian_.html&quot;&gt;I
474 measured what the most supported MIME type in Debian was&lt;/a&gt;, by
475 analysing the desktop files in all packages in the archive. Since
476 then, the DEP-11 AppStream system has been put into production, making
477 the task a lot easier. This made me want to repeat the measurement,
478 to see how much things changed. Here are the new numbers, for
479 unstable only this time:
480
481 &lt;p&gt;&lt;strong&gt;Debian Unstable:&lt;/strong&gt;&lt;/p&gt;
482
483 &lt;pre&gt;
484 count MIME type
485 ----- -----------------------
486 56 image/jpeg
487 55 image/png
488 49 image/tiff
489 48 image/gif
490 39 image/bmp
491 38 text/plain
492 37 audio/mpeg
493 34 application/ogg
494 33 audio/x-flac
495 32 audio/x-mp3
496 30 audio/x-wav
497 30 audio/x-vorbis+ogg
498 29 image/x-portable-pixmap
499 27 inode/directory
500 27 image/x-portable-bitmap
501 27 audio/x-mpeg
502 26 application/x-ogg
503 25 audio/x-mpegurl
504 25 audio/ogg
505 24 text/html
506 &lt;/pre&gt;
507
508 &lt;p&gt;The list was created like this using a sid chroot: &quot;cat
509 /var/lib/apt/lists/*sid*_dep11_Components-amd64.yml.gz| zcat | awk &#39;/^
510 - \S+\/\S+$/ {print $2 }&#39; | sort | uniq -c | sort -nr | head -20&quot;&lt;/p&gt;
511
512 &lt;p&gt;It is interesting to see how image formats have passed text/plain
513 as the most announced supported MIME type. These days, thanks to the
514 AppStream system, if you run into a file format you do not know, and
515 want to figure out which packages support the format, you can find the
516 MIME type of the file using &quot;file --mime &amp;lt;filename&amp;gt;&quot;, and then
517 look up all packages announcing support for this format in their
518 AppStream metadata (XML or .desktop file) using &quot;appstreamcli
519 what-provides mimetype &amp;lt;mime-type&amp;gt;. For example if you, like
520 me, want to know which packages support inode/directory, you can get a
521 list like this:&lt;/p&gt;
522
523 &lt;p&gt;&lt;blockquote&gt;&lt;pre&gt;
524 % appstreamcli what-provides mimetype inode/directory | grep Package: | sort
525 Package: anjuta
526 Package: audacious
527 Package: baobab
528 Package: cervisia
529 Package: chirp
530 Package: dolphin
531 Package: doublecmd-common
532 Package: easytag
533 Package: enlightenment
534 Package: ephoto
535 Package: filelight
536 Package: gwenview
537 Package: k4dirstat
538 Package: kaffeine
539 Package: kdesvn
540 Package: kid3
541 Package: kid3-qt
542 Package: nautilus
543 Package: nemo
544 Package: pcmanfm
545 Package: pcmanfm-qt
546 Package: qweborf
547 Package: ranger
548 Package: sirikali
549 Package: spacefm
550 Package: spacefm
551 Package: vifm
552 %
553 &lt;/pre&gt;&lt;/blockquote&gt;&lt;/p&gt;
554
555 &lt;p&gt;Using the same method, I can quickly discover that the Sketchup file
556 format is not yet supported by any package in Debian:&lt;/p&gt;
557
558 &lt;p&gt;&lt;blockquote&gt;&lt;pre&gt;
559 % appstreamcli what-provides mimetype application/vnd.sketchup.skp
560 Could not find component providing &#39;mimetype::application/vnd.sketchup.skp&#39;.
561 %
562 &lt;/pre&gt;&lt;/blockquote&gt;&lt;/p&gt;
563
564 &lt;p&gt;Yesterday I used it to figure out which packages support the STL 3D
565 format:&lt;/p&gt;
566
567 &lt;p&gt;&lt;blockquote&gt;&lt;pre&gt;
568 % appstreamcli what-provides mimetype application/sla|grep Package
569 Package: cura
570 Package: meshlab
571 Package: printrun
572 %
573 &lt;/pre&gt;&lt;/blockquote&gt;&lt;/p&gt;
574
575 &lt;p&gt;PS: A new version of Cura was uploaded to Debian yesterday.&lt;/p&gt;
576
577 &lt;p&gt;As usual, if you use Bitcoin and want to show your support of my
578 activities, please send Bitcoin donations to my address
579 &lt;b&gt;&lt;a href=&quot;bitcoin:15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&quot;&gt;15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&lt;/a&gt;&lt;/b&gt;.&lt;/p&gt;
580 </description>
581 </item>
582
583 <item>
584 <title>Debian APT upgrade without enough free space on the disk...</title>
585 <link>http://people.skolelinux.org/pere/blog/Debian_APT_upgrade_without_enough_free_space_on_the_disk___.html</link>
586 <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/Debian_APT_upgrade_without_enough_free_space_on_the_disk___.html</guid>
587 <pubDate>Sun, 8 Jul 2018 12:10:00 +0200</pubDate>
588 <description>&lt;p&gt;Quite regularly, I let my Debian Sid/Unstable chroot stay untouch
589 for a while, and when I need to update it there is not enough free
590 space on the disk for apt to do a normal &#39;apt upgrade&#39;. I normally
591 would resolve the issue by doing &#39;apt install &amp;lt;somepackages&amp;gt;&#39; to
592 upgrade only some of the packages in one batch, until the amount of
593 packages to download fall below the amount of free space available.
594 Today, I had about 500 packages to upgrade, and after a while I got
595 tired of trying to install chunks of packages manually. I concluded
596 that I did not have the spare hours required to complete the task, and
597 decided to see if I could automate it. I came up with this small
598 script which I call &#39;apt-in-chunks&#39;:&lt;/p&gt;
599
600 &lt;p&gt;&lt;blockquote&gt;&lt;pre&gt;
601 #!/bin/sh
602 #
603 # Upgrade packages when the disk is too full to upgrade every
604 # upgradable package in one lump. Fetching packages to upgrade using
605 # apt, and then installing using dpkg, to avoid changing the package
606 # flag for manual/automatic.
607
608 set -e
609
610 ignore() {
611 if [ &quot;$1&quot; ]; then
612 grep -v &quot;$1&quot;
613 else
614 cat
615 fi
616 }
617
618 for p in $(apt list --upgradable | ignore &quot;$@&quot; |cut -d/ -f1 | grep -v &#39;^Listing...&#39;); do
619 echo &quot;Upgrading $p&quot;
620 apt clean
621 apt install --download-only -y $p
622 for f in /var/cache/apt/archives/*.deb; do
623 if [ -e &quot;$f&quot; ]; then
624 dpkg -i /var/cache/apt/archives/*.deb
625 break
626 fi
627 done
628 done
629 &lt;/pre&gt;&lt;/blockquote&gt;&lt;/p&gt;
630
631 &lt;p&gt;The script will extract the list of packages to upgrade, try to
632 download the packages needed to upgrade one package, install the
633 downloaded packages using dpkg. The idea is to upgrade packages
634 without changing the APT mark for the package (ie the one recording of
635 the package was manually requested or pulled in as a dependency). To
636 use it, simply run it as root from the command line. If it fail, try
637 &#39;apt install -f&#39; to clean up the mess and run the script again. This
638 might happen if the new packages conflict with one of the old
639 packages. dpkg is unable to remove, while apt can do this.&lt;/p&gt;
640
641 &lt;p&gt;It take one option, a package to ignore in the list of packages to
642 upgrade. The option to ignore a package is there to be able to skip
643 the packages that are simply too large to unpack. Today this was
644 &#39;ghc&#39;, but I have run into other large packages causing similar
645 problems earlier (like TeX).&lt;/p&gt;
646
647 &lt;p&gt;Update 2018-07-08: Thanks to Paul Wise, I am aware of two
648 alternative ways to handle this. The &quot;unattended-upgrades
649 --minimal-upgrade-steps&quot; option will try to calculate upgrade sets for
650 each package to upgrade, and then upgrade them in order, smallest set
651 first. It might be a better option than my above mentioned script.
652 Also, &quot;aptutude upgrade&quot; can upgrade single packages, thus avoiding
653 the need for using &quot;dpkg -i&quot; in the script above.&lt;/p&gt;
654
655 &lt;p&gt;As usual, if you use Bitcoin and want to show your support of my
656 activities, please send Bitcoin donations to my address
657 &lt;b&gt;&lt;a href=&quot;bitcoin:15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&quot;&gt;15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&lt;/a&gt;&lt;/b&gt;.&lt;/p&gt;
658 </description>
659 </item>
660
661 <item>
662 <title>The worlds only stone power plant?</title>
663 <link>http://people.skolelinux.org/pere/blog/The_worlds_only_stone_power_plant_.html</link>
664 <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/The_worlds_only_stone_power_plant_.html</guid>
665 <pubDate>Sat, 30 Jun 2018 10:35:00 +0200</pubDate>
666 <description>&lt;p&gt;So far, at least hydro-electric power, coal power, wind power,
667 solar power, and wood power are well known. Until a few days ago, I
668 had never heard of stone power. Then I learn about a quarry in a
669 mountain in
670 &lt;a href=&quot;https://en.wikipedia.org/wiki/Bremanger&quot;&gt;Bremanger&lt;/a&gt; i
671 Norway, where
672 &lt;a href=&quot;https://www.bontrup.com/en/activities/raw-materials/bremanger-quarry/&quot;&gt;the
673 Bremanger Quarry&lt;/a&gt; company is extracting stone and dumping the stone
674 into a shaft leading to its shipping harbour. This downward movement
675 in this shaft is used to produce electricity. In short, it is using
676 falling rocks instead of falling water to produce electricity, and
677 according to its own statements it is producing more power than it is
678 using, and selling the surplus electricity to the Norwegian power
679 grid. I find the concept truly amazing. Is this the worlds only
680 stone power plant?&lt;/p&gt;
681
682 &lt;p&gt;As usual, if you use Bitcoin and want to show your support of my
683 activities, please send Bitcoin donations to my address
684 &lt;b&gt;&lt;a href=&quot;bitcoin:15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&quot;&gt;15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&lt;/a&gt;&lt;/b&gt;.&lt;/p&gt;
685 </description>
686 </item>
687
688 </channel>
689 </rss>