Tutorial for streaming video/audo with your Seafile server via miniDLNA and FUSE

This tutorial is licensed under CC-BY-SA - feel free to share and modify it (but keep information free)!

:triangular_flag_on_post: This tutorial was originally written for the first Seafile forum of Seafile GmbH. Since the announcement to fork Seafile by Seafile GmbH Iā€™ve decided to move my tutorials to the new Seafile forum of the original developers of Seafile (so this one).
This tutorial version is the maintained one.


Tutorial for streaming video/audo with your Seafile server via miniDLNA and FUSE
(This tutorial is an add-on for Tutorial for Seafile CE + Nginx + dynamic DNS (on ARM / Cubietruck / RaspberryPi))

A feature I was missing using Seafile was streaming the content of a library to a media pc (KODI in my case). Yes, you can open a library using WebDAV but this wonā€™t work for videos. So with (a lot of) help from @jobenvil I figured out how to stream from my Seafile server via FUSE and miniDLNA.

Tutorial for streaming video/audo with your Seafile server via minidlna and FUSE

Install FUSE and miniDLNA

Install FUSE and miniDLNA on your server:

sudo apt-get update && sudo apt-get install fuse miniDLNA

FUSE system group, mount point, start FUSE

Add a system group for FUSE, create a mount point where you mount your (only unencrypted!) seafile libraries and start FUSE:

sudo addgroup fuse
sudo mkdir -p /mnt/seafile-fuse
cd /path/to/seafile-server-latest
sudo ./seaf-fuse.sh start -o allow_other /mnt/seafile-fuse

(you will find your Seafile libraries under cd /mnt/seafile-fuse now)

miniDLNA configuration

In /etc/minidlna.conf exchange:

media_dir=/var/lib/minidlna

with:

media_dir=V,/mnt/seafile-fuse/YourUser@YourMail.TLD/1f3df213-ac7a-3e06-8ae2-13a84f7983f3_YourLibrary/videos

