Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support HLS streaming #53

Closed
wvdeadhead opened this issue Sep 21, 2022 · 13 comments
Closed

Support HLS streaming #53

wvdeadhead opened this issue Sep 21, 2022 · 13 comments
Labels
enhancement New feature or request

Comments

@wvdeadhead
Copy link

Please consider adding the capability of an HLS output for direct streaming to Google Nest Hub/Google Chromecast devices.

@calisro
Copy link

calisro commented Sep 21, 2022

But webrtc doesn't support HLS. But I stream just fine to my Nest hub and other devices using this with ffmpeg to handle any codec corrections.

@wvdeadhead
Copy link
Author

Would you mind sharing your config? I want to stream directly from go2rtc to a Nest Hub via a script. Currently, with either Dahua or Unifi cameras, there is significant video delay and no audio, although both types of cameras have supported AAC audio enabled.

My thought regarding HLS, it could be another transcoding flag and would allow for better compatibility with Chromecast devices of multiple generations.

@calisro
Copy link

calisro commented Sep 21, 2022

It depends on what codecs the camera has. If when streaming to the nest hub for example if there's no audio, then just concentrate on that part:

  kitchen_main:
    - rtsp://xxxxxx@10.100.1.133/h264Preview_01_main
    - ffmpeg:rtsp://xxxxx@10.100.1.133/h264Preview_01_main#audio=opus

That just adds the opus codec to the set of available codecs. Opus should be usable on the nest hub.

Once you have that, you can send this to your nest hub:

http://ha.local:1984/webrtc.html?src=kitchen_main

My thought regarding HLS, it could be another transcoding flag and would allow for better compatibility with Chromecast devices of multiple generations.

But HLS is already in Home Assistant as teh default. You don't need this to use HLS.

@AlexxIT AlexxIT added the enhancement New feature or request label Sep 21, 2022
@AlexxIT
Copy link
Owner

AlexxIT commented Sep 21, 2022

I don't like this format. Not suitable for real-time streaming. Maybe someday, but not in priority.

@luzik
Copy link

luzik commented Sep 23, 2022

I believe that HLS is used as live attachments to IOS notification. With HA HLS, it take few seconds to load the stream, so we believe that go2rtc could improve HA in that field :)

@AlexxIT
Copy link
Owner

AlexxIT commented Sep 23, 2022

This is not HA or go2rtc problem. HLS format was build for streaming. Not for real-time streaming. LL-HLS has some improvement with delay. But it is very complicated and not so good as WebRTC at anyway.

@wvdeadhead
Copy link
Author

Thanks for all the comments. I was hoping to use go2rtc as a "universal" conversion that interfaces with everything... like the image on the main page. No worries if HLS isn't an option, was just wishful thinking.

@calisro, I've tried configs identical to yours, with and without Opus, but no audio will play regardless. Opus doesn't seem to be a valid MP4 or HLS audio container.

As much as I love Home Assistant, it's implementation of HLS (or streaming in general) isn't the greatest. I have buffering issues and delay, unlike what I've experienced with either this or the previous project.

@AlexxIT
Copy link
Owner

AlexxIT commented Sep 23, 2022

The image on the home page shows HLS as the source. There is no lie there :)

@AlexxIT
Copy link
Owner

AlexxIT commented Jan 31, 2023

Supported in v1.1.0

@AlexxIT AlexxIT closed this as completed Jan 31, 2023
@lindsaymarkward
Copy link

Hi. This issue is the closest I can find to my current problem.
I am using a Home Assistant (HA) rich iphone message notification with a camera. It works for my other cameras not using go2rtc (Reolink and a generic IP camera with RTSP).
When I send one of my go2rtc web cameras (USB web cams on a Raspberry Pi using RTSP), I get the following error instead of the camera image:

HLS stream unavailable
Got non-200 status code (502)

go2rtc version: 1.6.2
Config looks like:

streams:
  lounge: ffmpeg:device?video=0&resolution=1280x720#video=h264

I see above that this should be supported. I would appreciate any help on this matter, thank you!

@AlexxIT
Copy link
Owner

AlexxIT commented Jul 29, 2023

I don't understand where you get this error

@lindsaymarkward
Copy link

Thanks for the reply and thanks in advance for helping :)
I see it instead on my iPhone or Apple Watch instead of the stream.
With my other cameras, I see the message text and an image from the camera. I can click on (long-press) the notification to see a live camera stream.
With my two go2rtc cameras, I get an image with this error text in red.
I've attached screenshots from my phone.

IMG_2884

IMG_2885

@AlexxIT
Copy link
Owner

AlexxIT commented Jul 30, 2023

I think this message related to Hass and not related to go2rtc. This HLS not from go2rtc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants