Powerphil
Posts: 72
Joined: Sat Aug 04, 2012 9:36 pm

Minidlna

Sat May 04, 2013 5:36 pm

Hi, I've just installed minidlna on my pi and loaded files to the video directory successfully. I now want to use the videos in my USB drive. Problem is, I don't know how to mount the USB drive, and I don't know how to change the directory which the conf file is looking to. I had a test go with a USB stick which I mounted through the GUI, but minidlna didn't recognise the directory name. No doubt this is straight forward, but please help :-)

deb
Posts: 1
Joined: Sun May 05, 2013 2:19 pm

Re: Minidlna

Sun May 05, 2013 2:38 pm

From the command promt, run the following to open the Minidlna config:

sudo nano /etc/minidlna.conf

Add the following to the end of the file:
media_dir=A,/media/ExternalHd/Drive1/MUSIC

(where A stands for audio)

And, for adding a video folder:
media_dir=V,/media/ExternalHd/Drive1/MOVIES/

where V = video

The press Crtl+X (to exit) the Minidlna config.

And, then again on the command prompt run following to reload the files:

sudo service minidlna force-reload

to reload the files in the MiniDLNA database.

Powerphil
Posts: 72
Joined: Sat Aug 04, 2012 9:36 pm

Re: Minidlna

Wed May 08, 2013 7:40 pm

Hi,
Unfortuanately, this didn't work, but I did manage to mount the USB stick. The address is /media/usbstick. I thought it would simply be a case of altering the conf file with the /media/usbstick address, but when I reload minidlna it says the directory not found.

Can anyone one advise what the line in .conf would be for video? It's driving me nuts!
Phil

DarkSabre
Posts: 1
Joined: Wed May 08, 2013 7:56 pm

Re: Minidlna

Wed May 08, 2013 8:11 pm

All of your drives are identified in the minidlna.conf file starting with this:

media_dir=

Immediately following this you can identify the media type in the folder.

media_dir=A,
^ the A means the folder following this has audio files. You'd put a V here for video files.

media_dir=V,/media/usbstick
Based on the info you gave, you should have a line just like the one above in your minidlna.conf.

It sounds like you might have missed something initially.
This post should help you. These are some fantastic instructions to setup minidlna.
http://www.raspberrypi.org/phpBB3/viewtopic.php?t=16352

Powerphil
Posts: 72
Joined: Sat Aug 04, 2012 9:36 pm

Re: Minidlna

Mon May 13, 2013 8:35 pm

Hi again,
I finally made this work, but I then changed the usb stick for a larger capacity. Since then I have mounted the drive, but when I amend the minidlna.conf file, I get the following error:

[....] Restarting DLNA/UPnP-AV media server: minidlna[2013/05/13 20:33:00] minidlna.c:474: error: Media directory "/media/usbstick/video" not accessible! [Permission denied]
. ok

Can anyone point me in the right direction with this

Phil

User avatar
30021190
Posts: 7
Joined: Fri Oct 26, 2012 2:58 pm
Location: Durham
Contact: Website

Re: Minidlna

Thu May 16, 2013 6:54 am

