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">
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" />
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><p
>Back in February, I got curious to see
15 <a href=
"http://people.skolelinux.org/pere/blog/Using_VLC_to_stream_bittorrent_sources.html
">if
16 VLC now supported Bittorrent streaming
</a
>. 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 <a href=
"https://github.com/johang/vlc-bittorrent
">a standalone plugin
20 for VLC
</a
> 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 <a href=
"https://tracker.debian.org/pkg/vlc-plugin-bittorrent
">entered
24 Debian
</a
> a few hours ago, and should be available in Debian/Unstable
25 tomorrow, and Debian/Testing in a few days.
</p
>
27 <p
>With the vlc-plugin-bittorrent package installed you should be able
28 to stream videos using a simple call to
</p
>
30 <p
><blockquote
><pre
>
31 vlc https://archive.org/download/TheGoat/TheGoat_archive.torrent
32 </pre
></blockquote
></p
>
34 </p
>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. :)
</p
>
42 <p
>I would love to get help maintaining this package. Get in touch if
43 you are interested.
</p
>
45 <p
>As usual, if you use Bitcoin and want to show your support of my
46 activities, please send Bitcoin donations to my address
47 <b
><a href=
"bitcoin:
15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
</a
></b
>.
</p
>
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><p
>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.
</p
>
64 <p
><blockquote
><pre
>curl --silent --header
'Content-Type: application/json
' \
65 --data-binary
'{
"id
":
1,
"jsonrpc
":
"2.0",
"method
":
"Player.Open
",
66 "params
": {
"item
": {
"file
":
67 "plugin://plugin.video.youtube/play/?video_id=LuRGVM9O0qg
" } } }
' \
68 http://projector.local/jsonrpc
</pre
></blockquote
></p
>
70 <p
>I
'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
'desktop
' to stream my desktop to Kodi. It is almost like a
73 Chromecast. :)
</p
>
75 <p
>As usual, if you use Bitcoin and want to show your support of my
76 activities, please send Bitcoin donations to my address
77 <b
><a href=
"bitcoin:
15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
</a
></b
>.
</p
>
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><p
>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 <a href=
"https://publiccode.eu/
">Public Money, Public Code
</a
> to help
91 them. I hope you too will do the same.
</p
>
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><p
>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
've received some ideas, and would like to share them
107 One interesting data point was a pointer to a Free Software app for
109 <a href=
"https://github.com/Freeyourgadget/Gadgetbridge/
">Gadgetbridge
</a
>.
110 It provide cloudless collection and storing of data from a variety of
112 <a href=
"https://github.com/Freeyourgadget/Gadgetbridge/#supported-devices
">list
113 of supported devices
</a
> 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 <a href=
"https://us.amazfit.com/shop/bip?variant=
336750">Amazfit
121 <a href=
"http://www.xiaomimi6phone.com/xiaomi-mi-band-
3-features-release-date-rumors/
">Xiaomi
122 Band
3</a
>.
</p
>
124 <p
>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 <a href=
"https://www.gpsbabel.org/htmldoc-development/fmt_garmin_fit.html
">Garmin
128 FIT files
</a
> containing the collected measurements. While
129 proprietary, FIT files apparently can be read at least by
130 <a href=
"https://www.gpsbabel.org
">GPSBabel
</a
> and the
131 <a href=
"https://apps.nextcloud.com/apps/gpxpod
">GpxPod
</a
> 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 <a href=
"https://buy.garmin.com/en-US/US/p/
564291">Garmin Forerunner
135 935</a
>, 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.
</p
>
140 <p
>A final idea was to build ones own unit, perhaps by basing it on a
141 wearable hardware platforms like
142 <a href=
"https://learn.adafruit.com/flora-geo-watch
">the Flora Geo
143 Watch
</a
>. 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.
</p
>
146 <p
>While I was working on tracking down links, I came across an
147 inspiring TED talk by Dave Debronkart about
148 <a href=
"https://archive.org/details/DavedeBronkart_2010X
">being a
149 e-patient
</a
>, and discovered the web site
150 <a href=
"https://participatorymedicine.org/epatients/
">Participatory
151 Medicine
</a
>. 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.
</p
>
155 <p
>As usual, if you use Bitcoin and want to show your support of my
156 activities, please send Bitcoin donations to my address
157 <b
><a href=
"bitcoin:
15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
</a
></b
>.
</p
>
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><p
>Dear lazyweb,
</p
>
168 <p
>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
<strong
>only
</strong
> 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
"the cloud
"). The collected data should be available
177 using only free software. I
'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
'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
"cloud enabled
").
182 Is there an alternative? I
'm not interested in giving money to people
183 requiring me to accept
"privacy terms
" to allow myself to measure my
184 own health.
</p
>
186 <p
>As usual, if you use Bitcoin and want to show your support of my
187 activities, please send Bitcoin donations to my address
188 <b
><a href=
"bitcoin:
15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
</a
></b
>.
</p
>
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><p
>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 &lt;enclosure
&gt; RSS tag), but was unable to find a current supplier
209 of such frames. In the end I gave up that approach.
</p
>
211 <p
>Some months ago, I discovered that
212 <a href=
"https://www.jwz.org/xscreensaver/
">XScreensaver
</a
> 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 <a href=
"https://kodi.tv
">Kodi
</a
> (both using
217 <a href=
"https://www.openelec.tv/
">OpenELEC
</a
> and
218 <a href=
"https://libreelec.tv
">LibreELEC
</a
>) provide the
219 <a href=
"https://github.com/grinsted/script.screensaver.feedreader
">Feedreader
</a
>
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.
</p
>
225 <p
>Armed with motivation and a test photo frame, I set out to generate
226 a RSS feed for the Kodi instance. I adjusted my
<a
227 href=
"https://freedombox.org/
">Freedombox
</a
> 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.
</p
>
236 <p
>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:
</p
>
241 <blockquote
><pre
>
242 exiftool -headline=
'The RSS image title
' \
243 -description=
'The RSS image description.
' \
244 -subject+=for-family photo.jpeg
245 </pre
></blockquote
>
247 <p
>I initially tried the
"-title
" and
"keyword
" tags, but they were
248 invisible in digiKam, so I changed to
"-headline
" and
"-subject
". I
249 use the keyword/subject
'for-family
' 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.
</p
>
253 <p
>Are there better ways to do this? Get in touch if you have better
254 suggestions.
</p
>
256 <p
>As usual, if you use Bitcoin and want to show your support of my
257 activities, please send Bitcoin donations to my address
258 <b
><a href=
"bitcoin:
15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
</a
></b
>.
</p
>
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><p
>Last night, I wrote
268 <a href=
"http://people.skolelinux.org/pere/blog/Streaming_the_Linux_desktop_to_Kodi_using_VLC_and_RTSP.html
">a
269 recipe to stream a Linux desktop using VLC to a instance of Kodi
</a
>.
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.
</p
>
275 <p
>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 <a href=
"https://kodi.wiki/view/JSON-RPC_API/v8
">the JSON-RPC API in
280 Kodi
</a
> 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.
</p
>
289 <blockquote
><pre
>
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.
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.
302 params=
"$
3"
303 curl --silent --header
'Content-Type: application/json
' \
304 --data-binary
"{ \
"id\
":
1, \
"jsonrpc\
": \
"2.0\
", \
"method\
": \
"$cmd\
", \
"params\
": $params }
" \
305 "http://$host/jsonrpc
"
308 if [ -n
"$kodihost
" ] ; then
309 # Stop the playing when we end
310 playerid=$(kodicmd
"$kodihost
" Player.GetActivePlayers
"{}
" |
311 jq .result[].playerid)
312 kodicmd
"$kodihost
" Player.Stop
"{ \
"playerid\
" : $playerid }
" > /dev/null
314 if [
"$gstpid
" ]
&& kill -
0 "$gstpid
" >/dev/null
2>&1; then
315 kill
"$gstpid
"
318 trap cleanup EXIT INT
320 if [ -n
"$
1" ]; then
331 pasrc=$(pactl list | grep -A2
'Source #
' | grep
'Name: .*\.monitor$
' | \
332 cut -d
" " -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 > /dev/null
2>&1 &
343 # Give stream a second to get going
346 # Ask kodi to start streaming using its JSON-RPC API
347 kodicmd
"$kodihost
" Player.Open \
348 "{\
"item\
": { \
"file\
": \
"udp://@$mcast:$mcastport\
" } }
" > /dev/null
350 # wait for gst to end
351 wait
"$gstpid
"
352 </pre
></blockquote
>
354 <p
>I hope you find the approach useful. I know I do.
</p
>
356 <p
>As usual, if you use Bitcoin and want to show your support of my
357 activities, please send Bitcoin donations to my address
358 <b
><a href=
"bitcoin:
15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
</a
></b
>.
</p
>
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><p
>PS: See
368 <ahref=
"http://people.skolelinux.org/pere/blog/Simple_streaming_the_Linux_desktop_to_Kodi_using_GStreamer_and_RTP.html
">the
369 followup post
</a
> for a even better approach.
</p
>
371 <p
>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.
</p
>
378 <p
>I had a look at several approaches, for example
379 <a href=
"https://github.com/mfoetsch/dlna_live_streaming
">using uPnP
380 DLNA as described in
2011</a
>, 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.
</p
>
385 <p
>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.
</p
>
392 <p
>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.
</p
>
398 <p
>I did not spend much time investigating codeces. I combined the
399 rtp and rtsp recipes from
400 <a href=
"https://wiki.videolan.org/Documentation:Streaming_HowTo/Command_Line_Examples/
">the
401 VLC Streaming HowTo/Command Line Examples
</a
>, and was able to get
402 this working on the desktop/streaming end.
</p
>
404 <blockquote
><pre
>
405 vlc screen:// --sout \
406 '#transcode{vcodec=mp4v,acodec=mpga,vb=
800,ab=
128}:rtp{dst=projector.local,port=
1234,sdp=rtsp://
192.168.11.4:
8080/test.sdp}
'
407 </pre
></blockquote
>
409 <p
>I ssh-ed into my Kodi box and created a file like this with the
410 same IP address:
</p
>
412 <blockquote
><pre
>
413 echo rtsp://
192.168.11.4:
8080/test.sdp \
414 > /storage/videos/screenstream.m3u
415 </pre
></blockquote
>
417 <p
>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. :)
</p
>
425 <p
>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.
</p
>
430 <p
><strong
>Update
2018-
07-
12</strong
>: Johannes Schauer send me a few
431 succestions and reminded me about an important step. The
"screen:
"
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:
"VLC is unable to open the MRL
'screen://
'. Check the log
435 for details.
" 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
441 <blockquote
><pre
>
442 cvlc screen:// --sout \
443 '#transcode{vcodec=mp4v,acodec=mpga,vb=
800,ab=
128}:rtp{sdp=rtsp://:
8080/}
'
444 </pre
></blockquote
>
446 <p
>and this on the Kodi end
<p
>
448 <blockquote
><pre
>
449 echo rtsp://
192.168.11.4:
8080/ \
450 > /storage/videos/screenstream.m3u
451 </pre
></blockquote
>
453 <p
>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
've tried to change the vb and ab
457 parameters to use more bandwidth, but it did not make a
458 difference.
</p
>
460 <p
>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:
467 <blockquote
><pre
>
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
'Source #
' | \
475 grep
'Name: .*\.monitor$
' | cut -d
" " -f2|head -
1) ! \
476 audioconvert ! queue2 ! avenc_aac ! queue2 ! mux.
477 </pre
></blockquote
>
479 <p
>and this on the Kodi end
<p
>
481 <blockquote
><pre
>
482 echo udp://@
239.255.0.1:
1234 \
483 > /storage/videos/screenstream.m3u
484 </pre
></blockquote
>
486 <p
>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
"hop
" for each increase (read up on
492 multicast to learn more. :)!
</p
>
494 <p
>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.
</p
>
499 <blockquote
><pre
>
500 cvlc screen:// --sout
'#transcode{vcodec=mp4v,acodec=mpga,vb=
800,ab=
128}:rtp{mux=ts,dst=
239.255.0.1,port=
1234,sdp=sap}
'
501 </pre
></blockquote
>
503 <p
>As usual, if you use Bitcoin and want to show your support of my
504 activities, please send Bitcoin donations to my address
505 <b
><a href=
"bitcoin:
15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
</a
></b
>.
</p
>
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><p
>Five years ago,
515 <a href=
"http://people.skolelinux.org/pere/blog/What_is_the_most_supported_MIME_type_in_Debian_.html
">I
516 measured what the most supported MIME type in Debian was
</a
>, 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:
523 <p
><strong
>Debian Unstable:
</strong
></p
>
527 ----- -----------------------
539 30 audio/x-vorbis+ogg
540 29 image/x-portable-pixmap
542 27 image/x-portable-bitmap
550 <p
>The list was created like this using a sid chroot:
"cat
551 /var/lib/apt/lists/*sid*_dep11_Components-amd64.yml.gz| zcat | awk
'/^
552 - \S+\/\S+$/ {print $
2 }
' | sort | uniq -c | sort -nr | head -
20"</p
>
554 <p
>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
"file --mime
&lt;filename
&gt;
", and then
559 look up all packages announcing support for this format in their
560 AppStream metadata (XML or .desktop file) using
"appstreamcli
561 what-provides mimetype
&lt;mime-type
&gt;. For example if you, like
562 me, want to know which packages support inode/directory, you can get a
563 list like this:
</p
>
565 <p
><blockquote
><pre
>
566 % appstreamcli what-provides mimetype inode/directory | grep Package: | sort
573 Package: doublecmd-common
575 Package: enlightenment
595 </pre
></blockquote
></p
>
597 <p
>Using the same method, I can quickly discover that the Sketchup file
598 format is not yet supported by any package in Debian:
</p
>
600 <p
><blockquote
><pre
>
601 % appstreamcli what-provides mimetype application/vnd.sketchup.skp
602 Could not find component providing
'mimetype::application/vnd.sketchup.skp
'.
604 </pre
></blockquote
></p
>
606 <p
>Yesterday I used it to figure out which packages support the STL
3D
609 <p
><blockquote
><pre
>
610 % appstreamcli what-provides mimetype application/sla|grep Package
615 </pre
></blockquote
></p
>
617 <p
>PS: A new version of Cura was uploaded to Debian yesterday.
</p
>
619 <p
>As usual, if you use Bitcoin and want to show your support of my
620 activities, please send Bitcoin donations to my address
621 <b
><a href=
"bitcoin:
15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
</a
></b
>.
</p
>
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><p
>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
'apt upgrade
'. I normally
633 would resolve the issue by doing
'apt install
&lt;somepackages
&gt;
' 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
'apt-in-chunks
':
</p
>
642 <p
><blockquote
><pre
>
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.
653 if [
"$
1" ]; then
654 grep -v
"$
1"
660 for p in $(apt list --upgradable | ignore
"$@
" |cut -d/ -f1 | grep -v
'^Listing...
'); do
661 echo
"Upgrading $p
"
663 apt install --download-only -y $p
664 for f in /var/cache/apt/archives/*.deb; do
665 if [ -e
"$f
" ]; then
666 dpkg -i /var/cache/apt/archives/*.deb
671 </pre
></blockquote
></p
>
673 <p
>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 'apt install -f
' 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.
</p
>
683 <p
>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 'ghc
', but I have run into other large packages causing similar
687 problems earlier (like TeX).
</p
>
689 <p
>Update
2018-
07-
08: Thanks to Paul Wise, I am aware of two
690 alternative ways to handle this. The
"unattended-upgrades
691 --minimal-upgrade-steps
" 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,
"aptutude upgrade
" can upgrade single packages, thus avoiding
695 the need for using
"dpkg -i
" in the script above.
</p
>
697 <p
>As usual, if you use Bitcoin and want to show your support of my
698 activities, please send Bitcoin donations to my address
699 <b
><a href=
"bitcoin:
15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
</a
></b
>.
</p
>