and enable (by removing # in front of the line:

  • db_dir=/var/cache/minidlna
  • log_dir=/var/log
  • inotify=yes
  • notify_interval=895

Restart miniDLNA:

service minidlna force-reload && service minidlna status

Optional: firewall settings for miniDLNA and UPnP

If using a firewall open port 8200 (for miniDLNA, TCP) and 1900 (for UPnP, UDP is enough here).

miniDLNA connection test

Check the connection to miniDLNA on your client:

http://your.server.ip.address:8200/

Now you can access the Seafile libraries (for example) using KODI by adding your Seafile server as an UPnP media source.

Important:

  1. If you have a large media library (several hundred videos for example) your media center pc may take a while to index all the media files. It may take some hours. :tea:
  2. Everytime you add new media to the Seafile library you are streaming you have to restart miniDLNA with sudo service minidlna force-reload (otherwise miniDLNA doesnā€™t recognize the new added media files).

Thanks again to @jobenvil ! :beers:

Please:

  1. report any bugs in this thread :bangbang:
  2. report if it works and if some sentences/comments are confusing (and why). :bangbang:
  3. ask all questions in this thread and not via PM (there are no stupid questions for me) :bangbang:
1 Like

Hi,

Thank you very much for your tutorial ! It worked on my banana pi (seafile server) linked to a kodi (raspberry) !


In /etc/minidlna.conf, I got a bit confused. Here is what you could write to be easier (at least for me :wink: ) :

type ls /mnt/seafile-fuse/YourUser/
copy/paste the folder in which your videos are

And then give an example :

media_dir=V,/mnt/seafile-fuse/seafileuser@gmail.com/1f3df213-ac7a-3e06-8ae2-13a84f7983f3_videos/

we donā€™t need more than ā€œ/ā€ at the end, unless you want to precise a specific folder of the library.

If there are spaces in you Library name, you need backslash ā€œā€ before each of them.


Then, for the test on http://your.server.ip.address:8200/, maybe just put an example output of the webpage :

MiniDLNA status
Media library
Audio files 0
Video files 14
Image files 0
Connected clients
ID Type IP Address HW Address
0 Unknown your.web.browser.ip 00:11:22:33:44:55
1 Generic DLNA 1.5 your.seafile.server.ip AA:BB:CC:EE:DD:EE

You might need some time to see the ā€œvideo filesā€ number go up.

Thanks again for sharing, keep up the good work!

1 Like

Thanks alot!

Unfortunately I can not edit my starting post anymore. @daniel.pan Would you give me the right to edit the starting post of this topic?

Actually Iā€™m a little bit disappointed with the solution I posted here over the last weeks. It always need an uncertain amount of time that new media appeared in my Kodi device.
@jobenvil and some others already told me that there is a problem with inotify so that new media in Seafile wonā€™t be added automatically in miniDLNA. I always had to service minidlna force-reload and sometimes wait some days but recently even this doesnā€™t work anymore.

Unfortunately I donā€™t have the time to figure out another solution. If you want to have some more reliable way of streaming media I donā€™t know if Seafile is a good base for this at the moment.

Well, I also have issues with miniDLNA so Iā€™ve switched to Mediatomb.

Seems nice so far. Itā€™s easy to installYou can stream audio as well, and you can configure everything through a webpage.

The only little issue so far is that i canā€™t get it working as a deamonā€¦ so i launch it with putty and thenā€¦ close the window (bad badā€¦)

Let me know if you want to know more about it. :slight_smile:

http://mediatomb.cc/ sounds interesting but ā€¦window? I donā€™t have a desktop environment on my server. :confused:

Putty is a ssh client for Microsoft Windows.

A ssh client is used to remotely launch a shell on your server from another computer.

From another linux computer you can install ssh and do :
ssh serveruser@ip.to.your.server

Itā€™s also possible with a smartphone, with ā€œconnectbotā€ for example.

This can be useful if your server is in a cave like mine :wink: So you donā€™t need any monitor for it, and you can apply changes to your server from anywhere.

But as said, the best would be to make it run as a deamon, so we donā€™t need any ā€œtrickā€. For now Iā€™m testing this mediatomb as is, and if itā€™s working well then Iā€™ll be looking into the daemon issue.

[quote=ā€œVirgile_Jarrige, post:6, topic:133, full:trueā€]
Putty is a ssh client for Microsoft Windows.

A ssh client is used to remotely launch a shell on your server from another computer.

From another linux computer you can install ssh and do :
ssh serveruser@ip.to.your.server

Itā€™s also possible with a smartphone, with ā€œconnectbotā€ for example.

This can be useful if your server is in a cave like mine :wink: So you donā€™t need any monitor for it, and you can apply changes to your server from anywhere.[/quote]

Sure. Thatā€™s how I access all my servers. :wink:

I understood mediatomb needs a desktop environment to run. If you can start it via command line it should be fine to run it in a second terminal using a terminal multiplexer.

Hello,
i will try this, but i have a problem. After restart i must restart

and

How can i make a autostart.
thx for help
ReinaldH

Well this was never a question for me because I have to start Seafile manually anyway because of my specific setup. If I wanted to have autostart for this I would try to modify the start script - but I have no idea if this would be done this way. Please report back here if you tried it.

Thatā€™s easy. Just put your seaf-fuse starting-line in rc.local.

1 Like

EDIT: Still posting this as it may help somebody else:


Great idea on the local mounting. My usage is a bit different, but I was trying to use the first portion involving mounting the libraries locally so other tools could access my files. (in this case media, for a streaming media server)

My issue is that upon mounting fuse root owns the mountpoint as well as all the files inside. Additionally I am unable to change permissions, I presume they are read only, by the operation not supported error message. I did some basic research and guesswork, but is there an alternate mount command that could be run to provide, say www-data access to the mountpoint?


As I was typing this out, I realized that my media server, in this case Ampache, had symlinks outside the /usr/local folder, which reminded me that www-data typically has restrictions accessing files outside the document root, or something along those lines. What I ended up doing was using the mount point as defined above, then symlinking the library/folder into the web folder for the media server. In my case it looks like this:

user@server:/usr/share/ampache/www$ ls -lsa | grep music
 4 lrwxrwxrwx  1 root     root        81 Jul 20 13:24 music -> /mnt/seafile-fuse/user@server.com/library-id-here_Music/

Adding the path to the media server seems to be working like a charm. Thanks for the tip on fuse, sorry if this is slightly thread hijacking, hopefully anyone else wanting to use Seafile to host/manage their media collection can use the information above to access the media with Ampache/Plex/Kodi/Emby/Subsonic.

Quoting https://manual.seafile.com/extension/fuse.html:

Currently the implementation is ā€˜ā€™ā€˜read-onlyā€™ā€˜ā€™, which means you canā€™t modify the files through the mounted folder.

Works for me!

I run Seafile and MiniDLNA as user ā€œseafileā€. And To start Fuse, I use the following command:

./seaf-fuse.sh start -o uid=1000 -o allow_other /path/to/seafile-fuse

uid 1000 is seafile.

Didnā€™t test updating libs or tested uptime/stability.

One annoyance though: MiniDLNA is constantly looknig for AlbumArt. So your seaf-fuse.log will get flooded with ā€œxxx doesnā€™t exist in repoā€. (at least on my system)

You could avoid that by decreasing the loglevel of miniDLNA.

1 Like