WebRTC: Cannot stream with DashCast

When I attempt to stream with WebRTC Camera: DashCast, the Google Home Display comes up with the DashCast logo and then just goes to a blank black screen. I enabled debug logging, but the only message generated is: DEBUG (SyncWorker_6) [custom_components.webrtc.utils] DashCast to media_player.office_display.

I’ve attempted to cast to a Nest Home Display as well as an nVidia Shield; both act the same. I can cast to these device using the native Home Assistant camera devices through the cloud Google Assistant path, and casting other pages using DashCast seems to be working.

I’ve tested using my own RTSP feed as well as the Big Buck Bunny version and neither work.

Is there any other debugging that I can do to figure out why I’m not able to cast an RTSP stream using WebRTC Camera: DashCast?

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 3
  • Comments: 61 (12 by maintainers)

Commits related to this issue

Most upvoted comments

@atv2016 ah far out thanks mate, I used the GUI option to force but when I checked the yaml it wasn’t there, working again now!

@AlexxIT Hey Alex thanks for you help, the issue was fixed by the force option but I had to write it into the yaml, the GUI checkbox option in the automation didnt work (it was still checked) but nothing in the yaml. Setting my yaml to below worked.

service: webrtc.dash_cast
data:
  url: rtsp://frigateip:8554/Driveway_sub
  entity_id: media_player.nesthubmax
  force: true
enabled: true

Thanks again for a great integration

Any news on this issue?

Ahh… @AlexxIT, I believe I found the issue. I spun up a development version of the dashcast service and found that from:

https://github.com/AlexxIT/WebRTC/blob/358d4c27cfd2db974891786a3446a5e686567f5c/custom_components/webrtc/www/index.html#L22

when loading through DashCast, the referrer is getting set to to the DashCast URL. In my case, https://bekriebel.github.io/dashcast/receiver.html. Because of this,

https://github.com/AlexxIT/WebRTC/blob/358d4c27cfd2db974891786a3446a5e686567f5c/custom_components/webrtc/www/index.html#L28

can’t find the url or entity values and you get the error

Uncaught Error: Missing `url` or `entity`
    at HTMLElement.setConfig (VM19 webrtc-camera.js:605)
    at embed?url=test2021061005:39

Changing line 22 of index.html to const url = window.location; makes the dashcast service work exactly as expected, as well as makes a URL generated by the Create Link service work properly. Is there any reason the referrer was being captured in this? I’m not sure why that would be desired.

I’ll submit a PR in a moment if that is an okay change.

You are right. I was able get casting working using the built-in play_media service (bit of a delay but decent enough for now):

  - service: media_player.play_media
    data:
      media_content_type: image
      media_content_id: >-
        http://[LOCAL IP]:1984/api/stream.mp4?src=camera.front_door_camera
    target:
      entity_id: media_player.nesthub

All of you can try to use https://stestagg.github.io/dashcast/ service and cast stream.html page from your go2rtc WebUI.

I got the DashCast logo with a subtext that says: “Loading: http://[private ip]:1984/stream.html?src=camera.front_door_camera”

That same url works well in my browser.

I also tested using the hostname (same results). And I tested with and without “Force display” - but that didn’t help either (just displayed a never-ending loading circle).

Edit to add context: I am using a Google Nest Hub 2nd gen (System firmware version: 324896; Cast firmware: 1.56.324896)

@ahaverty and @AlexxIT I think this might be useful. I tested dashcast from the same instance of Home Assistance and casted the same stream to a Google Hub gen 1 and a Google Hub gen 2. Then gen 1 cast works 100% of the time, but the gen 2 did not work any single time, everything else being equal for both devices and HA instance, same network, same config, etc.

Lovelace cast takes ages, so keen to try this dash cast. Still looking for a fix please.

the issue still persist 😃