Repository navigation
fix(nodes): let a transcode node be pinned to VideoToolbox #4940
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
Open
Quick104
wants to merge
3
commits into
main
Choose a base branch
from
fix/node-videotoolbox-override
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+146
−79
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -252365,6 +252365,7 @@ | |
| "qsv", | ||
| "vaapi", | ||
| "nvenc", | ||
| "videotoolbox", | ||
| "none" | ||
| ], | ||
| "type": "string" | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
migrations/sql/20261121042328_allow_videotoolbox_node_override.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| -- +goose Up | ||
| -- A node can be pinned to VideoToolbox, as the cluster-wide playback.hw_accel | ||
| -- already can: hw_accel_override takes the same values as that setting. | ||
| ALTER TABLE public.stream_nodes DROP CONSTRAINT stream_nodes_hw_accel_override_check; | ||
| ALTER TABLE public.stream_nodes | ||
| ADD CONSTRAINT stream_nodes_hw_accel_override_check | ||
| CHECK (hw_accel_override IN ('auto', 'qsv', 'vaapi', 'nvenc', 'videotoolbox', 'none')); | ||
|
|
||
| -- +goose Down | ||
| -- A node pinned to VideoToolbox goes back to inheriting the cluster setting, | ||
| -- and a field its environment declared is no longer locked to that value. | ||
| -- The table lock the ALTERs need comes first: taken after the UPDATE, it could | ||
| -- deadlock with a node's health write waiting on a row the UPDATE changed. | ||
| LOCK TABLE public.stream_nodes IN ACCESS EXCLUSIVE MODE; | ||
| UPDATE public.stream_nodes | ||
| SET hw_accel_override = NULL, | ||
| env_managed = array_remove(env_managed, 'hw_accel_override') | ||
| WHERE hw_accel_override = 'videotoolbox'; | ||
| ALTER TABLE public.stream_nodes DROP CONSTRAINT stream_nodes_hw_accel_override_check; | ||
| ALTER TABLE public.stream_nodes | ||
| ADD CONSTRAINT stream_nodes_hw_accel_override_check | ||
| CHECK (hw_accel_override IN ('auto', 'qsv', 'vaapi', 'nvenc', 'none')); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Selecting VideoToolbox silently clears an NVENC device override
Saving after switching from NVENC to VideoToolbox silently loses the hidden CUDA device override. Update
selectHWAccelOverrideto preserve the device when transitioning to or from VideoToolbox.Prompt for LLM
Talk to Kody by mentioning @kody
Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leaving this as it is. Moving from NVENC to VideoToolbox changes the device syntax, the same as moving from NVENC to QSV, which already clears the CUDA device. A VideoToolbox node takes no device, so saving null is right for that node. If the CUDA index were kept, it would carry into the next backend picked after VideoToolbox, such as VAAPI, where it means nothing. The comment on
showDeviceOverridecovers hiding the field without changing the selection, as for a Mac on Auto, and that clears nothing.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. Clearing the CUDA device override when switching from NVENC to VideoToolbox is consistent with the existing behavior for backend changes and avoids carrying an incompatible value into a later selection.
The
showDeviceOverridecomment describes a separate case: hiding the field without changing the selection preserves its value. I withdraw the suggestion; no change is needed.