Skip to content

Add h264_v4l2m2m codec and profiles to HomeKit cameras#91246

Merged
bdraco merged 1 commit into
home-assistant:devfrom
shmuelzon:add_homekit_rpi_transcoding
Apr 12, 2023
Merged

Add h264_v4l2m2m codec and profiles to HomeKit cameras#91246
bdraco merged 1 commit into
home-assistant:devfrom
shmuelzon:add_homekit_rpi_transcoding

Conversation

@shmuelzon
Copy link
Copy Markdown
Contributor

@shmuelzon shmuelzon commented Apr 11, 2023

Breaking change

None that I can think of.

Proposed change

Added support for the h264_v4l2m2m codec to utilize, among others, the Raspberry Pi's hardware h.264 encoder. Unfortunately, the implementation of the Pi's encoder doesn't use the standard h.264 profile names but expects a numerical value:

$ v4l2-ctl --list-ctrls-menu -d 11
h264_profile 0x00990a6b (menu)   : min=0 max=4 default=4 value=4
             0: Baseline
             1: Constrained Baseline
             2: Main
             4: High

To support that, this commit also adds the option to override the
default profile names used when passed to the FFmpeg encoding process.

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 Black (black --fast 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.
  • Untested files have been added to .coveragerc.

To help with the load of incoming pull requests:

@home-assistant
Copy link
Copy Markdown
Contributor

Hey there @bdraco, mind taking a look at this pull request as it has been labeled with an integration (homekit) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of homekit 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 homekit Removes the current integration label and assignees on the pull request, add the integration domain after the command.

Added support for the `h264_v4l2m2m` codec to utilize, among others,
the Raspberry Pi's hardware h.264 encoder. Unfortunately, the
implementation of the Pi's encoder doesn't use the standard h.264
profile names but expects a numerical value:
  $ v4l2-ctl --list-ctrls-menu -d 11
    h264_profile 0x00990a6b (menu)   : min=0 max=4 default=4 value=4
                 0: Baseline
                 1: Constrained Baseline
                 2: Main
                 4: High
To support that, this commit also adds the option to override the
default profile names used when passed to the FFmpeg encoding process.
@shmuelzon shmuelzon force-pushed the add_homekit_rpi_transcoding branch from dad2679 to c501f85 Compare April 11, 2023 20:09
@bdraco
Copy link
Copy Markdown
Member

bdraco commented Apr 12, 2023

Looks good. Will pull it on to my production to do a quick sanity check for breakage, but I don't expect any

@bdraco bdraco added the smash Indicator this PR is close to finish for merging or closing label Apr 12, 2023
@bdraco
Copy link
Copy Markdown
Member

bdraco commented Apr 12, 2023

Testing looks good. No unexpected breakage 👍

Copy link
Copy Markdown
Member

@bdraco bdraco left a comment

Choose a reason for hiding this comment

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

Thanks @shmuelzon

@shmuelzon
Copy link
Copy Markdown
Contributor Author

Thank you @bdraco for the review!

@bdraco bdraco merged commit 7446ff4 into home-assistant:dev Apr 12, 2023
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla-signed has-tests integration: homekit new-feature Quality Scale: No score small-pr PRs with less than 30 lines. smash Indicator this PR is close to finish for merging or closing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants