Media player for local recordings

I’m sure there is such functionality but I can’t find an example of it. I have several security cameras that write short video when motion is detected. I want to have a player in Lovelace dashboard that would allow to select file from specific folder and play it.

Natively supported in 0.115.x. There is a media browser icon in the side panel and any media recorded to /media appears there. https://www.home-assistant.io/integrations/media_source/

sorry for hijacking. I am intersted too about local media.
I just added in my configuration the following

media_source:

Should I manually add the /media folder, and add there my mp3s?

my installation is

Operating system
Ubuntu 18.04.4 LTS
Docker version
19.03.12
1 Like

Started playing with the new native support some last night.
I have added to the config media_source: (which you should not need if you use default_config:)

and have added to the homeassistant config:

homeassistant:
 .......
  media_dirs:
    motion: <config_dir>/media/motion_events
    music: <config_dir>/media/music

(in my case I’m using HA core (python venv) thus the need for <config_dir>).
At first no Media Browser in the side panel :frowning: but after restarting HA a couple of times it indeed shows up :slight_smile:

Web page shows the two directories and once in a directory shows you all the files. Just click on a file and the browser will attempt to play it.

1 Like

I am trying to add the following in my configuration, but nothing happens

homeassistant:
  media_dirs:
    local: /media

I think the documents should provide more info about it

Are you saying that the media browser icon will appear in side panel with overview, history, logbook etc. ?

make sure you add below in your config as well.
That enables the media browser in the side panel

media_source:

Yes, you need at least one of the following in your configuration.yaml file.

  • default_config:
  • media_source:

And your Samba add-on needs to be up-to-date and then you should see a new icon in your side panel after a page refresh (or HA restart).

image

And if you want to write to it, you can just use /media as I’ve done for a camera automation

    - service: camera.record
      data:
        entity_id: camera.entry_rtsp_direct
        filename: '/media/2_entry_intrusion.mp4'

The /media folder is not part of your www folder structure and is instead one of the share directories

image

Hi, I think this is my problem. I am looking for the media folder where the configuration is and as I saw from your picture is outside but the way my system is right I only see the the folder where the configuration is.

since I don’t know a lot from linux and samba I don’t know how to see more folder like you do… (share,backup,media etc)

Below is how my system is. I think I have to run some commands in linux in order to be able to see more folders. Is there any chance to know what I should do?

Operating system
Ubuntu 18.04.4 LTS
Docker version
19.03.12
workgroup: WORKGROUP
username: myusername
password: mypass
interface: ''
allow_hosts:
  - 10.0.0.0/8
  - 172.16.0.0/12
  - 192.168.0.0/16
veto_files:
  - ._*
  - .DS_Store
  - Thumbs.db
  - icon?
  - .Trashes
compatibility_mode: false

In your instance, you’ll need to define the full path as in the post above Media player for local recordings

I will try it right now , but in order to understand in my system there is no way to see for example the back up files? only the the section where configuration is?

no that’s not working for me.
in configuration check I get errors

Configuration invalid

                          not a directory for dictionary value @ data['media_dirs']['motion']

Please bear in mind that the media browser is always available since I upgrade to 0.115 only the folder missing, and when I did place in my configuration the

homeassistant:
  media_dirs:
    local: /media

it says that the folder is empty, which (i think) the media browser can “see” somehow the folder

Try writing something to it with an automation.

I like HA - to get required feature need just to update :smile:

So my changes that worked for docker installation:

homeassistant:
...
  allowlist_external_dirs: "/tmp/recordings"
  media_dirs:
    recording: /tmp/recordings

media_source:
...

I have a bunch of files in my media folder but none show up in the media browser, anyone got any clue what that could be about?

I didn’t have a media folder by default by had to create one. Did I place it wrong?

Is there no way with the Media Browser to select multiple tracks that will then play sequentially? Support for a playlist? Or play an album of tracks?

Bump.
Still trying to figure out a way to select multiple tracks to play and have next/previous track controls.
Works ok with vlc-telnet to a local 3.5mm speaker socket but I want to cast my music to a GH Mini and I get no audio when casting vlc-telnet through Chrome browser.

I’m not sure if this helps you, but with 2022.2 I can now use plex playlists. Not perfect, but a big step in the right directions IMO.

What I really want to do is use a playlist (plex or otherwise) in an automation.

1 Like