|
@@ -261,10 +261,10 @@ bool BasicOutputHandler::VirtualCamActive() const
|
|
|
|
|
|
struct SimpleOutput : BasicOutputHandler {
|
|
struct SimpleOutput : BasicOutputHandler {
|
|
OBSEncoder aacStreaming;
|
|
OBSEncoder aacStreaming;
|
|
- OBSEncoder h264Streaming;
|
|
|
|
|
|
+ OBSEncoder videoStreaming;
|
|
OBSEncoder aacRecording;
|
|
OBSEncoder aacRecording;
|
|
OBSEncoder aacArchive;
|
|
OBSEncoder aacArchive;
|
|
- OBSEncoder h264Recording;
|
|
|
|
|
|
+ OBSEncoder videoRecording;
|
|
|
|
|
|
string aacRecEncID;
|
|
string aacRecEncID;
|
|
string aacStreamEncID;
|
|
string aacStreamEncID;
|
|
@@ -293,11 +293,11 @@ struct SimpleOutput : BasicOutputHandler {
|
|
void SetupOutputs() override;
|
|
void SetupOutputs() override;
|
|
int GetAudioBitrate() const;
|
|
int GetAudioBitrate() const;
|
|
|
|
|
|
- void LoadRecordingPreset_h264(const char *encoder);
|
|
|
|
|
|
+ void LoadRecordingPreset_Lossy(const char *encoder);
|
|
void LoadRecordingPreset_Lossless();
|
|
void LoadRecordingPreset_Lossless();
|
|
void LoadRecordingPreset();
|
|
void LoadRecordingPreset();
|
|
|
|
|
|
- void LoadStreamingPreset_h264(const char *encoder);
|
|
|
|
|
|
+ void LoadStreamingPreset_Lossy(const char *encoder);
|
|
|
|
|
|
void UpdateRecording();
|
|
void UpdateRecording();
|
|
bool ConfigureRecording(bool useReplayBuffer);
|
|
bool ConfigureRecording(bool useReplayBuffer);
|
|
@@ -334,22 +334,22 @@ void SimpleOutput::LoadRecordingPreset_Lossless()
|
|
obs_output_update(fileOutput, settings);
|
|
obs_output_update(fileOutput, settings);
|
|
}
|
|
}
|
|
|
|
|
|
-void SimpleOutput::LoadRecordingPreset_h264(const char *encoderId)
|
|
|
|
|
|
+void SimpleOutput::LoadRecordingPreset_Lossy(const char *encoderId)
|
|
{
|
|
{
|
|
- h264Recording = obs_video_encoder_create(
|
|
|
|
- encoderId, "simple_h264_recording", nullptr, nullptr);
|
|
|
|
- if (!h264Recording)
|
|
|
|
- throw "Failed to create h264 recording encoder (simple output)";
|
|
|
|
- obs_encoder_release(h264Recording);
|
|
|
|
|
|
+ videoRecording = obs_video_encoder_create(
|
|
|
|
+ encoderId, "simple_video_recording", nullptr, nullptr);
|
|
|
|
+ if (!videoRecording)
|
|
|
|
+ throw "Failed to create video recording encoder (simple output)";
|
|
|
|
+ obs_encoder_release(videoRecording);
|
|
}
|
|
}
|
|
|
|
|
|
-void SimpleOutput::LoadStreamingPreset_h264(const char *encoderId)
|
|
|
|
|
|
+void SimpleOutput::LoadStreamingPreset_Lossy(const char *encoderId)
|
|
{
|
|
{
|
|
- h264Streaming = obs_video_encoder_create(
|
|
|
|
- encoderId, "simple_h264_stream", nullptr, nullptr);
|
|
|
|
- if (!h264Streaming)
|
|
|
|
- throw "Failed to create h264 streaming encoder (simple output)";
|
|
|
|
- obs_encoder_release(h264Streaming);
|
|
|
|
|
|
+ videoStreaming = obs_video_encoder_create(
|
|
|
|
+ encoderId, "simple_video_stream", nullptr, nullptr);
|
|
|
|
+ if (!videoStreaming)
|
|
|
|
+ throw "Failed to create video streaming encoder (simple output)";
|
|
|
|
+ obs_encoder_release(videoStreaming);
|
|
}
|
|
}
|
|
|
|
|
|
void SimpleOutput::LoadRecordingPreset()
|
|
void SimpleOutput::LoadRecordingPreset()
|
|
@@ -364,7 +364,7 @@ void SimpleOutput::LoadRecordingPreset()
|
|
ffmpegOutput = false;
|
|
ffmpegOutput = false;
|
|
|
|
|
|
if (strcmp(quality, "Stream") == 0) {
|
|
if (strcmp(quality, "Stream") == 0) {
|
|
- h264Recording = h264Streaming;
|
|
|
|
|
|
+ videoRecording = videoStreaming;
|
|
aacRecording = aacStreaming;
|
|
aacRecording = aacStreaming;
|
|
usingRecordingPreset = false;
|
|
usingRecordingPreset = false;
|
|
return;
|
|
return;
|
|
@@ -379,19 +379,19 @@ void SimpleOutput::LoadRecordingPreset()
|
|
lowCPUx264 = false;
|
|
lowCPUx264 = false;
|
|
|
|
|
|
if (strcmp(encoder, SIMPLE_ENCODER_X264) == 0) {
|
|
if (strcmp(encoder, SIMPLE_ENCODER_X264) == 0) {
|
|
- LoadRecordingPreset_h264("obs_x264");
|
|
|
|
|
|
+ LoadRecordingPreset_Lossy("obs_x264");
|
|
} else if (strcmp(encoder, SIMPLE_ENCODER_X264_LOWCPU) == 0) {
|
|
} else if (strcmp(encoder, SIMPLE_ENCODER_X264_LOWCPU) == 0) {
|
|
- LoadRecordingPreset_h264("obs_x264");
|
|
|
|
|
|
+ LoadRecordingPreset_Lossy("obs_x264");
|
|
lowCPUx264 = true;
|
|
lowCPUx264 = true;
|
|
} else if (strcmp(encoder, SIMPLE_ENCODER_QSV) == 0) {
|
|
} else if (strcmp(encoder, SIMPLE_ENCODER_QSV) == 0) {
|
|
- LoadRecordingPreset_h264("obs_qsv11");
|
|
|
|
|
|
+ LoadRecordingPreset_Lossy("obs_qsv11");
|
|
} else if (strcmp(encoder, SIMPLE_ENCODER_AMD) == 0) {
|
|
} else if (strcmp(encoder, SIMPLE_ENCODER_AMD) == 0) {
|
|
- LoadRecordingPreset_h264("amd_amf_h264");
|
|
|
|
|
|
+ LoadRecordingPreset_Lossy("amd_amf_h264");
|
|
} else if (strcmp(encoder, SIMPLE_ENCODER_NVENC) == 0) {
|
|
} else if (strcmp(encoder, SIMPLE_ENCODER_NVENC) == 0) {
|
|
const char *id = EncoderAvailable("jim_nvenc")
|
|
const char *id = EncoderAvailable("jim_nvenc")
|
|
? "jim_nvenc"
|
|
? "jim_nvenc"
|
|
: "ffmpeg_nvenc";
|
|
: "ffmpeg_nvenc";
|
|
- LoadRecordingPreset_h264(id);
|
|
|
|
|
|
+ LoadRecordingPreset_Lossy(id);
|
|
}
|
|
}
|
|
usingRecordingPreset = true;
|
|
usingRecordingPreset = true;
|
|
|
|
|
|
@@ -410,18 +410,18 @@ SimpleOutput::SimpleOutput(OBSBasic *main_) : BasicOutputHandler(main_)
|
|
"StreamEncoder");
|
|
"StreamEncoder");
|
|
|
|
|
|
if (strcmp(encoder, SIMPLE_ENCODER_QSV) == 0) {
|
|
if (strcmp(encoder, SIMPLE_ENCODER_QSV) == 0) {
|
|
- LoadStreamingPreset_h264("obs_qsv11");
|
|
|
|
|
|
+ LoadStreamingPreset_Lossy("obs_qsv11");
|
|
|
|
|
|
} else if (strcmp(encoder, SIMPLE_ENCODER_AMD) == 0) {
|
|
} else if (strcmp(encoder, SIMPLE_ENCODER_AMD) == 0) {
|
|
- LoadStreamingPreset_h264("amd_amf_h264");
|
|
|
|
|
|
+ LoadStreamingPreset_Lossy("amd_amf_h264");
|
|
|
|
|
|
} else if (strcmp(encoder, SIMPLE_ENCODER_NVENC) == 0) {
|
|
} else if (strcmp(encoder, SIMPLE_ENCODER_NVENC) == 0) {
|
|
const char *id = EncoderAvailable("jim_nvenc") ? "jim_nvenc"
|
|
const char *id = EncoderAvailable("jim_nvenc") ? "jim_nvenc"
|
|
: "ffmpeg_nvenc";
|
|
: "ffmpeg_nvenc";
|
|
- LoadStreamingPreset_h264(id);
|
|
|
|
|
|
+ LoadStreamingPreset_Lossy(id);
|
|
|
|
|
|
} else {
|
|
} else {
|
|
- LoadStreamingPreset_h264("obs_x264");
|
|
|
|
|
|
+ LoadStreamingPreset_Lossy("obs_x264");
|
|
}
|
|
}
|
|
|
|
|
|
if (!CreateAACEncoder(aacStreaming, aacStreamEncID, GetAudioBitrate(),
|
|
if (!CreateAACEncoder(aacStreaming, aacStreamEncID, GetAudioBitrate(),
|
|
@@ -492,7 +492,7 @@ int SimpleOutput::GetAudioBitrate() const
|
|
|
|
|
|
void SimpleOutput::Update()
|
|
void SimpleOutput::Update()
|
|
{
|
|
{
|
|
- OBSDataAutoRelease h264Settings = obs_data_create();
|
|
|
|
|
|
+ OBSDataAutoRelease videoSettings = obs_data_create();
|
|
OBSDataAutoRelease aacSettings = obs_data_create();
|
|
OBSDataAutoRelease aacSettings = obs_data_create();
|
|
|
|
|
|
int videoBitrate =
|
|
int videoBitrate =
|
|
@@ -514,7 +514,7 @@ void SimpleOutput::Update()
|
|
|
|
|
|
} else if (strcmp(encoder, SIMPLE_ENCODER_AMD) == 0) {
|
|
} else if (strcmp(encoder, SIMPLE_ENCODER_AMD) == 0) {
|
|
presetType = "AMDPreset";
|
|
presetType = "AMDPreset";
|
|
- UpdateStreamingSettings_amd(h264Settings, videoBitrate);
|
|
|
|
|
|
+ UpdateStreamingSettings_amd(videoSettings, videoBitrate);
|
|
|
|
|
|
} else if (strcmp(encoder, SIMPLE_ENCODER_NVENC) == 0) {
|
|
} else if (strcmp(encoder, SIMPLE_ENCODER_NVENC) == 0) {
|
|
presetType = "NVENCPreset";
|
|
presetType = "NVENCPreset";
|
|
@@ -525,22 +525,22 @@ void SimpleOutput::Update()
|
|
|
|
|
|
preset = config_get_string(main->Config(), "SimpleOutput", presetType);
|
|
preset = config_get_string(main->Config(), "SimpleOutput", presetType);
|
|
|
|
|
|
- obs_data_set_string(h264Settings, "rate_control", "CBR");
|
|
|
|
- obs_data_set_int(h264Settings, "bitrate", videoBitrate);
|
|
|
|
|
|
+ obs_data_set_string(videoSettings, "rate_control", "CBR");
|
|
|
|
+ obs_data_set_int(videoSettings, "bitrate", videoBitrate);
|
|
|
|
|
|
if (advanced) {
|
|
if (advanced) {
|
|
- obs_data_set_string(h264Settings, "preset", preset);
|
|
|
|
- obs_data_set_string(h264Settings, "x264opts", custom);
|
|
|
|
|
|
+ obs_data_set_string(videoSettings, "preset", preset);
|
|
|
|
+ obs_data_set_string(videoSettings, "x264opts", custom);
|
|
}
|
|
}
|
|
|
|
|
|
obs_data_set_string(aacSettings, "rate_control", "CBR");
|
|
obs_data_set_string(aacSettings, "rate_control", "CBR");
|
|
obs_data_set_int(aacSettings, "bitrate", audioBitrate);
|
|
obs_data_set_int(aacSettings, "bitrate", audioBitrate);
|
|
|
|
|
|
- obs_service_apply_encoder_settings(main->GetService(), h264Settings,
|
|
|
|
|
|
+ obs_service_apply_encoder_settings(main->GetService(), videoSettings,
|
|
aacSettings);
|
|
aacSettings);
|
|
|
|
|
|
if (!enforceBitrate) {
|
|
if (!enforceBitrate) {
|
|
- obs_data_set_int(h264Settings, "bitrate", videoBitrate);
|
|
|
|
|
|
+ obs_data_set_int(videoSettings, "bitrate", videoBitrate);
|
|
obs_data_set_int(aacSettings, "bitrate", audioBitrate);
|
|
obs_data_set_int(aacSettings, "bitrate", audioBitrate);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -554,11 +554,11 @@ void SimpleOutput::Update()
|
|
case VIDEO_FORMAT_P010:
|
|
case VIDEO_FORMAT_P010:
|
|
break;
|
|
break;
|
|
default:
|
|
default:
|
|
- obs_encoder_set_preferred_video_format(h264Streaming,
|
|
|
|
|
|
+ obs_encoder_set_preferred_video_format(videoStreaming,
|
|
VIDEO_FORMAT_NV12);
|
|
VIDEO_FORMAT_NV12);
|
|
}
|
|
}
|
|
|
|
|
|
- obs_encoder_update(h264Streaming, h264Settings);
|
|
|
|
|
|
+ obs_encoder_update(videoStreaming, videoSettings);
|
|
obs_encoder_update(aacStreaming, aacSettings);
|
|
obs_encoder_update(aacStreaming, aacSettings);
|
|
obs_encoder_update(aacArchive, aacSettings);
|
|
obs_encoder_update(aacArchive, aacSettings);
|
|
}
|
|
}
|
|
@@ -602,7 +602,7 @@ void SimpleOutput::UpdateRecordingSettings_x264_crf(int crf)
|
|
obs_data_set_string(settings, "preset",
|
|
obs_data_set_string(settings, "preset",
|
|
lowCPUx264 ? "ultrafast" : "veryfast");
|
|
lowCPUx264 ? "ultrafast" : "veryfast");
|
|
|
|
|
|
- obs_encoder_update(h264Recording, settings);
|
|
|
|
|
|
+ obs_encoder_update(videoRecording, settings);
|
|
}
|
|
}
|
|
|
|
|
|
static bool icq_available(obs_encoder_t *encoder)
|
|
static bool icq_available(obs_encoder_t *encoder)
|
|
@@ -626,7 +626,7 @@ static bool icq_available(obs_encoder_t *encoder)
|
|
|
|
|
|
void SimpleOutput::UpdateRecordingSettings_qsv11(int crf)
|
|
void SimpleOutput::UpdateRecordingSettings_qsv11(int crf)
|
|
{
|
|
{
|
|
- bool icq = icq_available(h264Recording);
|
|
|
|
|
|
+ bool icq = icq_available(videoRecording);
|
|
|
|
|
|
OBSDataAutoRelease settings = obs_data_create();
|
|
OBSDataAutoRelease settings = obs_data_create();
|
|
obs_data_set_string(settings, "profile", "high");
|
|
obs_data_set_string(settings, "profile", "high");
|
|
@@ -641,7 +641,7 @@ void SimpleOutput::UpdateRecordingSettings_qsv11(int crf)
|
|
obs_data_set_int(settings, "qpb", crf);
|
|
obs_data_set_int(settings, "qpb", crf);
|
|
}
|
|
}
|
|
|
|
|
|
- obs_encoder_update(h264Recording, settings);
|
|
|
|
|
|
+ obs_encoder_update(videoRecording, settings);
|
|
}
|
|
}
|
|
|
|
|
|
void SimpleOutput::UpdateRecordingSettings_nvenc(int cqp)
|
|
void SimpleOutput::UpdateRecordingSettings_nvenc(int cqp)
|
|
@@ -652,7 +652,7 @@ void SimpleOutput::UpdateRecordingSettings_nvenc(int cqp)
|
|
obs_data_set_string(settings, "preset", "hq");
|
|
obs_data_set_string(settings, "preset", "hq");
|
|
obs_data_set_int(settings, "cqp", cqp);
|
|
obs_data_set_int(settings, "cqp", cqp);
|
|
|
|
|
|
- obs_encoder_update(h264Recording, settings);
|
|
|
|
|
|
+ obs_encoder_update(videoRecording, settings);
|
|
}
|
|
}
|
|
|
|
|
|
void SimpleOutput::UpdateStreamingSettings_amd(obs_data_t *settings,
|
|
void SimpleOutput::UpdateStreamingSettings_amd(obs_data_t *settings,
|
|
@@ -695,7 +695,7 @@ void SimpleOutput::UpdateRecordingSettings_amd_cqp(int cqp)
|
|
obs_data_set_int(settings, "BFrame.Pattern", 0);
|
|
obs_data_set_int(settings, "BFrame.Pattern", 0);
|
|
|
|
|
|
// Update and release
|
|
// Update and release
|
|
- obs_encoder_update(h264Recording, settings);
|
|
|
|
|
|
+ obs_encoder_update(videoRecording, settings);
|
|
}
|
|
}
|
|
|
|
|
|
void SimpleOutput::UpdateRecordingSettings()
|
|
void SimpleOutput::UpdateRecordingSettings()
|
|
@@ -721,7 +721,7 @@ void SimpleOutput::UpdateRecordingSettings()
|
|
inline void SimpleOutput::SetupOutputs()
|
|
inline void SimpleOutput::SetupOutputs()
|
|
{
|
|
{
|
|
SimpleOutput::Update();
|
|
SimpleOutput::Update();
|
|
- obs_encoder_set_video(h264Streaming, obs_get_video());
|
|
|
|
|
|
+ obs_encoder_set_video(videoStreaming, obs_get_video());
|
|
obs_encoder_set_audio(aacStreaming, obs_get_audio());
|
|
obs_encoder_set_audio(aacStreaming, obs_get_audio());
|
|
obs_encoder_set_audio(aacArchive, obs_get_audio());
|
|
obs_encoder_set_audio(aacArchive, obs_get_audio());
|
|
|
|
|
|
@@ -730,7 +730,7 @@ inline void SimpleOutput::SetupOutputs()
|
|
obs_output_set_media(fileOutput, obs_get_video(),
|
|
obs_output_set_media(fileOutput, obs_get_video(),
|
|
obs_get_audio());
|
|
obs_get_audio());
|
|
} else {
|
|
} else {
|
|
- obs_encoder_set_video(h264Recording, obs_get_video());
|
|
|
|
|
|
+ obs_encoder_set_video(videoRecording, obs_get_video());
|
|
obs_encoder_set_audio(aacRecording, obs_get_audio());
|
|
obs_encoder_set_audio(aacRecording, obs_get_audio());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -842,7 +842,7 @@ bool SimpleOutput::SetupStreaming(obs_service_t *service)
|
|
outputType = type;
|
|
outputType = type;
|
|
}
|
|
}
|
|
|
|
|
|
- obs_output_set_video_encoder(streamOutput, h264Streaming);
|
|
|
|
|
|
+ obs_output_set_video_encoder(streamOutput, videoStreaming);
|
|
obs_output_set_audio_encoder(streamOutput, aacStreaming, 0);
|
|
obs_output_set_audio_encoder(streamOutput, aacStreaming, 0);
|
|
obs_output_set_service(streamOutput, service);
|
|
obs_output_set_service(streamOutput, service);
|
|
return true;
|
|
return true;
|
|
@@ -964,11 +964,11 @@ void SimpleOutput::UpdateRecording()
|
|
SetupOutputs();
|
|
SetupOutputs();
|
|
|
|
|
|
if (!ffmpegOutput) {
|
|
if (!ffmpegOutput) {
|
|
- obs_output_set_video_encoder(fileOutput, h264Recording);
|
|
|
|
|
|
+ obs_output_set_video_encoder(fileOutput, videoRecording);
|
|
obs_output_set_audio_encoder(fileOutput, aacRecording, 0);
|
|
obs_output_set_audio_encoder(fileOutput, aacRecording, 0);
|
|
}
|
|
}
|
|
if (replayBuffer) {
|
|
if (replayBuffer) {
|
|
- obs_output_set_video_encoder(replayBuffer, h264Recording);
|
|
|
|
|
|
+ obs_output_set_video_encoder(replayBuffer, videoRecording);
|
|
obs_output_set_audio_encoder(replayBuffer, aacRecording, 0);
|
|
obs_output_set_audio_encoder(replayBuffer, aacRecording, 0);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1114,8 +1114,8 @@ struct AdvancedOutput : BasicOutputHandler {
|
|
OBSEncoder streamAudioEnc;
|
|
OBSEncoder streamAudioEnc;
|
|
OBSEncoder streamArchiveEnc;
|
|
OBSEncoder streamArchiveEnc;
|
|
OBSEncoder aacTrack[MAX_AUDIO_MIXES];
|
|
OBSEncoder aacTrack[MAX_AUDIO_MIXES];
|
|
- OBSEncoder h264Streaming;
|
|
|
|
- OBSEncoder h264Recording;
|
|
|
|
|
|
+ OBSEncoder videoStreaming;
|
|
|
|
+ OBSEncoder videoRecording;
|
|
|
|
|
|
bool ffmpegOutput;
|
|
bool ffmpegOutput;
|
|
bool ffmpegRecording;
|
|
bool ffmpegRecording;
|
|
@@ -1263,22 +1263,23 @@ AdvancedOutput::AdvancedOutput(OBSBasic *main_) : BasicOutputHandler(main_)
|
|
"(advanced output)";
|
|
"(advanced output)";
|
|
|
|
|
|
if (!useStreamEncoder) {
|
|
if (!useStreamEncoder) {
|
|
- h264Recording = obs_video_encoder_create(
|
|
|
|
- recordEncoder, "recording_h264",
|
|
|
|
|
|
+ videoRecording = obs_video_encoder_create(
|
|
|
|
+ recordEncoder, "advanced_video_recording",
|
|
recordEncSettings, nullptr);
|
|
recordEncSettings, nullptr);
|
|
- if (!h264Recording)
|
|
|
|
- throw "Failed to create recording h264 "
|
|
|
|
|
|
+ if (!videoRecording)
|
|
|
|
+ throw "Failed to create recording video "
|
|
"encoder (advanced output)";
|
|
"encoder (advanced output)";
|
|
- obs_encoder_release(h264Recording);
|
|
|
|
|
|
+ obs_encoder_release(videoRecording);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- h264Streaming = obs_video_encoder_create(
|
|
|
|
- streamEncoder, "streaming_h264", streamEncSettings, nullptr);
|
|
|
|
- if (!h264Streaming)
|
|
|
|
- throw "Failed to create streaming h264 encoder "
|
|
|
|
|
|
+ videoStreaming = obs_video_encoder_create(streamEncoder,
|
|
|
|
+ "advanced_video_stream",
|
|
|
|
+ streamEncSettings, nullptr);
|
|
|
|
+ if (!videoStreaming)
|
|
|
|
+ throw "Failed to create streaming video encoder "
|
|
"(advanced output)";
|
|
"(advanced output)";
|
|
- obs_encoder_release(h264Streaming);
|
|
|
|
|
|
+ obs_encoder_release(videoStreaming);
|
|
|
|
|
|
const char *rate_control = obs_data_get_string(
|
|
const char *rate_control = obs_data_get_string(
|
|
useStreamEncoder ? streamEncSettings : recordEncSettings,
|
|
useStreamEncoder ? streamEncSettings : recordEncSettings,
|
|
@@ -1337,7 +1338,7 @@ void AdvancedOutput::UpdateStreamSettings()
|
|
config_get_string(main->Config(), "AdvOut", "Encoder");
|
|
config_get_string(main->Config(), "AdvOut", "Encoder");
|
|
|
|
|
|
OBSData settings = GetDataFromJsonFile("streamEncoder.json");
|
|
OBSData settings = GetDataFromJsonFile("streamEncoder.json");
|
|
- ApplyEncoderDefaults(settings, h264Streaming);
|
|
|
|
|
|
+ ApplyEncoderDefaults(settings, videoStreaming);
|
|
|
|
|
|
if (applyServiceSettings) {
|
|
if (applyServiceSettings) {
|
|
int bitrate = (int)obs_data_get_int(settings, "bitrate");
|
|
int bitrate = (int)obs_data_get_int(settings, "bitrate");
|
|
@@ -1366,17 +1367,17 @@ void AdvancedOutput::UpdateStreamSettings()
|
|
case VIDEO_FORMAT_P010:
|
|
case VIDEO_FORMAT_P010:
|
|
break;
|
|
break;
|
|
default:
|
|
default:
|
|
- obs_encoder_set_preferred_video_format(h264Streaming,
|
|
|
|
|
|
+ obs_encoder_set_preferred_video_format(videoStreaming,
|
|
VIDEO_FORMAT_NV12);
|
|
VIDEO_FORMAT_NV12);
|
|
}
|
|
}
|
|
|
|
|
|
- obs_encoder_update(h264Streaming, settings);
|
|
|
|
|
|
+ obs_encoder_update(videoStreaming, settings);
|
|
}
|
|
}
|
|
|
|
|
|
inline void AdvancedOutput::UpdateRecordingSettings()
|
|
inline void AdvancedOutput::UpdateRecordingSettings()
|
|
{
|
|
{
|
|
OBSData settings = GetDataFromJsonFile("recordEncoder.json");
|
|
OBSData settings = GetDataFromJsonFile("recordEncoder.json");
|
|
- obs_encoder_update(h264Recording, settings);
|
|
|
|
|
|
+ obs_encoder_update(videoRecording, settings);
|
|
}
|
|
}
|
|
|
|
|
|
void AdvancedOutput::Update()
|
|
void AdvancedOutput::Update()
|
|
@@ -1415,15 +1416,15 @@ inline void AdvancedOutput::SetupStreaming()
|
|
}
|
|
}
|
|
|
|
|
|
obs_output_set_audio_encoder(streamOutput, streamAudioEnc, 0);
|
|
obs_output_set_audio_encoder(streamOutput, streamAudioEnc, 0);
|
|
- obs_encoder_set_scaled_size(h264Streaming, cx, cy);
|
|
|
|
- obs_encoder_set_video(h264Streaming, obs_get_video());
|
|
|
|
|
|
+ obs_encoder_set_scaled_size(videoStreaming, cx, cy);
|
|
|
|
+ obs_encoder_set_video(videoStreaming, obs_get_video());
|
|
|
|
|
|
const char *id = obs_service_get_id(main->GetService());
|
|
const char *id = obs_service_get_id(main->GetService());
|
|
if (strcmp(id, "rtmp_custom") == 0) {
|
|
if (strcmp(id, "rtmp_custom") == 0) {
|
|
OBSDataAutoRelease settings = obs_data_create();
|
|
OBSDataAutoRelease settings = obs_data_create();
|
|
obs_service_apply_encoder_settings(main->GetService(), settings,
|
|
obs_service_apply_encoder_settings(main->GetService(), settings,
|
|
nullptr);
|
|
nullptr);
|
|
- obs_encoder_update(h264Streaming, settings);
|
|
|
|
|
|
+ obs_encoder_update(videoStreaming, settings);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1457,10 +1458,10 @@ inline void AdvancedOutput::SetupRecording()
|
|
tracks = config_get_int(main->Config(), "AdvOut", "TrackIndex");
|
|
tracks = config_get_int(main->Config(), "AdvOut", "TrackIndex");
|
|
|
|
|
|
if (useStreamEncoder) {
|
|
if (useStreamEncoder) {
|
|
- obs_output_set_video_encoder(fileOutput, h264Streaming);
|
|
|
|
|
|
+ obs_output_set_video_encoder(fileOutput, videoStreaming);
|
|
if (replayBuffer)
|
|
if (replayBuffer)
|
|
obs_output_set_video_encoder(replayBuffer,
|
|
obs_output_set_video_encoder(replayBuffer,
|
|
- h264Streaming);
|
|
|
|
|
|
+ videoStreaming);
|
|
} else {
|
|
} else {
|
|
if (rescale && rescaleRes && *rescaleRes) {
|
|
if (rescale && rescaleRes && *rescaleRes) {
|
|
if (sscanf(rescaleRes, "%ux%u", &cx, &cy) != 2) {
|
|
if (sscanf(rescaleRes, "%ux%u", &cx, &cy) != 2) {
|
|
@@ -1469,12 +1470,12 @@ inline void AdvancedOutput::SetupRecording()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- obs_encoder_set_scaled_size(h264Recording, cx, cy);
|
|
|
|
- obs_encoder_set_video(h264Recording, obs_get_video());
|
|
|
|
- obs_output_set_video_encoder(fileOutput, h264Recording);
|
|
|
|
|
|
+ obs_encoder_set_scaled_size(videoRecording, cx, cy);
|
|
|
|
+ obs_encoder_set_video(videoRecording, obs_get_video());
|
|
|
|
+ obs_output_set_video_encoder(fileOutput, videoRecording);
|
|
if (replayBuffer)
|
|
if (replayBuffer)
|
|
obs_output_set_video_encoder(replayBuffer,
|
|
obs_output_set_video_encoder(replayBuffer,
|
|
- h264Recording);
|
|
|
|
|
|
+ videoRecording);
|
|
}
|
|
}
|
|
|
|
|
|
if (!flv) {
|
|
if (!flv) {
|
|
@@ -1627,9 +1628,9 @@ inline void AdvancedOutput::UpdateAudioSettings()
|
|
|
|
|
|
void AdvancedOutput::SetupOutputs()
|
|
void AdvancedOutput::SetupOutputs()
|
|
{
|
|
{
|
|
- obs_encoder_set_video(h264Streaming, obs_get_video());
|
|
|
|
- if (h264Recording)
|
|
|
|
- obs_encoder_set_video(h264Recording, obs_get_video());
|
|
|
|
|
|
+ obs_encoder_set_video(videoStreaming, obs_get_video());
|
|
|
|
+ if (videoRecording)
|
|
|
|
+ obs_encoder_set_video(videoRecording, obs_get_video());
|
|
for (size_t i = 0; i < MAX_AUDIO_MIXES; i++)
|
|
for (size_t i = 0; i < MAX_AUDIO_MIXES; i++)
|
|
obs_encoder_set_audio(aacTrack[i], obs_get_audio());
|
|
obs_encoder_set_audio(aacTrack[i], obs_get_audio());
|
|
obs_encoder_set_audio(streamAudioEnc, obs_get_audio());
|
|
obs_encoder_set_audio(streamAudioEnc, obs_get_audio());
|
|
@@ -1783,7 +1784,7 @@ bool AdvancedOutput::SetupStreaming(obs_service_t *service)
|
|
outputType = type;
|
|
outputType = type;
|
|
}
|
|
}
|
|
|
|
|
|
- obs_output_set_video_encoder(streamOutput, h264Streaming);
|
|
|
|
|
|
+ obs_output_set_video_encoder(streamOutput, videoStreaming);
|
|
obs_output_set_audio_encoder(streamOutput, streamAudioEnc, 0);
|
|
obs_output_set_audio_encoder(streamOutput, streamAudioEnc, 0);
|
|
|
|
|
|
return true;
|
|
return true;
|