Skip to content

Conversation

edenhaus
Copy link
Member

@edenhaus edenhaus commented Jul 15, 2025

Breaking change

Proposed change

Add support for stream orientation in go2rtc. Cannot use metadata like the stream integration does, as WebRTC and other go2rtc functionality do not support this.
Therefore added a warning in the description text (frontend) so the user is informed

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.

To help with the load of incoming pull requests:

@home-assistant
Copy link

Hey there @home-assistant/core, mind taking a look at this pull request as it has been labeled with an integration (go2rtc) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of go2rtc can trigger bot actions by commenting:

  • @home-assistant close Closes the pull request.
  • @home-assistant rename Awesome new title Renames the pull request.
  • @home-assistant reopen Reopen the pull request.
  • @home-assistant unassign go2rtc Removes the current integration label and assignees on the pull request, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the pull request.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the pull request.

@home-assistant
Copy link

Hey there @home-assistant/core, mind taking a look at this pull request as it has been labeled with an integration (camera) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of camera can trigger bot actions by commenting:

  • @home-assistant close Closes the pull request.
  • @home-assistant rename Awesome new title Renames the pull request.
  • @home-assistant reopen Reopen the pull request.
  • @home-assistant unassign camera Removes the current integration label and assignees on the pull request, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the pull request.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the pull request.

@edenhaus edenhaus changed the title WIP: Add support for stream orientation in go2rtc Add support for stream orientation in go2rtc Aug 20, 2025
@edenhaus edenhaus marked this pull request as ready for review August 20, 2025 08:45
@Copilot Copilot AI review requested due to automatic review settings August 20, 2025 08:45
@edenhaus edenhaus requested a review from a team as a code owner August 20, 2025 08:45
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for stream orientation transformations in the go2rtc integration by implementing FFmpeg video filters based on user-configured camera orientation settings. Since WebRTC and other go2rtc functionalities don't support metadata-based orientation, the solution applies orientation transforms at the stream level using FFmpeg filters.

Key changes:

  • Added helper function for retrieving dynamic camera stream settings across integrations
  • Implemented orientation-specific FFmpeg filter application in go2rtc WebRTC provider
  • Added comprehensive test coverage for all orientation transformations

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
homeassistant/components/camera/helper.py Added get_dynamic_camera_stream_settings helper function for cross-integration access
homeassistant/components/camera/__init__.py Refactored to use the new helper function instead of direct data access
homeassistant/components/go2rtc/__init__.py Implemented orientation transformation logic using FFmpeg filters in the WebRTC provider
tests/components/camera/test_helper.py Added comprehensive tests for the new helper function
tests/components/go2rtc/test_init.py Added extensive test coverage for orientation handling in both WebRTC and image retrieval scenarios

@edenhaus edenhaus added this to the 2025.8.3 milestone Aug 20, 2025
@edenhaus edenhaus removed this from the 2025.8.3 milestone Aug 21, 2025
@home-assistant home-assistant bot marked this pull request as draft August 26, 2025 14:40
@home-assistant
Copy link

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

@edenhaus edenhaus marked this pull request as ready for review August 29, 2025 13:38
@home-assistant home-assistant bot requested a review from abmantis August 29, 2025 13:38
@edenhaus
Copy link
Member Author

edenhaus commented Sep 1, 2025

Test failure unrelated

@abmantis abmantis merged commit 0865d3f into dev Sep 1, 2025
43 of 44 checks passed
@abmantis abmantis deleted the edenhaus-go2rtc-orientation branch September 1, 2025 18:06
@github-actions github-actions bot locked and limited conversation to collaborators Sep 2, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Camera stream orentation is ignored on WebRTC streams
2 participants