Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ env:
CEF_BUILD_VERSION_WIN: '5060'
QT_VERSION_MAC: '6.4.3'
QT_VERSION_WIN: '6.4.3'
DEPS_VERSION_WIN: '2023-06-22'
DEPS_VERSION_WIN: '2023-06-28'
VLC_VERSION_WIN: '3.0.0-git'
TWITCH_CLIENTID: ${{ secrets.TWITCH_CLIENT_ID }}
TWITCH_HASH: ${{ secrets.TWITCH_HASH }}
Expand Down
56 changes: 41 additions & 15 deletions UI/window-basic-main-outputs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1456,7 +1456,7 @@ struct AdvancedOutput : BasicOutputHandler {
OBSEncoder streamAudioEnc;
OBSEncoder streamArchiveEnc;
OBSEncoder recordTrack[MAX_AUDIO_MIXES];
OBSEncoder videoStreaming;
OBSEncoder videoStreaming[3];
OBSEncoder videoRecording;

bool ffmpegOutput;
Expand Down Expand Up @@ -1619,13 +1619,25 @@ AdvancedOutput::AdvancedOutput(OBSBasic *main_) : BasicOutputHandler(main_)
}
}

videoStreaming = obs_video_encoder_create(streamEncoder,
"advanced_video_stream",
streamEncSettings, nullptr);
if (!videoStreaming)
videoStreaming[0] = obs_video_encoder_create(streamEncoder,
"advanced_video_stream_1",
streamEncSettings,
nullptr);

videoStreaming[1] = obs_video_encoder_create(streamEncoder,
"advanced_video_stream_2",
streamEncSettings,
nullptr);

videoStreaming[2] = obs_video_encoder_create(streamEncoder,
"advanced_video_stream_3",
streamEncSettings,
nullptr);

if (!videoStreaming[0])
throw "Failed to create streaming video encoder "
"(advanced output)";
obs_encoder_release(videoStreaming);
obs_encoder_release(videoStreaming[0]);

const char *rate_control = obs_data_get_string(
useStreamEncoder ? streamEncSettings : recordEncSettings,
Expand Down Expand Up @@ -1697,7 +1709,7 @@ void AdvancedOutput::UpdateStreamSettings()
config_get_string(main->Config(), "AdvOut", "Encoder");

OBSData settings = GetDataFromJsonFile("streamEncoder.json");
ApplyEncoderDefaults(settings, videoStreaming);
ApplyEncoderDefaults(settings, videoStreaming[0]);

if (applyServiceSettings) {
int bitrate = (int)obs_data_get_int(settings, "bitrate");
Expand Down Expand Up @@ -1726,11 +1738,11 @@ void AdvancedOutput::UpdateStreamSettings()
case VIDEO_FORMAT_P010:
break;
default:
obs_encoder_set_preferred_video_format(videoStreaming,
obs_encoder_set_preferred_video_format(videoStreaming[0],
VIDEO_FORMAT_NV12);
}

obs_encoder_update(videoStreaming, settings);
obs_encoder_update(videoStreaming[0], settings);
}

inline void AdvancedOutput::UpdateRecordingSettings()
Expand Down Expand Up @@ -1775,14 +1787,14 @@ inline void AdvancedOutput::SetupStreaming()
}

obs_output_set_audio_encoder(streamOutput, streamAudioEnc, 0);
obs_encoder_set_scaled_size(videoStreaming, cx, cy);
obs_encoder_set_scaled_size(videoStreaming[0], cx, cy);

const char *id = obs_service_get_id(main->GetService());
if (strcmp(id, "rtmp_custom") == 0) {
OBSDataAutoRelease settings = obs_data_create();
obs_service_apply_encoder_settings(main->GetService(), settings,
nullptr);
obs_encoder_update(videoStreaming, settings);
obs_encoder_update(videoStreaming[0], settings);
}
}

Expand Down Expand Up @@ -1821,10 +1833,18 @@ inline void AdvancedOutput::SetupRecording()
tracks = config_get_int(main->Config(), "AdvOut", "TrackIndex");

