{"id":641,"date":"2012-08-23T13:06:27","date_gmt":"2012-08-23T13:06:27","guid":{"rendered":"http:\/\/naich.net\/wordpress\/?p=641"},"modified":"2012-08-24T13:42:58","modified_gmt":"2012-08-24T13:42:58","slug":"a-streaming-pile-of-pi","status":"publish","type":"post","link":"https:\/\/naich.net\/wordpress\/index.php\/a-streaming-pile-of-pi\/","title":{"rendered":"A streaming pile of Pi"},"content":{"rendered":"<p><a title=\"Memory sticks and torrents\" href=\"http:\/\/naich.net\/wordpress\/?p=670\">Continued from here.<\/a><\/p>\n<p><a title=\"Yummy Pi\" href=\"http:\/\/naich.net\/wordpress\/?p=435\">First page here.<\/a><\/p>\n<h3>11. Setting up your uPNP media server<\/h3>\n<p>A uPNP media server allows you to stream videos from your Pi to any device that can talk to it.\u00c2\u00a0 A lot of tellies do this these days, along with PS3s, XBoxs, iPads, tablets and your PC.\u00c2\u00a0 With a server on your Pi, you can watch what you have downloaded on any compatible device in your house without the hassle of moving files or memory sticks about.\u00c2\u00a0 Let&#8217;s rock.<\/p>\n<p>You could try doing an apt-cache search for &#8220;upnp server&#8221; if you want the practice in finding suitable packages, or I could tell you that the one you want is <a href=\"http:\/\/mediatomb.cc\/\">Mediatomb<\/a>.\u00c2\u00a0 So <strong><tt>sudo apt-get install mediatomb<\/tt><\/strong><\/p>\n<blockquote>\n<pre>naich@raspberrypi ~ $ sudo apt-get install mediatomb\r\nReading package lists... Done\r\nBuilding dependency tree \r\nReading state information... Done\r\nThe following package was automatically installed and is no longer required:\r\n mtools\r\nUse 'apt-get autoremove' to remove it.\r\nThe following extra packages will be installed:\r\n javascript-common libavcodec53 libavformat53 libavutil51 libdirac-encoder0\r\n libexif12 libffmpegthumbnailer4 libgsm1 libjs-prototype libmozjs185-1.0\r\n libmp3lame0 libmysqlclient16 libnspr4 libnspr4-0d libschroedinger-1.0-0\r\n libspeex1 libswscale2 libtag1-vanilla libtag1c2a libtheora0 libva1 libvpx1\r\n libx264-123 libxvidcore4 mediatomb-common mediatomb-daemon mysql-common\r\n wwwconfig-common\r\nSuggested packages:\r\n apache2 httpd speex mysql-client postgresql-client\r\nThe following NEW packages will be installed:\r\n javascript-common libavcodec53 libavformat53 libavutil51 libdirac-encoder0\r\n libexif12 libffmpegthumbnailer4 libgsm1 libjs-prototype libmozjs185-1.0\r\n libmp3lame0 libmysqlclient16 libnspr4 libnspr4-0d libschroedinger-1.0-0\r\n libspeex1 libswscale2 libtag1-vanilla libtag1c2a libtheora0 libva1 libvpx1\r\n libx264-123 libxvidcore4 mediatomb mediatomb-common mediatomb-daemon\r\n mysql-common wwwconfig-common\r\n0 upgraded, 29 newly installed, 0 to remove and 0 not upgraded.\r\nNeed to get 11.4 MB of archives.\r\nAfter this operation, 25.2 MB of additional disk space will be used.\r\nDo you want to continue [Y\/n]?<\/pre>\n<\/blockquote>\n<p>It&#8217;s the same as when you installed Transmission.\u00c2\u00a0 Apt tells you what it is going to install and you say Yes.\u00c2\u00a0 It nips off, installs everything and sets it up.\u00c2\u00a0 It doesn&#8217;t need much configuring either.\u00c2\u00a0 It&#8217;ll work straight away but we&#8217;ll make a little adjustment or two.\u00c2\u00a0 Or three if you own a Samsung TV.\u00c2\u00a0 Our Samsung TV could connect to the server OK but wouldn&#8217;t play the videos.\u00c2\u00a0 If you have the same problem,<a href=\"http:\/\/wiki.ivonet.nl\/display\/LINUX\/MediaTomb+DLNA+Server+on+Ubuntu+for+Samsung+TV\"> the fix for it is here<\/a>.\u00c2\u00a0 Read what it says and add the lines to the config file after you have made the following changes:<\/p>\n<p>The configuration file for Mediatomb is <strong><tt>\/etc\/mediatomb\/config.xml<\/tt><\/strong> (note that it&#8217;s in \/etc, as usual) and is a bit unusual in that it&#8217;s an <a href=\"http:\/\/en.wikipedia.org\/wiki\/Xml\">XML file<\/a>.\u00c2\u00a0 Let&#8217;s not pussyfoot around here.\u00c2\u00a0 XML is a horrible way to present data and to use it in a configuration file is a crime against humanity.\u00c2\u00a0 I could rant on for a while but I will spare you that &#8211; you have enough problems, being faced with a configuration file in XML format.\u00c2\u00a0 So, open it up with <strong><tt>sudo nano \/etc\/mediatomb\/config.xml<\/tt><\/strong> and let&#8217;s get started.\u00c2\u00a0 As you can see, it&#8217;s nice and easy to read &#8211; if you are a robot&#8230;<\/p>\n<blockquote>\n<pre>&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\r\n&lt;config version=\"2\" xmlns=\"http:\/\/mediatomb.cc\/config\/2\" xmlns:xsi=\"http:\/\/www.$\r\n\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 Read \/usr\/share\/doc\/mediatomb-common\/README.gz section 6 for more\r\n\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 information on creating and using config.xml configration files.\r\n\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 --&gt;\r\n\u00c2\u00a0 &lt;server&gt;\r\n\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 &lt;ui enabled=\"yes\" show-tooltips=\"yes\"&gt;\r\n\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 &lt;accounts enabled=\"yes\" session-timeout=\"30\"&gt;\r\n\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 &lt;account user=\"mediatomb\" password=\"mediatomb\"\/&gt;\r\n\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 &lt;\/accounts&gt;\r\n\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 &lt;\/ui&gt;\r\n\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 &lt;name&gt;MediaTomb&lt;\/name&gt;\r\n... and so on ...<\/pre>\n<\/blockquote>\n<p>Straight away, you should see something that needs changing.\u00c2\u00a0 The user interface web page has a default username and password, which is bad.\u00c2\u00a0 Change that <strong>user=&#8221;mediatomb&#8221; password=&#8221;mediatomb&#8221;<\/strong> to something else.\u00c2\u00a0 Or, if you are feeling brave, you can change &#8220;accounts enabled&#8221; to &#8220;no&#8221; and you won&#8217;t have to log on at all. This is a bad idea if you want to access it from outside your home network.<\/p>\n<p>On the line after &#8220;&lt;server&gt;&#8221; add <strong>&lt;port&gt;49152&lt;\/port&gt;<\/strong> this forces it to use that port rather than pick one of its own choosing.\u00c2\u00a0 Done that?\u00c2\u00a0 CTRL-X, [Y]es you want to save, return to save it over the top of the original.<\/p>\n<p>I&#8217;ve set up a <a href=\"http:\/\/naich.net\/config.xml\">download of a config.xml file<\/a> with all those changes applied to it.\u00c2\u00a0 Feel free to replace yours with it.\u00c2\u00a0 The username is &#8220;mediatomb&#8221;, password is &#8220;wibble&#8221;.\u00c2\u00a0 Please change them on your system.<\/p>\n<p>A quick <strong><tt>sudo service mediatomb restart<\/tt><\/strong> and you are done with the setting up.\u00c2\u00a0 To use the web interface, point your browser at http:\/\/your_pi_ip:49152 , log in (if you have to) and you should see this:<\/p>\n<p><a href=\"http:\/\/naich.net\/wordpress\/wp-content\/uploads\/2012\/08\/mt1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-759 alignnone\" title=\"Mediatomb screenshot\" src=\"http:\/\/naich.net\/wordpress\/wp-content\/uploads\/2012\/08\/mt1.png\" alt=\"\" width=\"646\" height=\"476\" srcset=\"https:\/\/naich.net\/wordpress\/wp-content\/uploads\/2012\/08\/mt1.png 646w, https:\/\/naich.net\/wordpress\/wp-content\/uploads\/2012\/08\/mt1-300x221.png 300w\" sizes=\"auto, (max-width: 646px) 100vw, 646px\" \/><\/a><\/p>\n<p>or something like that anyway.\u00c2\u00a0 To get it to index your media, click on the &#8220;Filesystem&#8221; tab (next to &#8220;Database&#8221;), then the cross next to &#8220;mnt&#8221; (to expand that branch) and &#8220;downloads&#8221; to highlight it.\u00c2\u00a0 Over on the right, there will appear a swirly cross which says &#8220;Add as autoscan dir&#8221; when you hover over it.\u00c2\u00a0 Click on it to select that directory as one you want Mediatomb to scan.\u00c2\u00a0 Choose &#8220;Inotify&#8221; for Scan mode, &#8220;Basic&#8221; for Initial scan and check &#8220;Recursive&#8221;.\u00c2\u00a0 Click on &#8220;Set&#8221;, it will perform a basic scan and then when you click on the &#8220;Database&#8221; tab on the left, all your stuff should appear under the &#8220;Video&#8221; branch.\u00c2\u00a0 <a href=\"http:\/\/mediatomb.cc\/pages\/userinterface\">Documentation for the user interface is available<\/a> for those who want to tinker.<\/p>\n<p>And that&#8217;s it.\u00c2\u00a0 Your Pi should appear\u00c2\u00a0 as\u00c2\u00a0 a media server when your TV\/PS3\/whatever does a scan.\u00c2\u00a0 Any new downloads should appear automatically but be aware that if you swap the external storage, it might not be rescanned when you plug it back in, so you will have get Mediatomb to do it manually.<\/p>\n<p>Put the kettle on, make a cup of tea and enjoy your videos.\u00c2\u00a0 That&#8217;s pretty much it for now.\u00c2\u00a0 There&#8217;s one more chapter of useful things to know about Linux.<\/p>\n<p><a title=\"Teapot wibble\" href=\"http:\/\/naich.net\/wordpress\/?p=774\">Continued here.<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Continued from here. First page here. 11. Setting up your uPNP media server A uPNP media server allows you to stream videos from your Pi to any device that can talk to it.\u00c2\u00a0 A lot of tellies do this these days, along with PS3s, XBoxs, iPads, tablets and your PC.\u00c2\u00a0 With a server on your [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[74,102],"tags":[],"class_list":["post-641","post","type-post","status-publish","format-standard","hentry","category-geek","category-raspberry-pi"],"_links":{"self":[{"href":"https:\/\/naich.net\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/641","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/naich.net\/wordpress\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/naich.net\/wordpress\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/naich.net\/wordpress\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/naich.net\/wordpress\/index.php\/wp-json\/wp\/v2\/comments?post=641"}],"version-history":[{"count":34,"href":"https:\/\/naich.net\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/641\/revisions"}],"predecessor-version":[{"id":786,"href":"https:\/\/naich.net\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/641\/revisions\/786"}],"wp:attachment":[{"href":"https:\/\/naich.net\/wordpress\/index.php\/wp-json\/wp\/v2\/media?parent=641"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/naich.net\/wordpress\/index.php\/wp-json\/wp\/v2\/categories?post=641"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/naich.net\/wordpress\/index.php\/wp-json\/wp\/v2\/tags?post=641"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}