If you ever thought about getting a media server to make accessing all your movies and audio files easier, you may have come across the term "UPNP" and such. This is basically what I want: A media server, that can serve media via UPNP (and possibly more).
Previously my Win7 PC was a media server but it was one of my dreams to get a headless, efficient linux-machine running that could serve my media.
Since I got this computer now and installed Debian on it, it now needed to find a server that I like. I tested out fuppes before and was pretty happy. But since I moved my collection there (almost 2 TB) one of the major drawbacks of fuppes showed: The updating of the database. Too bad it takes ages...
The other media server I tried was MediaTomb. I can't quite remember what was it here that kept me from using it anymore (I actually tried it before fuppes out of curiosity). I just remember going to fuppes. If I remember, I will let you know. For now let's just get to work.
uShare
uShare is my next approach and I was pretty curious. I tried to find a Debian package but failed to, so it seems I have to compile it myself. This is the motivation of this blogpost: I ran into some issues that I had to fix and I wanted to let you know how you can fix them for yourself, too.
libraries
The uShare-Site states which libraries we need:
- gcc
- pkg-config
- libupnp
- libdlna
I consider gcc and pkg-config pretty straightforward, you may already have them. If not, try searching google.
libupnp was pretty easy as I found it in my repository (it may be that I got it from debian-mutlimedia, so you may need to add that repository to your sources.list).
libdlna was my big problem here: It requires ffmpeg, so we climb one step further and get ffmpeg. Again I didn't find it on my repositories so building from source it is. Getting it with git clone and compiling it was really easy.
compiling libdlna
Now here is where my issues started: libdlna told me it couldn't find libavcodec and libavformat. I searched and found I had it so why wouldn't it work? Some googling yielded the results for me: somewhere on the developement road ffmpeg changed from /usr/include/ffmpeg to /usr/include/libavcodec and libavformat respectivley.
Really I had no idea how to fix this being pretty much a newbie. Tonight I tried to edit the configure script but it wouldn't work. I also just provided the '/usr/include/libavcodec'-path for --with-ffmpeg-dir= but since codec and format are in different directories now, I could only add one of them here.
The solution was found in a post for another software and distribution: click!
But the commands there wouldn't work out of the box. So I read what sed does and then it hit me: Maybe I just need to change the paths in multiple files, so went down into the src directory:
cat * | grep ffmpeg
It showed me there are more places to be edited. So I took the commands from the above link and used it in a manner that it would help me.
sed -i 's\|ffmpeg/avcodec.h\|libavcodec/avcodec.h\|' src/*
sed -i 's\|ffmpeg/avformat.h\|libavformat/avformat.h\|' src/*
sed -i 's\|ffmpeg/avcodec.h\|libavcodec/avcodec.h\|' configure
sed -i 's\|ffmpeg/avformat.h\|libavformat/avformat.h\|' configure
That's it. Now go and compile libdlna.
compiling uShare
That's easy. Won't comment it here.
starting uShare
at least on my system I got another issue: uShare wouldn't start, because it thinks libdlna doesn't exist. My best guess was to create a symlink from /usr/local/lib/libdlna.so.0 /usr/lib/libdlna.so.0 with:
ln -s /usr/local/lib/libdlna.so.0 /usr/lib/libdlna.so.0
Now ushare starts. Pretty easy but it seems libdlna does not go where uShare expects it naturally. The developers may have to look into that on one of those (being both by the same GeeXboX project)