Consolidate Video Encoder Processing#1634
Open
mhoyer-streamlabs wants to merge 9 commits intostagingfrom
Open
Conversation
Move encoder processing to its own file so ensure all source files are using the same encoders/settings/logic.
…bs/obs-studio-node into mh-consolidate-encoders
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Consolidate video encoder processing into one place. Previously, encoder IDs, etc were hard coded multiple places leaving significant room for error. I created
osn-encoders.hpp/cppand included this anywhere these values are needed.encoders_set, containing encoder IDs and conversions, was renamedvideoEncoderOptionsand moved into this file. It was also updated to include additional fields -backupto cover a case where a backup encoder is needed,presetto keep Preset names in a single place, andfamilywhich is used in updating settings. Again, these values were previously hard coded multiple places. Additionally, quite a few encoders previously defaulted to obs_x264 in incomplete if/switch statements, those cases are now handled correctly. Other updates:encoders_setso those were added with the appropriate valuesvideoEncoderOptionsrather than hard coding values iniforswitchstatementsI also made some FE changes to utilize this new flow (PR coming soon). Previously, the FE would convert encoders in a couple different ways before sending them back to the BE, and this caused errors in several cases because hard coded values didn't match. Remove these conversions and allow the BE to handle all of it.
Motivation and Context
Minimize the chance of bugs stemming from encoder information being hard coded in multiple places.
How Has This Been Tested?
Tested locally with all available encoders, both recording and streaming.
Types of changes
Checklist: