]> pere.pagekite.me Git - homepage.git/blob - blog/archive/2018/07/07.rss
Generated.
[homepage.git] / blog / archive / 2018 / 07 / 07.rss
1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <rss version='2.0' xmlns:lj='http://www.livejournal.org/rss/lj/1.0/'>
3 <channel>
4 <title>Petter Reinholdtsen - Entries from July 2018</title>
5 <description>Entries from July 2018</description>
6 <link>http://people.skolelinux.org/pere/blog/</link>
7
8
9 <item>
10 <title>Streaming the Linux desktop to Kodi using VLC and RTSP</title>
11 <link>http://people.skolelinux.org/pere/blog/Streaming_the_Linux_desktop_to_Kodi_using_VLC_and_RTSP.html</link>
12 <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/Streaming_the_Linux_desktop_to_Kodi_using_VLC_and_RTSP.html</guid>
13 <pubDate>Thu, 12 Jul 2018 02:00:00 +0200</pubDate>
14 <description>&lt;p&gt;A while back, I was asked by a friend how to stream the desktop to
15 my projector connected to Kodi. I sadly had to admit that I had no
16 idea, as it was a task I never had tried. Since then, I have been
17 looking for a way to do so, preferable without much extra software to
18 install on either side. Today I found a way that seem to kind of
19 work. Not great, but it is a start.&lt;/p&gt;
20
21 &lt;p&gt;I had a look at several approaches, for example
22 &lt;a href=&quot;https://github.com/mfoetsch/dlna_live_streaming&quot;&gt;using uPnP
23 DLNA as described in 2011&lt;/a&gt;, but it required a uPnP server, fuse and
24 local storage enough to store the stream locally. This is not going
25 to work well for me, lacking enough free space, and it would
26 impossible for my friend to get working.&lt;/p&gt;
27
28 &lt;p&gt;Next, it occurred to me that perhaps I could use VLC to create a
29 video stream that Kodi could play. Preferably using
30 broadcast/multicast, to avoid having to change any setup on the Kodi
31 side when starting such stream. Unfortunately, the only recipe I
32 could find using multicast used the rtp protocol, and this protocol
33 seem to not be supported by Kodi.&lt;/p&gt;
34
35 &lt;p&gt;On the other hand, the rtsp protocol is working! Unfortunately I
36 have to specify the IP address of the streaming machine in both the
37 sending command and the file on the Kodi server. But it is showing my
38 desktop, and thus allow us to have a shared look on the big screen at
39 the programs I work on.&lt;/p&gt;
40
41 &lt;p&gt;I did not spend much time investigating codeces. I combined the
42 rtp and rtsp recipes from
43 &lt;a href=&quot;https://wiki.videolan.org/Documentation:Streaming_HowTo/Command_Line_Examples/&quot;&gt;the
44 VLC Streaming HowTo/Command Line Examples&lt;/a&gt;, and was able to get
45 this working on the desktop/streaming end.&lt;/p&gt;
46
47 &lt;blockquote&gt;&lt;pre&gt;
48 vlc screen:// --sout \
49 &#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;
50 &lt;/pre&gt;&lt;/blockquote&gt;
51
52 &lt;p&gt;I ssh-ed into my Kodi box and created a file like this with the
53 same IP address:&lt;/p&gt;
54
55 &lt;blockquote&gt;&lt;pre&gt;
56 echo rtsp://192.168.11.4:8080/test.sdp \
57 &gt; /storage/videos/screenstream.m3u
58 &lt;/pre&gt;&lt;/blockquote&gt;
59
60 &lt;p&gt;Note the 192.168.11.4 IP address is my desktops IP address. As far
61 as I can tell the IP must be hardcoded for this to work. In other
62 words, if someone elses machine is going to do the steaming, you have
63 to update screenstream.m4u on the Kodi machine and adjust the vlc
64 repice. To get started, locate the file in Kodi and select the m3u
65 file while the VLC stream is running. The desktop then show up in my
66 big screen. :)&lt;/p&gt;
67
68 &lt;p&gt;When using the same technique to stream a video file with audio,
69 the audio quality is really bad. No idea if the problem is package
70 loss or bad parameters for the transcode. I do not know VLC nor Kodi
71 enough to tell.&lt;/p&gt;
72
73 &lt;p&gt;As usual, if you use Bitcoin and want to show your support of my
74 activities, please send Bitcoin donations to my address
75 &lt;b&gt;&lt;a href=&quot;bitcoin:15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&quot;&gt;15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&lt;/a&gt;&lt;/b&gt;.&lt;/p&gt;
76 </description>
77 </item>
78
79 <item>
80 <title>What is the most supported MIME type in Debian in 2018?</title>
81 <link>http://people.skolelinux.org/pere/blog/What_is_the_most_supported_MIME_type_in_Debian_in_2018_.html</link>
82 <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/What_is_the_most_supported_MIME_type_in_Debian_in_2018_.html</guid>
83 <pubDate>Mon, 9 Jul 2018 08:05:00 +0200</pubDate>
84 <description>&lt;p&gt;Five years ago,
85 &lt;a href=&quot;http://people.skolelinux.org/pere/blog/What_is_the_most_supported_MIME_type_in_Debian_.html&quot;&gt;I
86 measured what the most supported MIME type in Debian was&lt;/a&gt;, by
87 analysing the desktop files in all packages in the archive. Since
88 then, the DEP-11 AppStream system has been put into production, making
89 the task a lot easier. This made me want to repeat the measurement,
90 to see how much things changed. Here are the new numbers, for
91 unstable only this time:
92
93 &lt;p&gt;&lt;strong&gt;Debian Unstable:&lt;/strong&gt;&lt;/p&gt;
94
95 &lt;pre&gt;
96 count MIME type
97 ----- -----------------------
98 56 image/jpeg
99 55 image/png
100 49 image/tiff
101 48 image/gif
102 39 image/bmp
103 38 text/plain
104 37 audio/mpeg
105 34 application/ogg
106 33 audio/x-flac
107 32 audio/x-mp3
108 30 audio/x-wav
109 30 audio/x-vorbis+ogg
110 29 image/x-portable-pixmap
111 27 inode/directory
112 27 image/x-portable-bitmap
113 27 audio/x-mpeg
114 26 application/x-ogg
115 25 audio/x-mpegurl
116 25 audio/ogg
117 24 text/html
118 &lt;/pre&gt;
119
120 &lt;p&gt;The list was created like this using a sid chroot: &quot;cat
121 /var/lib/apt/lists/*sid*_dep11_Components-amd64.yml.gz| zcat | awk &#39;/^
122 - \S+\/\S+$/ {print $2 }&#39; | sort | uniq -c | sort -nr | head -20&quot;&lt;/p&gt;
123
124 &lt;p&gt;It is interesting to see how image formats have passed text/plain
125 as the most announced supported MIME type. These days, thanks to the
126 AppStream system, if you run into a file format you do not know, and
127 want to figure out which packages support the format, you can find the
128 MIME type of the file using &quot;file --mime &amp;lt;filename&amp;gt;&quot;, and then
129 look up all packages announcing support for this format in their
130 AppStream metadata (XML or .desktop file) using &quot;appstreamcli
131 what-provides mimetype &amp;lt;mime-type&amp;gt;. For example if you, like
132 me, want to know which packages support inode/directory, you can get a
133 list like this:&lt;/p&gt;
134
135 &lt;p&gt;&lt;blockquote&gt;&lt;pre&gt;
136 % appstreamcli what-provides mimetype inode/directory | grep Package: | sort
137 Package: anjuta
138 Package: audacious
139 Package: baobab
140 Package: cervisia
141 Package: chirp
142 Package: dolphin
143 Package: doublecmd-common
144 Package: easytag
145 Package: enlightenment
146 Package: ephoto
147 Package: filelight
148 Package: gwenview
149 Package: k4dirstat
150 Package: kaffeine
151 Package: kdesvn
152 Package: kid3
153 Package: kid3-qt
154 Package: nautilus
155 Package: nemo
156 Package: pcmanfm
157 Package: pcmanfm-qt
158 Package: qweborf
159 Package: ranger
160 Package: sirikali
161 Package: spacefm
162 Package: spacefm
163 Package: vifm
164 %
165 &lt;/pre&gt;&lt;/blockquote&gt;&lt;/p&gt;
166
167 &lt;p&gt;Using the same method, I can quickly discover that the Sketchup file
168 format is not yet supported by any package in Debian:&lt;/p&gt;
169
170 &lt;p&gt;&lt;blockquote&gt;&lt;pre&gt;
171 % appstreamcli what-provides mimetype application/vnd.sketchup.skp
172 Could not find component providing &#39;mimetype::application/vnd.sketchup.skp&#39;.
173 %
174 &lt;/pre&gt;&lt;/blockquote&gt;&lt;/p&gt;
175
176 &lt;p&gt;Yesterday I used it to figure out which packages support the STL 3D
177 format:&lt;/p&gt;
178
179 &lt;p&gt;&lt;blockquote&gt;&lt;pre&gt;
180 % appstreamcli what-provides mimetype application/sla|grep Package
181 Package: cura
182 Package: meshlab
183 Package: printrun
184 %
185 &lt;/pre&gt;&lt;/blockquote&gt;&lt;/p&gt;
186
187 &lt;p&gt;PS: A new version of Cura was uploaded to Debian yesterday.&lt;/p&gt;
188
189 &lt;p&gt;As usual, if you use Bitcoin and want to show your support of my
190 activities, please send Bitcoin donations to my address
191 &lt;b&gt;&lt;a href=&quot;bitcoin:15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&quot;&gt;15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&lt;/a&gt;&lt;/b&gt;.&lt;/p&gt;
192 </description>
193 </item>
194
195 <item>
196 <title>Debian APT upgrade without enough free space on the disk...</title>
197 <link>http://people.skolelinux.org/pere/blog/Debian_APT_upgrade_without_enough_free_space_on_the_disk___.html</link>
198 <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/Debian_APT_upgrade_without_enough_free_space_on_the_disk___.html</guid>
199 <pubDate>Sun, 8 Jul 2018 12:10:00 +0200</pubDate>
200 <description>&lt;p&gt;Quite regularly, I let my Debian Sid/Unstable chroot stay untouch
201 for a while, and when I need to update it there is not enough free
202 space on the disk for apt to do a normal &#39;apt upgrade&#39;. I normally
203 would resolve the issue by doing &#39;apt install &amp;lt;somepackages&amp;gt;&#39; to
204 upgrade only some of the packages in one batch, until the amount of
205 packages to download fall below the amount of free space available.
206 Today, I had about 500 packages to upgrade, and after a while I got
207 tired of trying to install chunks of packages manually. I concluded
208 that I did not have the spare hours required to complete the task, and
209 decided to see if I could automate it. I came up with this small
210 script which I call &#39;apt-in-chunks&#39;:&lt;/p&gt;
211
212 &lt;p&gt;&lt;blockquote&gt;&lt;pre&gt;
213 #!/bin/sh
214 #
215 # Upgrade packages when the disk is too full to upgrade every
216 # upgradable package in one lump. Fetching packages to upgrade using
217 # apt, and then installing using dpkg, to avoid changing the package
218 # flag for manual/automatic.
219
220 set -e
221
222 ignore() {
223 if [ &quot;$1&quot; ]; then
224 grep -v &quot;$1&quot;
225 else
226 cat
227 fi
228 }
229
230 for p in $(apt list --upgradable | ignore &quot;$@&quot; |cut -d/ -f1 | grep -v &#39;^Listing...&#39;); do
231 echo &quot;Upgrading $p&quot;
232 apt clean
233 apt install --download-only -y $p
234 for f in /var/cache/apt/archives/*.deb; do
235 if [ -e &quot;$f&quot; ]; then
236 dpkg -i /var/cache/apt/archives/*.deb
237 break
238 fi
239 done
240 done
241 &lt;/pre&gt;&lt;/blockquote&gt;&lt;/p&gt;
242
243 &lt;p&gt;The script will extract the list of packages to upgrade, try to
244 download the packages needed to upgrade one package, install the
245 downloaded packages using dpkg. The idea is to upgrade packages
246 without changing the APT mark for the package (ie the one recording of
247 the package was manually requested or pulled in as a dependency). To
248 use it, simply run it as root from the command line. If it fail, try
249 &#39;apt install -f&#39; to clean up the mess and run the script again. This
250 might happen if the new packages conflict with one of the old
251 packages. dpkg is unable to remove, while apt can do this.&lt;/p&gt;
252
253 &lt;p&gt;It take one option, a package to ignore in the list of packages to
254 upgrade. The option to ignore a package is there to be able to skip
255 the packages that are simply too large to unpack. Today this was
256 &#39;ghc&#39;, but I have run into other large packages causing similar
257 problems earlier (like TeX).&lt;/p&gt;
258
259 &lt;p&gt;Update 2018-07-08: Thanks to Paul Wise, I am aware of two
260 alternative ways to handle this. The &quot;unattended-upgrades
261 --minimal-upgrade-steps&quot; option will try to calculate upgrade sets for
262 each package to upgrade, and then upgrade them in order, smallest set
263 first. It might be a better option than my above mentioned script.
264 Also, &quot;aptutude upgrade&quot; can upgrade single packages, thus avoiding
265 the need for using &quot;dpkg -i&quot; in the script above.&lt;/p&gt;
266
267 &lt;p&gt;As usual, if you use Bitcoin and want to show your support of my
268 activities, please send Bitcoin donations to my address
269 &lt;b&gt;&lt;a href=&quot;bitcoin:15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&quot;&gt;15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&lt;/a&gt;&lt;/b&gt;.&lt;/p&gt;
270 </description>
271 </item>
272
273 </channel>
274 </rss>