Video Player Component For mp4 Files

My RPI is taking 90s Videos via ffmpeg if a outdoor camera detects a movement and stores them locally where also HA is running. It would be nice to be able to play these videos inside HA in a dedicated card.

push… just updated the initial description, I think now it is more clearer what I would like to have

I tried this but it doesn’t work.

camera:
  - platform: ffmpeg
    name: video
    input: http://192.168.2.150:8123/local/vid.mpg

This is the error I got, I doubled check the file exists in my www directory and the video can be downloaded by the url.

2019-04-29 08:23:11 ERROR (MainThread) [haffmpeg.core] FFmpeg fails [Errno 2] No such file or directory: ‘ffmpeg’: ‘ffmpeg’
Traceback (most recent call last):
File “/Users/trk/homeassistant/homeassistant/lib/python3.7/site-packages/haffmpeg/core.py”, line 136, in open
self._proc = await self._loop.run_in_executor(None, proc_func)
File “/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/concurrent/futures/thread.py”, line 57, in run
result = self.fn(*self.args, **self.kwargs)
File “/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py”, line 775, in init
restore_signals, start_new_session)
File “/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py”, line 1522, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: ‘ffmpeg’: ‘ffmpeg’

DId you ever get this working? I’ve been looking into it. It seems a possibility would be ussing folder_watcher and setting it up as a “camera”.

However for me the videos are in a different machine but they can be served in a url = 192.168.1.249/ohnvfnv/video.mp4 but I can’t work out how to set this up, especially since the link would always change

I’ve solved this, but not with native Home Assistant components. I’m using the iframe component of Home Assistant to add a new menu to the sidebar called “Videos”. This is loading a URL also located on this server that points to a Java Script which presents the Videos. I’m using videojs for that: http://videojs.com

At the end, it looks like this:

I’v done the same with baguetteBox.js to show all the images my camera takes if it detects a movement:

incredible, could you explain how you do that
thanks

Thanks! Well the most important parts are already explained above. What I’ve not mentioned: I’m using nginx as reverse proxy to redirect all requests used by my home assistant iframes to the needed locations on disk.

For example:
mysmarthome.com/videos > /data/videos/index.php
mysmarthome.com/images> /data/images/index.php

thanks for answering, but i don’t understand how you use videojs in home assistant, could you describe the steps a little more detailed? you’re talking about a script but i have no idea how to do all that Sorry for the inconvenience and thanks again

No need for iframe or external solutions guys. I present the following :laughing:

Play MP4 files or stream HTTP/RTSP in Lovelace

This custom card will show a list of mp4 files and play them in the dashboard.

In HACS, search for:
Gallery Card 2024