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