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


#1

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:

SEAFUSE - For the love of God PLEASE HELP!
#2

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!


#3

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.


#4

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:


#5

http://mediatomb.cc/ sounds interesting but …window? I don’t have a desktop environment on my server. :confused:


#6

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.


#7

[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.


#8

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


#9

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.


#10

That’s easy. Just put your seaf-fuse starting-line in rc.local.


#11

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.


#12

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.


#13

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)


#14

You could avoid that by decreasing the loglevel of miniDLNA.