Open felipecrs opened 1 month ago
You should try echo ffmpeg source. Go2rtc has not best HLS client
Like this?
echo -n "ffmpeg:${url}#video=copy#audio=copy"
The following error shows up in the player:
Not sure if I am doing something wrong.
Oh, fixed that with:
echo -n "ffmpeg:${url}#video=copy#audio=opus"
Ok, now I tried with:
echo -n "ffmpeg:${url}#video=h264#hardware=vaapi#audio=aac#audio=opus"
But the stream is behaving exactly like before.
Looks like not even ffmpeg is able to play this stream correctly. Maybe it is a matter of tweaking some flags though.
I created this script:
https://github.com/felipecrs/get-tuya-webrtc-configs/blob/master/get_tuya_stream_url.sh
It can be used to get the Tuya stream URL without needing the Tuya integration in Home Assistant.
It works fine and has both RTSP and HLS mode.
However, my brother has 2 Tuya cameras for which the stream does not work in Home Assistant (apparently https://github.com/home-assistant/core/issues/68503). Then, making some tests with it, I noticed that camera's stream cannot be played through RTSP, but only HLS. This must be why it is not working in HA itself, because the HA integration always asks for a RTSP stream.
The HLS stream generated by such script for such camera looks like below:
It expires after some time.
The stream can be played just fine on VLC, no interruptions. With audio.
https://github.com/AlexxIT/go2rtc/assets/29582865/b525369d-d48f-4975-ad82-da257d7575a8
To be honest, sometimes it does not play and stays like this:
https://github.com/AlexxIT/go2rtc/assets/29582865/f675139d-c40f-4370-a834-4e765386c6a2
But on go2rtc no matter what the stream won't play. Through MSE or through WebRTC.
https://github.com/AlexxIT/go2rtc/assets/29582865/aeb13f82-5960-41ea-8171-15618c76a4e9
I only see this in the logs:
If go2rtc could play this stream, my brother's camera could finally be useful for something. The camera is actually nice, it's very small and 5V. Good for internal use.
Please let me know if you have any idea, or in case you want to have access to such stream. I can provide you access.