Check that /media/* has read and execute ( r-x ) access to world invade its only root that has access.

Try sticking this in the minidlna config
media_dir=V,/media/usbstick

Without any trailing folders

Also do a minidlna -R
To refresh the database instead of just minidlna.

If you're still having issues pop a paste of ls -la /media/us stick here

Powerphil
Posts: 72
Joined: Sat Aug 04, 2012 9:36 pm

Re: Minidlna

Thu May 16, 2013 12:12 pm

Hi, many thanks for the reply. I changed the media dir as you suggested and force-reloaded minidlna. When it restarted, it said 'ok' where previously there was an error, but when I goto the other device, there's no media found. I made sure that there was in fact media in the directory before force-reload.
I haven't rebuilt the database yet as I'm at work, but will do when I get home.

I'll let you know how I get on later

Thanks

User avatar
30021190
Posts: 7
Joined: Fri Oct 26, 2012 2:58 pm
Location: Durham
Contact: Website

Re: Minidlna

Thu May 16, 2013 12:22 pm

Powerphil wrote:but when I goto the other device, there's no media found.
I use MiniDLNA for my Music and Videos, it does take time for it to index new content and I highly recommend uding the -R switch (Database Reload) when starting MiniDLNA after adding/removing directories, this will remove anything it may have disappeared and let it discover all the content again cleanly.

There is also an option for iNotify which is ideally left as "YES" but this could create performance issues with the R-Pi both CPU/IO wise and also possibly increase SD Card wear; so if you find you're having speed issues then I recommend disabling it although it will mean any new content is not automagically discovered and will need a -R (db reload)

Powerphil
Posts: 72
Joined: Sat Aug 04, 2012 9:36 pm

Re: Minidlna

Thu May 16, 2013 5:21 pm

Hi,
I've used the minidlna -R command, but not improvement. I'm not sure how to, 'Check that /media/* has read and execute ( r-x ) access to world invade its only root that has access.' Can you advise?

Powerphil
Posts: 72
Joined: Sat Aug 04, 2012 9:36 pm

Re: Minidlna

Thu May 16, 2013 6:19 pm

This is the output of the Ls -la command

pi@raspberrypi ~ $ ls -la /media/usbstick
total 1610356
drwx------ 8 pi pi 16384 May 16 18:14 .
drwxr-xr-x 5 root root 4096 May 13 19:25 ..
-rw-r--r-- 1 pi pi 110 Aug 4 2011 autorun.inf
-rw-r--r-- 1 pi pi 1621409378 Apr 27 20:30 cars 2.avi
drwx------ 20 pi pi 16384 Aug 24 2011 club_application
drwx------ 2 pi pi 16384 May 13 18:53 .fseventsd
-rwxr-xr-x 1 pi pi 110592 Jul 19 2011 RunClubSanDisk.exe
-rwxr-xr-x 1 pi pi 27311232 Jun 29 2011 RunSanDiskSecureAccess_Win.exe
drwx------ 2 pi pi 16384 Aug 24 2011 SanDiskSecureAccess
drwx------ 4 pi pi 16384 May 13 18:53 .Spotlight-V100
drwx------ 3 pi pi 16384 May 13 18:53 .Trashes
-rw-r--r-- 1 pi pi 4096 May 13 18:53 ._.Trashes
drwx------ 2 pi pi 16384 May 13 19:31 Video
-rw-r--r-- 1 pi pi 4096 May 13 19:21 ._Video

Phil

User avatar
30021190
Posts: 7
Joined: Fri Oct 26, 2012 2:58 pm
Location: Durham
Contact: Website

Re: Minidlna

Fri May 17, 2013 9:03 pm

Hi, Sorry for the delay in replying

Your videos is only available to the user pi (and I'm not sure what user minidlna is running under) so I'd suggest doing

chmod -R 705 /media/usbstick/Video

but it shouldn't be unnecessary, from what you've said, everything should be available once its found.

Powerphil
Posts: 72
Joined: Sat Aug 04, 2012 9:36 pm

Re: Minidlna

Sat May 18, 2013 10:36 am

hi,
many thanks for helping me with this, but after 3 nights of frustration, and LOTS of head scratching, I finally made it work.
Whilst the USB stick was mounted, I clearly wasn't getting the permissions correct, but with this command, and a database rebuild as suggested, It sprang into life.
If anyone else is having the same problem, then try this:

sudo mount -t vfat -o uid=pi,gid=pi /dev/sda1 /media/usbstick/

Many thanks

Phil

geekinthesticks
Posts: 96
Joined: Fri Feb 08, 2013 7:22 pm

Re: Minidlna

Sat May 18, 2013 5:42 pm

You can get it to mount at boot. Put something like this in /etc/fstab

Code: Select all

/dev/sda1  /media/usbstick               ext4    defaults,noatime  0       1
You will need to adjust the ext4 part to reflect whatever file system is on your usbstick. Type man mount in a terminal to see what the options are.

Return to “Media centres”