Open tonysprenk opened 1 month ago
If you talking about mjpeg camera - it's not supported. Because it doesn't have a stream.
I want to add the map from my robot vacuum cleaner to HomeKit. The map in home assistant is a camera component. When I add it to HomeKit with the HomeKit integration the preview image works but the stream does not. In home assistant I have an error saying that there is no stream.
I was hoping that go2rtc could transcode the vacuum cleaner map camera component to h264.
You repeated what I said. MJPEG camera in Hass is not a stream. You can get a MJPEG link from Hass, add a long live token to it, and use that as a source for go2rtc. You can find the link in the browser debug menu or ask around on the Hass forums.
Ok I have done that but the h264 stream is not working. This my config:
streams:
camera.x40_ultra_complete_map: "http://homeassistant.local:8123/api/camera_proxy_stream/camera.x40_ultra_complete_map#header=Authorization: Bearer xxxx"
I get this error when streaming h264:
Webrtc/offer: streams: codec not matched: JPEG => h264, ......
Thank you for the help so far and any further insights.
You should setup transcoding
With this config:
streams:
Map:
- "http://homeassistant.local:8123/api/camera_proxy_stream/camera.x40_ultra_complet_map#header=Authorization: Beare xxx"
- ffmpeg:Map#video=h264
I get the following error:
10:02:31.664 PM error undefined error=streams: exec/rtsp
[out#0/rtsp @ 0x7f8d2f4f00] Output file does not contain any stream
Error opening output file rtsp://127.0.0.1:8554/ab29e4cbf5edb947487550b7caf09bdf.
Error opening output files: Invalid argument
caller=github.com/AlexxIT/go2rtc/internal/hls/ws.go:28
Any suggestions? thanks for the help so far.
Are you sure this stream is currently running in MJPEG format?
I assume so because I'm accessing it through the home assistant API camera proxy. And opening the original stream in go2rtc works fine. Where it says MJPEG as the source.
Go to go2rtc WebUI > links page for your stream. Try to open RTSP for this stream for example in VLC.
Also you can copy MJPEG stream link and use it as input for ffmpeg
source. Because by default it will try to use RTSP as input.
I have come to find out that the source is a series of images (as you mentioned before) in the PNG format. This FFMPEG command works in terminal:
ffmpeg -re -loop 1 -headers "Authorization: Bearer long_lived_access_token" -i "http://homeassistant.local:8123/api/camera_proxy/camera.x40_ultra_complete_map" -vf "fps=1" -vcodec libx264 -r 15 -pix_fmt yuv420p output.mp4
How can I use it in go2rtc?
Hi :) Did you mange to make it work? I have integrated my 3D printer and I would love to transcode the camera entity too. It looks similar to your request :)
I thought I could just do:
But then I get an error. What am I doing wrong?