if (useStreamEncoder) {
obs_output_set_video_encoder(fileOutput, videoStreaming);
// Sean-Der
obs_encoder_set_scaled_size(videoStreaming[0], 640, 480);
obs_encoder_set_scaled_size(videoStreaming[1], 800, 600);
obs_encoder_set_scaled_size(videoStreaming[2], 1024, 768);

obs_output_set_video_encoder2(fileOutput, videoStreaming[0], 0);
obs_output_set_video_encoder2(fileOutput, videoStreaming[1], 1);
obs_output_set_video_encoder2(fileOutput, videoStreaming[2], 2);

if (replayBuffer)
obs_output_set_video_encoder(replayBuffer,
videoStreaming);
videoStreaming[0]);
} else {
if (rescale && rescaleRes && *rescaleRes) {
if (sscanf(rescaleRes, "%ux%u", &cx, &cy) != 2) {
Expand Down Expand Up @@ -2013,7 +2033,10 @@ inline void AdvancedOutput::UpdateAudioSettings()

void AdvancedOutput::SetupOutputs()
{
obs_encoder_set_video(videoStreaming, obs_get_video());
obs_encoder_set_video(videoStreaming[0], obs_get_video());
obs_encoder_set_video(videoStreaming[1], obs_get_video());
obs_encoder_set_video(videoStreaming[2], obs_get_video());

if (videoRecording)
obs_encoder_set_video(videoRecording, obs_get_video());
for (size_t i = 0; i < MAX_AUDIO_MIXES; i++)
Expand Down Expand Up @@ -2123,7 +2146,10 @@ bool AdvancedOutput::SetupStreaming(obs_service_t *service)
outputType = type;
}

obs_output_set_video_encoder(streamOutput, videoStreaming);
obs_output_set_video_encoder2(streamOutput, videoStreaming[0], 0);
obs_output_set_video_encoder2(streamOutput, videoStreaming[1], 1);
obs_output_set_video_encoder2(streamOutput, videoStreaming[2], 2);

obs_output_set_audio_encoder(streamOutput, streamAudioEnc, 0);

return true;
Expand Down
22 changes: 11 additions & 11 deletions buildspec.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
{
"dependencies": {
"prebuilt": {
"version": "2023-06-22",
"baseUrl": "https://github.com/obsproject/obs-deps/releases/download",
"version": "2023-06-28",
"baseUrl": "https://github.com/Sean-Der/obs-deps/releases/download",
"label": "Pre-Built obs-deps",
"hashes": {
"macos-universal": "a0d2e03f0ea79681634c31627430a220d9b62113d6ff58174d0bdab6fafdd32b",
"windows-x64": "1b12e86e2d62a97a889866d66b95fe47ddc6f7fa9b13e88aedfab4ea9e298ea2",
"windows-x86": "8c6bfda01ec7d38a50a61ac4954dc00d6fcb171830a7f32593c5bd20a44be3a9",
"linux-x86_64": "1b82ab4247bc2730ae84caa5a009e76637eac77b05bfb4b4a2bae610e7a75262"
"macos-universal": "3118c8f99cd6a862ed1316b0098f03c5293957c28b1137bf4260723d0eb7acc5",
"windows-x64": "58d73e33da1eaf2bf9855f630ff123c595cd759dc815bc7b29c50500a0fa26b0",
"windows-x86": "bf22ccd72a5d1537ab056d5a986daca0e4a6d4444a5e32a18314220bdfcdae65",
"linux-x86_64": "a1a4a42ee35010e492cf4431bfeb9c1df7b12692456bf12516158efa59dbae73"
}
},
"qt6": {
"version": "2023-06-22",
"baseUrl": "https://github.com/obsproject/obs-deps/releases/download",
"version": "2023-06-28",
"baseUrl": "https://github.com/Sean-Der/obs-deps/releases/download",
"label": "Pre-Built Qt6",
"hashes": {
"macos-universal": "f890d258a1afa7ba409b79c8ee55d53155e5c72105b8b18a3f52047ee70fc0aa",
"windows-x64": "1907fbcbcef69527154b29316c425b0885afb77ad69a9a2af7a1471d79512195"
"macos-universal": "11f4da10dc98effce8012be31dd790ef508ba2780906946ed52eb835ed5530dd",
"windows-x64": "96e5c91c1febf092bbb938c825425c13b513da6e1f006eff7e278402e51254d8"
},
"debugSymbols": {
"windows-x64": "b461a7ade0c099505baea857fa5b98c4f8e9b702681be019ea354735d062e065"
"windows-x64": "af1b4958ad8e005f9ae507d35f61dd72fc7b2278fc6958afb4118fbd4769a9e4"
}
},
"cef": {
Expand Down
Loading