Skip to content

Use go2rtc native streaming instead of ffmpeg#541

Merged
rroller merged 4 commits into
rroller:mainfrom
brianegge:go2rtc-native-streaming
Mar 8, 2026
Merged

Use go2rtc native streaming instead of ffmpeg#541
rroller merged 4 commits into
rroller:mainfrom
brianegge:go2rtc-native-streaming

Conversation

@brianegge

@brianegge brianegge commented Feb 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Set frontend_stream_type to StreamType.WEB_RTC on camera entities so Home Assistant uses go2rtc for camera streams instead of transcoding via ffmpeg
  • Reduces CPU usage and stream latency since go2rtc passes through the RTSP stream natively via WebRTC

Test plan

  • Deployed to a live HA instance with 16 Dahua cameras
  • HA core restart completed with no errors in logs
  • Verify camera streams load via WebRTC in the dashboard

🤖 Generated with Claude Code

brianegge and others added 4 commits February 28, 2026 06:09
Copy Dahua brand icons and logos from the home-assistant/brands
repository into custom_components/dahua/brand/ so HACS validation
no longer needs to fall back to the brands repository.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add brand assets for HACS validation
Set frontend_stream_type to WEB_RTC so Home Assistant uses go2rtc
for camera streams instead of transcoding via ffmpeg. This reduces
CPU usage and latency.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… reauth

- Fix session leak in config_flow._test_credentials() by adding finally clause
- Fix session leak on unload by calling coordinator.async_stop() which closes session
- Fix != None to is not None in _close_session()
- Replace DahuaEventThread/DahuaVtoEventThread with native async tasks
- Replace threading.Timer in VTO client with loop.call_later()
- Replace loop.stop() in VTO with disconnected future for clean reconnect
- Fix swallowed exceptions in client.stream_events() (re-raise CancelledError)
- Add reauthentication flow triggered on HTTP 401 during initialization
- Delete thread.py (no longer needed)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@brianegge brianegge force-pushed the go2rtc-native-streaming branch from 72b2586 to a07e7a7 Compare February 28, 2026 11:14
@rroller

rroller commented Mar 7, 2026

Copy link
Copy Markdown
Owner

Thanks! I'll give this a try!

@rroller rroller merged commit cfb3535 into rroller:main Mar 8, 2026
3 checks passed
@felipecrs

Copy link
Copy Markdown

This section in the README is probably outdated now:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants