Enable DLNA

It is nice when you can show photos/videos from Nextcloud on the TV. This is possible if the TV or (devices like a playStation) supports DLNA.
MiniDLNA is the package to enable DLNA on the Raspberry pi. Just install it with a command: sudo apt-get minidlna
In file /etc/minidlna.conf you can specify which folders you want to unlock. The documentation in the file is very helpful.

By default the minidlna daemon uses user and group ‘minidlna’. This results in problems with the data to be displayed via the web browser Remember the Apache2 http-server uses the www-data user.
Therefore adjust file /etc/default/minidlna.
Activate the GROUP configuration: GROUP = “www-data”

After adjusting these permissions, it is necessary to restart and reload:

  • sudo service minidlna restart
  • sudo service minidlna force-reload

(The reload updates file /var/cache/minidlna/files.db)

The Raspberry pi firewall needs to be modified to actually enable DLNA in your local network. Add the following commands:

  • ufw allow 8200/tcp
  • ufw allow 1900/udp

Now it should be possible to show photos/videos from the Raspberry pi on the TV.
Updating the files.db of minidlna is needed when changes are made on the linked folders. By default, scanning for changes takes place about every 15 minutes.
It is better when minidlna gets notified directly about changes.
Therefore, install: sudo apt-get install inotify-tools. Then modify file /etc/minidlna.conf by activating the rel inotify = yes.
(Notification in an additional process; the scanning still happens.)
After this restart again: sudo service minidlna restart

Previous pageNext page