mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-05-14 02:14:39 -04:00
obs-webrtc: Add Simulcast Support
This commit is contained in:
@@ -75,6 +75,13 @@ void SimpleOutput::LoadStreamingPreset_Lossy(const char *encoderId)
|
||||
if (!videoStreaming)
|
||||
throw "Failed to create video streaming encoder (simple output)";
|
||||
obs_encoder_release(videoStreaming);
|
||||
|
||||
if (whipSimulcastEncoders != nullptr) {
|
||||
whipSimulcastEncoders->Create(encoderId, config_get_int(main->Config(), "AdvOut", "RescaleFilter"),
|
||||
config_get_int(main->Config(), "Stream1", "WHIPSimulcastTotalLayers"),
|
||||
video_output_get_width(obs_get_video()),
|
||||
video_output_get_height(obs_get_video()));
|
||||
}
|
||||
}
|
||||
|
||||
/* mistakes have been made to lead us to this. */
|
||||
@@ -351,11 +358,18 @@ void SimpleOutput::Update()
|
||||
break;
|
||||
default:
|
||||
obs_encoder_set_preferred_video_format(videoStreaming, VIDEO_FORMAT_NV12);
|
||||
if (whipSimulcastEncoders != nullptr) {
|
||||
whipSimulcastEncoders->SetVideoFormat(VIDEO_FORMAT_NV12);
|
||||
}
|
||||
}
|
||||
|
||||
obs_encoder_update(videoStreaming, videoSettings);
|
||||
obs_encoder_update(audioStreaming, audioSettings);
|
||||
obs_encoder_update(audioArchive, audioSettings);
|
||||
|
||||
if (whipSimulcastEncoders != nullptr) {
|
||||
whipSimulcastEncoders->Update(videoSettings, videoBitrate);
|
||||
}
|
||||
}
|
||||
|
||||
void SimpleOutput::UpdateRecordingAudioSettings()
|
||||
@@ -630,6 +644,9 @@ std::shared_future<void> SimpleOutput::SetupStreaming(obs_service_t *service, Se
|
||||
}
|
||||
|
||||
obs_output_set_video_encoder(streamOutput, videoStreaming);
|
||||
if (whipSimulcastEncoders != nullptr) {
|
||||
whipSimulcastEncoders->SetStreamOutput(streamOutput);
|
||||
}
|
||||
obs_output_set_audio_encoder(streamOutput, audioStreaming, 0);
|
||||
obs_output_set_service(streamOutput, service);
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user