# home media server recommendations



## stroudmw (Jun 28, 2020)

I am looking to build a very simple home media server. What I would like is to go to my laptop, open up my favourite music or video player, click "file -> open", see my storage as another drive, and play my stuff (stream it - without waiting for it to download first).

This will not be a public-facing server, so I'm not too concerned with SSL, Jails, etc. as I will need to be within range of my wireless router to see the network at all (and I live out in the sticks).

I've tried Nextcloud, but it's much more than I need. I'm currently running Seafile, but, as with Nextcloud, it's more than what I need: I don't really need syncing as I don't need my music & video files duplicated over several laptops. Seadrive is excellent, but it's not open source, doesn't run on any of the BSDs, and is only supports a limited number of Linux distros. 

So, what I'd like is to build my own version of Seadrive, where I can play content on a laptop or an android device as if that content was stored locally.

I've heard of FreeNAS, but I think that it's also overkill. My server is quite old: a re-purposed 10+ year old desktop PC: a dual 3GHz Pentium with 3GiB RAM - but it works quite well with Nextcloud/Seadrive/Seafile. And I don't need for it to have a GUI.

Does anyone have any recommendations, please?


----------



## zirias@ (Jun 28, 2020)

I'm simply using net/minidlna to serve the content (most "Smart TV"s can play it, and of course a lot of PC media players) -- and either NFS or Samba/CIFS to put it there.


----------



## drhowarddrfine (Jun 28, 2020)

I don't know if devel/kodi-platform is what you want.


----------



## SirDice (Jun 29, 2020)

Just install Samba, create a share with your files and connect from Windows or MacOS to it.


----------



## stroudmw (Jun 29, 2020)

SirDice said:


> Just install Samba, create a share with your files and connect from Windows or MacOS to it.


I don't have a Windows or MacOS computer 

What I'm really looking for is an Open Source alternative to Seadrive.


----------



## SirDice (Jun 29, 2020)

You can access the  same Samba shares  from Linux or BSD too. But then you may be better off using NFS instead (hint; use automount(8)/autofs(5) for this). You can also mix them, share the same files on both Samba and NFS.


----------



## VladiBG (Jun 29, 2020)

It's better to use a cheap NAS server as it's power consumption is lower compared to desktop pc.


----------



## Zvoni (Jun 29, 2020)

I agree with SirDice: Samba should be enough.
BUT, IIRC it's got more to do with how your video-file is encoded.
If it's a "standard" video-file, it will always got copied over temporarly, and then played locally.
For a video-file to be "streamed" from a LAN-Storage, it should be encoded with this "web-optimized"-thingy you can find in "Handbrake"
I'm ignoring Music (a.k.a mp3) since nowadays the bandwidth is enough to not really notice 5-10 MB being copied over
EDIT:


			HandBrake Documentation — Web Optimised


----------



## SirDice (Jun 29, 2020)

Zvoni said:


> If it's a "standard" video-file, it will always got copied over temporarly, and then played locally.


No,  this doesn't  happen. It's just a filesystem and the file is directly loaded and played from it.


----------



## Zvoni (Jun 29, 2020)

SirDice said:


> No,  this doesn't  happen. It's just a filesystem and the file is directly loaded and played from it.


You sure?
I'm asking since i do have two Samba-Servers running on FreeBSD 12.1, and when i doubleclick on a Video-File (>1GB) inside the Samba-Share from my Linux-Client, it takes approx. the time it would need to copy it over to the client until VLC (or whatever other player i use) starts playing.
EDIT: Since i'm using Conky to display ressource-usage on my client, i think i remember RAM-Usage jumping up about the same amount as the filesize in question.
But i might be wrong, since it's not an issue for me, but the OP?
EDIT2: To clarify: with "copy over" i mean: the client pulls the file through the LAN in one go into the Memory of the Client, and then starts playing it


----------



## SirDice (Jun 29, 2020)

Zvoni said:


> I'm asking since i do have two Samba-Servers running on FreeBSD 12.1, and when i doubleclick on a Video-File (>1GB) inside the Samba-Share from my Linux-Client, it takes approx. the time it would need to copy it over to the client until VLC (or whatever other player i use) starts playing


None of the 11TB of video files I have do this. It would be rather annoying having to pull a 4GB movie file completely over my crappy WiFi in order to play it.


----------



## Zvoni (Jun 29, 2020)

SirDice said:


> None of the 11TB of video files I have do this. It would be rather annoying having to pull a 4GB movie file completely over my crappy WiFi in order to play it.


Yeah, i feel you, but maybe those files are encoded in the way i mentioned above


> If you are encoding for the web and using the MP4 file format, you’ll want to turn on “Web Optimised” checkbox. *This places the MP4 container header at the start of the file, optimizing it for streaming across the web.*
> 
> 
> This is often referred to as MP4 “Fast Start”.


Meaning: It starts playing your video, but loads continously in chunks in the background

EDIT: On a sidenote (which, i think, supports my idea): I remember one of our video-jumpers complaining, that every time he plugs his GoPro into his Win10-Laptop, and choosing a video-file directly on the SD-Card, the Windows-Copydialog jumps up, and you can see it copying it to a tmp-folder with a temp. Name (Yes, in Winblowze, but the idea would be the same), before his player even starts up!


----------



## `Orum (Jul 1, 2020)

Zvoni said:


> Yeah, i feel you, but maybe those files are encoded in the way i mentioned above


One thing that can cause the behavior you describe is the lack of an index in the container.  This is not permitted by the spec in some containers (e.g. mp4), but is permitted in others (e.g. mkv).  If a file lacks an index, your player may try to parse the whole file to effectively generate its own index (though this will not be written back into the file).

If this is indeed what is causing your problem, the simplest way to solve it is by remuxing, which will create a new file with an index.  For example, to do this with mkv using mkvtoolnix, you just need to run `mkvmerge -o <newfile.mkv> <oldfile.mkv>`.  Note that remuxing is _not_ the same as reencoding, as the underlying streams remain unchanged.


----------



## Mjölnir (Jul 1, 2020)

VladiBG said:


> It's better to use a cheap NAS server as it's power consumption is lower compared to desktop pc.


My 50¢ to this, too.  If your media server runs several hours/day, after a few month the costs for electricity are the same as if you buy a more modern small computer _now_, e.g. a (used/refurbished) netbook or home NAS, optionally ARM-based, or one of these ARM thingies (~50 $/€/£ SoC incl. case, new).  These old _Pentium_ with their _NetBurst_ micro-architecture eat electrons like popcorn.  Last not least it's counter-productive to use a noisy system to hear music...

many consumer-grade WLAN routers are Linux-based and allow you to connect external media (MS-DOS/NTFS) via USB, which they export via SAMBA.  Did you check that on the web interface of your WLAN router?


----------



## Zvoni (Jul 1, 2020)

mjollnir said:


> My 50¢ to this, too.  If your media server runs several hours/day, after a few month the costs for electricity are the same as if you buy a more modern small computer _now_, e.g. a (used/refurbished) netbook or home NAS, optionally ARM-based, or one of these ARM thingies (~50 $/€/£ SoC incl. case, new).  These old _Pentium_ with their _NetBurst_ micro-architecture eat electrons like popcorn.  *Last not least it's counter-productive to use a noisy system to hear music...*


Not if it's in another room with a foot of concrete in between....


----------



## Mjölnir (Jul 1, 2020)

To which IDE are you refering to? _Emacs_? That's not an editor, but an OS: it manages the computer's resources  _(old joke from the late 80'ies, when PC's had 2MB RAM and 8 MB swap)_


----------



## Lamia (Jul 4, 2020)

Since you said seafile but not impressed with nextcloud, I am not sure emby-server and Jellyfin would be good recommendations. You have also been advised to try Samba or NFS. NFS is easier setup than Samba.


----------



## diizzy (Jul 18, 2020)

If you want to make your life easy and less painful:

Client OS:
Windows --> Samba
Linux/BSD/MacOS --> NFS (you can get away with SMB but NFS is usually less work and less overhead)
TV/Xbox/Playstation etc --> minidlna (unless you want transcoding which kan be very taxing on the server)

Do note that minidlna doesn't transcode media so not everything will work, I have a WIP port of Gerbera but it will be at least until 1.6.0 is released before being submitted/added to ports.


----------



## jmos (Jul 19, 2020)

diizzy said:


> Do note that minidlna doesn't transcode media so not everything will work


Last time I've got videos not playable directly via MiniDLNA must be ~2 years ago. And as VLC has UPnP support…: Using VLC as player you're also finished with MiniDLNA on Windows, Android, Linux etc. (only FreeBSDs VLC must be compiled from the ports as here UPnP is disabled in the package). Unless you really need direct file access for other purposes I won't set up Samba (ugh!), NFS, SSHFS etc. just to play videos or listen to music. With DLNA / UPnP there's an explicit tool for this use case.


----------



## diizzy (Aug 5, 2020)

I've used it fine a week or so ago so I think it works just fine (LG TV as client) ;-)
Anyhow https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=248475 works for sure with VLC


----------



## stroudmw (Sep 23, 2020)

I've just been informed that Seadrive will be released as Open Source before the end of the year. So, I'll stick with that and see what happens. 

Thanks for all of your feedback!


----------



## Alain De Vos (Sep 23, 2020)

In my personal opinion samba & nfs are unsafe.Samba has vulnerabilities and nfs can't bind to an ip-address. 
I would go for an iscsi-share.


----------



## Zvoni (Sep 23, 2020)

Alain De Vos said:


> In my personal opinion samba & nfs are unsafe. I would go for an iscsi-share.


For a *HOME *media server?
Not everything has to be safe from NSA, CIA etc.....


----------



## olli@ (Sep 23, 2020)

Alain De Vos said:


> In my personal opinion samba & nfs are unsafe.Samba has vulnerabilities and nfs can't bind to an ip-address.


nfsd(8) has the `-h` option to bind to an IP address. Apart from that, it’s probably a good idea to control NFS packets with IPFW or PF. And if you have a switch that supports VLANs (IEEE 802.1Q), you can use a dedicated VLAN for NFS traffic.


----------



## Dmitry Samersoff (Jan 4, 2021)

Minimalist approach would be sshfs. But for convenient playing it's better to use minidlna (with e.g. vlc player) as mentioned above.


----------



## Dmitry Samersoff (Jan 4, 2021)

PS: Does anybody know the server for FreeBSD that supports AirPlay protocol or any opensource implementation of it?


----------



## SirDice (Jan 4, 2021)

Only audio/shairplay seems to be available. Don't know how well it works though, I don't have Apple equipment.


----------

