I’m completely new to HA. I can set the live to be seen from the dashboard with this config:
show_state: true
show_name: true
camera_view: live
type: picture-entity
entity: camera.camera_ingresso
camera_image: camera.camera_ingresso
name: Ingresso
and it seems to be able to see the first frame only. Clicking the camera to see it bigger makes the live feed window load and then dissapear multiple times but sometimes I can briefly see “Error with media stream content”
Here’s everything I think is relevated:
I have a Home Assistant Supervised install on a Debian 12.
A Raspberry Pi 4B 4GB with ffmpeg creates a RTSP Stream from a USB Webcam and passes it to MediaMTX (previously known as rtsp-simple-server) and I can see and hear this stream through everything (VLC, MPC-HC and etc…) except my Home Assistant interface
This is the ffmpeg command that starts the stream from the Raspberry:
ffmpeg -f v4l2 -video_size 640x480 -r 50 -thread_queue_size 512 -i /dev/video0 -f pulse -sample_rate 16000 -channels 4 -thread_queue_size 512 -i default -b:v 2M -c:a aac -b:a 192k -ar 16000 -ac 2 -f rtsp rtsp://192.168.1.10:8554/stream.sdp
I’ve tried different codecs for both audio and video, disabling only audio or only video and setting -rtsp_transport to both tcp and udp (and changing configuration.yaml accordingly) after -f rtsp
My configuration.yaml:
ffmpeg:
camera:
- platform: ffmpeg
name: Camera_ingresso
input: rtsp://192.168.1.10:8554/stream.sdp
This is all I get from the Home Assistant Core logs:
2023-08-15 19:44:24.473 ERROR (stream_worker) [homeassistant.components.stream.stream.camera.camera_ingresso] Error from stream worker: Stream ended; no additional packets
This could be irrelevant but this is what I get from MediaMTX logs when VLC watches the stream for 10 seconds:
Aug 15 20:04:57 raspberrypi mediamtx[15542]: 2023/08/15 20:04:57 INF [RTSP] [conn 192.168.1.103:9634] opened
Aug 15 20:04:57 raspberrypi mediamtx[15542]: 2023/08/15 20:04:57 INF [RTSP] [session 583327d0] created by 192.168.1.103:9634
Aug 15 20:04:57 raspberrypi mediamtx[15542]: 2023/08/15 20:04:57 INF [RTSP] [session 583327d0] is reading from path 'stream.sdp', with UDP, 2 tracks (MPEG-4 Video, MPEG-4 Audio)
Aug 15 20:05:09 raspberrypi mediamtx[15542]: 2023/08/15 20:05:09 INF [RTSP] [session 583327d0] destroyed (torn down by 192.168.1.103:9634)
Aug 15 20:05:09 raspberrypi mediamtx[15542]: 2023/08/15 20:05:09 INF [RTSP] [conn 192.168.1.103:9634] closed (EOF)
When I open the dashboard and then click the live
Aug 15 20:06:32 raspberrypi mediamtx[15542]: 2023/08/15 20:06:32 INF [RTSP] [conn 192.168.1.240:37688] opened
Aug 15 20:06:32 raspberrypi mediamtx[15542]: 2023/08/15 20:06:32 INF [RTSP] [session 49a3f0ac] created by 192.168.1.240:37688
Aug 15 20:06:32 raspberrypi mediamtx[15542]: 2023/08/15 20:06:32 INF [RTSP] [session 49a3f0ac] is reading from path 'stream.sdp', with UDP, 2 tracks (MPEG-4 Video, MPEG-4 Audio)
Aug 15 20:06:32 raspberrypi mediamtx[15542]: 2023/08/15 20:06:32 INF [RTSP] [session 49a3f0ac] destroyed (torn down by 192.168.1.240:37688)
Aug 15 20:06:32 raspberrypi mediamtx[15542]: 2023/08/15 20:06:32 INF [RTSP] [conn 192.168.1.240:37688] closed (EOF)
Aug 15 20:06:34 raspberrypi mediamtx[15542]: 2023/08/15 20:06:34 INF [RTSP] [conn 192.168.1.240:37702] opened
Aug 15 20:06:34 raspberrypi mediamtx[15542]: 2023/08/15 20:06:34 INF [RTSP] [session a842cc45] created by 192.168.1.240:37702
Aug 15 20:06:34 raspberrypi mediamtx[15542]: 2023/08/15 20:06:34 INF [RTSP] [session a842cc45] is reading from path 'stream.sdp', with UDP, 2 tracks (MPEG-4 Video, MPEG-4 Audio)
Aug 15 20:06:34 raspberrypi mediamtx[15542]: 2023/08/15 20:06:34 INF [RTSP] [session a842cc45] destroyed (torn down by 192.168.1.240:37702)
Aug 15 20:06:34 raspberrypi mediamtx[15542]: 2023/08/15 20:06:34 INF [RTSP] [conn 192.168.1.240:37702] closed (EOF)
I know I’ve included a lot but if someone notices something just tell me and I’ll look into it