-
Notifications
You must be signed in to change notification settings - Fork 101
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
New outputs API #1128
Merged
Merged
New outputs API #1128
Conversation
This file contains 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
This change exposes the next evolution of our API, letting the client manage the persistence of the user settings. This PR succeeds other ones and is exposing the following: streaming / recording / replay buffer / global settings / audio settings.
Please note that:
js/module.ts
legacy settings
is referring to the current system that manages OBS settings through NodeOBS.create
methods from the interface factories. The release and destruction of the said objects are handled in C++.bitrate
properties of a video encoder. [WARNING] There isn't a way to check for that inside the C++ code, if the client doesn't handle this correctly, it will result in the application crashing.- Stream Settings
This section is referring to the following section of the settings:
These settings are managed through the use of the
IService
interface.Getting the
legacySettings
will return the legacy settings.Setting the
legacySettings
will save the service back into the legacy system.A service needs to be associated to a streaming output to be used. The explanation on how to do this will be covered later on in this PR.
- Delay Settings
This section is referring to the following section of the settings:
These settings are managed through the use of the
IDelay
interface. They should be pretty self explanatory on what is in the UI vs typescript interface. Getting / saving the legacy settings is done through the streaming object holding the reference to it. Keep in mind that after creating this object, it needs to be associated with the streaming output in use in order to take effect.- Reconnect Settings
This section is referring to the following section of the settings:
These settings are managed through the use of the
IReconnect
interface. They should be pretty self explanatory on what is in the UI vs typescript interface. Getting / saving the legacy settings is done through the streaming object holding the reference to it. Keep in mind that after creating this object, it needs to be associated with the streaming output in use in order to take effect.- Network Settings
This section is referring to the following section of the settings:
These settings are managed through the use of the
INetwork
interface. They should be pretty self explanatory on what is in the UI vs typescript interface. Getting / saving the legacy settings is done through the streaming object holding the reference to it. Keep in mind that after creating this object, it needs to be associated with the streaming output in use in order to take effect.- Simple Streaming Output Settings
This section is referring to the following section of the settings:
These settings are managed through the use of the
ISimpleStreaming
interface.Getting / setting the
legacySettings
will return / save settings from the legacy system.The interface extends the
IStreaming
interface. Here are some explanations on what needs to be done to use it:IVideoEncoder
interface and set to the streaming output. In the simple mode, only thepreset
property is shown to the user.enforceServiceBitrate
is just a boolean setting that will force the C++ code to apply the bitrate limits from platforms before going live.signalHandler
is the way the client will register a JS callback to received signals from the output.IAudioEncoder
interface and set to the streaming output. TheAudio Bitrate
field from the screenshot is the only thing that needs to be set for this audio encoder.- Simple Recording Output Settings
This section is referring to the following section of the settings:
These settings are managed through the use of the
ISimpleRecording
interface.Getting / setting the
legacySettings
will return / save settings from the legacy system.The interface extends the
IRecording
interface. Here are some explanations on what needs to be done to use it:quality
is set toStream
. This means that the recording output will use the video and audio encoders from the streaming output. Rather than forcing the client to associate the correct encoders reference, the only thing that needs to be done is to set thestreaming
member of theISimpleRecording
interface to the Streaming interface it associates to. By doing that, the C++ code will automatically know which encoders to use. They of course need to be created and valid on the streaming side.- Simple Replay buffer Output Settings
This section is referring to the following section of the settings:
These settings are managed through the use of the
ISimpleReplayBuffer
interface.Getting / setting the
legacySettings
will return / save settings from the legacy system.The interface extends the
IReplayBuffer
interface. Here are some explanations on what needs to be done to use it:- Advanced Output Settings
I'm not gonna expend much here since the concepts are pretty similar to the Simple output explained above. The main difference is regarding the audio encoders. On this mode Audio tracks are used rather than audio encoders directly.
The
IAudioTrack
interface represents audio tracks. The C++ code has a static list of 6 audio tracks, the client responsible from creating and setting these audio tracks. In the case of the streaming output, the index to the used audio track needs to be passed, starting from 0. In the case of the recording output, the mixer value needs to be set, it is a bit mask value.- Video Settings
This section is referring to the following section of the settings:
Video tab

Advanced tab

These settings are managed through the use of the
IVideo
interface.Getting / setting the
legacySettings
will return / save settings from the legacy system.It can only be one
videoContext
set and needs to be set in order for the app to be able to run properly. Ideally it should be set directly after initializing the OBS API.- Audio Settings

This section is referring to the following section of the settings:
These settings are managed through the use of the
IAudio
interface.Getting / setting the
legacySettings
will return / save settings from the legacy system.It can only be one
audioContext
set and needs to be set in order for the app to be able to run properly. Ideally it should be set directly after initializing the OBS API.- Browser source HW acceleration

This section is referring to the following section of the settings:
2 static functions were exposed in order to manage this setting (boolean):
SetBrowserAcceleration
: sets the settings and saves it to the legacy settings automaticallyGetBrowserAccelerationLegacy
gets the legacy value- Enable media file caching

This section is referring to the following section of the settings:
2 static functions were exposed in order to manage this setting (boolean):
SetMediaFileCaching
: sets the settings and saves it to the legacy settings automaticallyGetMediaFileCachingLegacy
gets the legacy value- Process priority

This section is referring to the following section of the settings:
2 static functions were exposed in order to manage this setting (EProcessPriority):
SetProcessPriority
: sets the settings and saves it to the legacy settings automatically. The possible value are described in the following typescript enum:EProcessPriority
GetProcessPriorityLegacy
gets the legacy valueMotivation and Context
It comes from wanting to have the client manage the persistent of the settings and have a simpler to use API.
How Has This Been Tested?
Lots of manual tests with different scenarios and config to go live, recording, use the replay buffer, etc... The tests are also being migrated to use this new API as part of the PR.
Types of changes
Checklist: