{"id":1140,"date":"2009-06-13T23:28:05","date_gmt":"2009-06-14T03:28:05","guid":{"rendered":"http:\/\/blogs.sungeek.net\/unixwiz\/?p=1140"},"modified":"2009-06-13T23:28:34","modified_gmt":"2009-06-14T03:28:34","slug":"mediatomb-and-solaris-10","status":"publish","type":"post","link":"https:\/\/blogs.sungeek.net\/unixwiz\/2009\/06\/13\/mediatomb-and-solaris-10\/","title":{"rendered":"Mediatomb and Solaris 10"},"content":{"rendered":"<p>Now that I rebuilt the server, it was time to put media tomb on it to share media with the PS3. To get it to compile on Solaris (fresh 05\/09 Update 7 install patched with the latest security and recommended patches), there are a couple of things you have to do (most of this is from <a href=\"http:\/\/blogs.sun.com\/constantin\/entry\/mediatomb_on_solaris\">http:\/\/blogs.sun.com\/constantin\/entry\/mediatomb_on_solaris<\/a> with some additional stuff I had to do:<\/p>\n<p>1. Download the latest version of the &#8220;file&#8221; program from ftp:\/\/ftp.astron.com\/pub\/file\/ (my case the current is 5.03)<br \/>\n2. Unzip\/untar the file<br \/>\n3. Configure and run make:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\ngzip -d file-5.03.tar.gz\r\ntar -xvf file-5.03.tar\r\ncd file-5.03\r\n.\/configure --prefix=\/usr\/local\/file\r\ngmake\r\nsu - root -c &quot;gmake install&quot;\r\n<\/pre>\n<p>3. There are a bunch of other requirements for mediatomb, the easiest way to get them is to use www.blastwave.org. The packages that I installed are:<br \/>\n CSWbdb4<br \/>\n CSWbzip2<br \/>\n CSWcurl<br \/>\n CSWcurlrt<br \/>\n CSWexpat<br \/>\n CSWfaac<br \/>\n CSWfaad2<br \/>\n CSWfconfig<br \/>\n CSWffmpeg<br \/>\n CSWffmpeglib<br \/>\n CSWftype2<br \/>\n CSWgcc3corert<br \/>\n CSWgcc3g++rt<br \/>\n CSWgcrypt<br \/>\n CSWggettext<br \/>\n CSWgpgerr<br \/>\n CSWiconv<br \/>\n CSWid3lib<br \/>\n CSWimlib2<br \/>\n CSWisaexec<br \/>\n CSWlame<br \/>\n CSWliba52<br \/>\n CSWlibid3tag<br \/>\n CSWlibidn<br \/>\n CSWlibnet<br \/>\n CSWlibogg<br \/>\n CSWlibsdl<br \/>\n CSWlibssh2<br \/>\n CSWlibtool<br \/>\n CSWlibtoolrt<br \/>\n CSWlibx11<br \/>\n CSWlibxau<br \/>\n CSWlibxcb<br \/>\n CSWlibxdmcp<br \/>\n CSWncurses<br \/>\n CSWoldaprt<br \/>\n CSWossl<br \/>\n CSWossldevel<br \/>\n CSWosslrt<br \/>\n CSWosslutils<br \/>\n CSWpixman<br \/>\n CSWpng<br \/>\n CSWsasl<br \/>\n CSWsdlmixer<br \/>\n CSWsqlite3<br \/>\n CSWsqlite3dev<br \/>\n CSWstl4<br \/>\n CSWsunmath<br \/>\n CSWtaglibgcc<br \/>\n CSWtheora<br \/>\n CSWtiff<br \/>\n CSWungif<br \/>\n CSWvorbis<br \/>\n CSWxvid<br \/>\n CSWzlib<\/p>\n<p>4. Once these are installed, you can download mediatomb and compile it. <a href=\"http:\/\/mediatomb.cc\/pages\/download\">http:\/\/mediatomb.cc\/pages\/download<\/a><\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\ngzip -d mediatomb-0.11.0.tar.gz\r\ntar -xvf mediatomb-0.11.0.tar\r\ncd mediatomb-0.11.0\r\n.\/configure --prefix=\/mediatomb --enable-iconv-lib --with-iconv-h=\/opt\/csw\/include --with-iconv-libs=\/opt\/csw\/lib --enable-libmagic --with-magic-h=\/usr\/local\/file\/include --with-magic-libs=\/usr\/local\/file\/lib --with-taglib-cfg=\/opt\/csw\/bin\/taglib-config --with-curl-cfg=\/opt\/csw\/bin\/curl-config --with-sqlite3-libs=\/opt\/csw\/lib --with-sqlite3-h=\/opt\/csw\/include --with-search=\/opt\/csw --with-id3lib-h=\/opt\/csw\/include --with-id3-libs=\/opt\/csw\/lib\r\ngmake\r\n<\/pre>\n<p>However before you can run gmake, you need to edit a couple of files. One is the src\/main.cc, you need to comment out lines 128 through 141. This is not needed for Solaris. The second file to edit is a result of this:<\/p>\n<p>During the compile I got an error that looked like this:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n..\/src\/url.cc:78:53: macro &quot;curl_easy_setopt&quot; requires 3 arguments, but only 2 given\r\n..\/src\/url.cc: In member function `zmm::Ref&lt;zmm ::StringBuffer&gt; URL::download(zmm::String, long int*, CURL*, bool, bool, bool)&#039;:\r\n..\/src\/url.cc:78: warning: statement is a reference, not call, to function `curl_easy_setopt&#039;\r\n<\/pre>\n<p>To fix it edit the src\/url.cc file and on line 78 change it from this:<\/p>\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\r\ncurl_easy_setopt(curl_handle, CURLOPT_NOBODY);\r\n<\/pre>\n<p>to this :<\/p>\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\r\ncurl_easy_setopt(curl_handle, CURLOPT_NOBODY, 1);\r\n<\/pre>\n<p>Then rerun gmake . Once the compile is finished, su to root and do a gmake install, it will place all the media tomb stuff in \/mediatomb. (I am using a Zone on a Solaris 10 machine so \/ has plenty of space).<\/p>\n<p>I then created a user for mediatomb to be run under, so a user and group called mediatmb were created, and all the \/mediatomb directories and files were changed to be owned by mediatmb<\/p>\n<p>Once that was done, login as the mediatmb user and create a script in \/mediatmb\/bin with the following in it:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nLD_LIBRARY_PATH=\/opt\/csw\/lib:\/usr\/local\/file\/lib:\/usr\/sfw\/lib\r\nexport LD_LIBRARY_PATH\r\n.\/mediatomb --ip x.x.x.x --port 49194 --daemon --pidfile \/tmp\/mediatomb.pid --logfile=\/tmp\/mediatomb.log\r\n<\/pre>\n<p>where x.x.x.x is the IP address of the machine you are running it on. In Constantin&#8217;s blog, he mentioned also using the interface, but I found that it had problems since this was a zone. So instead of using the interface, I used the IP address of the zone.<\/p>\n<p>The changes I made to the config.xml in the ~\/.mediatomb directory are as follows:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n-bash-3.00$ diff orig-config.xml config.xml \r\n6a7\r\n&amp;gt;       &amp;lt;account user=&quot;unixwiz&quot; password=&quot;video&quot;\/&amp;gt;\r\n23c24\r\n&amp;lt; &amp;lt;protocolInfo extend=&quot;no&quot;\/&amp;gt;&amp;lt;!-- For PS3 support change to &quot;yes&quot; --&amp;gt;\r\n---\r\n&amp;gt;     &amp;lt;protocolinfo extend=&quot;yes&quot;\/&amp;gt;&amp;lt;!-- For PS3 support change to &quot;yes&quot; --&amp;gt;\r\n44a46\r\n&amp;gt;     &amp;lt;magic -file&amp;gt;\/usr\/local\/file\/share\/misc\/magic.mgc&amp;lt;\/magic&amp;gt;\r\n46a49,50\r\n&amp;gt;       &amp;lt;map from=&quot;mpg&quot; to=&quot;video\/mpeg&quot;\/&amp;gt;\r\n&amp;gt;       &amp;lt;map from=&quot;JPG&quot; to=&quot;image\/jpeg&quot;\/&amp;gt;\r\n61c65\r\n&amp;lt; &amp;lt;!-- &amp;lt;map from=&quot;avi&quot; to=&quot;video\/divx&quot;\/&amp;gt; --&amp;gt;\r\n---\r\n&amp;gt;         &amp;lt;map from=&quot;avi&quot; to=&quot;video\/divx&quot;\/&amp;gt;\r\n<\/pre>\n<p>Now all you have to do is login to the web interface and add the media, following mediatomb&#8217;s documentation.<\/p>\n<p>Some interesting things I have found with it:<\/p>\n<p>1. If your PS3 is on wireless it may have problems streaming mp4, but not mpeg2. Weird I know as the mpeg2 was solid streaming at 370kb\/s, but it couldn&#8217;t handle the mp4. Switching to a hardwired connection fixed that problem.<\/p>\n<p>2. If you happen to be a ReplayTV user [cause TiVO is a wanna be replay \ud83d\ude09 ] you can use MediaTomb in conjunction with <a href=\"http:\/\/dvarchive.org\/\">DVArchive<\/a>, which also runs nicely in my Solaris zone. Just point a media directory at the Local_Guide directory and mediatomb will stream every MPEG2 file in that directory to your PS3. Which is pretty damn cool.<\/p>\n<p>3. The PS3 is very pickly about it&#8217;s mp4 type files. Some that I made with <a href=\"http:\/\/handbrake.fr\/\">handbrake<\/a> don&#8217;t work, but ones I did with <a href=\"http:\/\/www.ffmpegx.com\/\">ffmpegx<\/a> worked once I put the hardwired connection in. <\/p>\n<p>4. I have not tried any of the transcoding stuff. I would rather do that before and not bog down my server doing that.<\/p>\n<p>5. I need to do a lot of reading on how to make folders and the such so that my collection is organized and not just all under one directory.<\/p>\n<p>For those interested:<br \/>\nMy compile environment is setup like this:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nPATH=\/bin:\/sbin:\/usr\/bin:\/usr\/sbin:\/usr\/sfw\/bin:\/usr\/ccs\/bin:\/usr\/local\/bin:\/opt\/csw\/bin\r\nSHELL=\/bin\/tcsh\r\n<\/pre>\n<p><\/zmm><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Now that I rebuilt the server, it was time to put media tomb on it to share media with the PS3. To get it to compile on Solaris (fresh 05\/09 Update 7 install patched with the latest security and recommended patches), there are a couple of things you have to do (most of this is &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blogs.sungeek.net\/unixwiz\/2009\/06\/13\/mediatomb-and-solaris-10\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Mediatomb and Solaris 10&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[42,2,25],"tags":[148,149,150,444],"class_list":["post-1140","post","type-post","status-publish","format-standard","hentry","category-random-stuff","category-solaris","category-zonescontainers","tag-mediatomb","tag-ps3","tag-replaytv","tag-solaris"],"_links":{"self":[{"href":"https:\/\/blogs.sungeek.net\/unixwiz\/wp-json\/wp\/v2\/posts\/1140","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.sungeek.net\/unixwiz\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.sungeek.net\/unixwiz\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.sungeek.net\/unixwiz\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.sungeek.net\/unixwiz\/wp-json\/wp\/v2\/comments?post=1140"}],"version-history":[{"count":11,"href":"https:\/\/blogs.sungeek.net\/unixwiz\/wp-json\/wp\/v2\/posts\/1140\/revisions"}],"predecessor-version":[{"id":1151,"href":"https:\/\/blogs.sungeek.net\/unixwiz\/wp-json\/wp\/v2\/posts\/1140\/revisions\/1151"}],"wp:attachment":[{"href":"https:\/\/blogs.sungeek.net\/unixwiz\/wp-json\/wp\/v2\/media?parent=1140"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.sungeek.net\/unixwiz\/wp-json\/wp\/v2\/categories?post=1140"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.sungeek.net\/unixwiz\/wp-json\/wp\/v2\/tags?post=1140"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}