UI: Add simple mode for Apple Hardware HEVC
This commit is contained in:
parent
b8681356e1
commit
e6b7a60638
6 changed files with 79 additions and 2 deletions
|
|
@ -293,6 +293,9 @@ struct SimpleOutput : BasicOutputHandler {
|
|||
void UpdateRecordingSettings_nvenc_hevc_av1(int cqp);
|
||||
void UpdateRecordingSettings_amd_cqp(int cqp);
|
||||
void UpdateRecordingSettings_apple(int quality);
|
||||
#ifdef ENABLE_HEVC
|
||||
void UpdateRecordingSettings_apple_hevc(int quality);
|
||||
#endif
|
||||
void UpdateRecordingSettings();
|
||||
void UpdateRecordingAudioSettings();
|
||||
virtual void Update() override;
|
||||
|
|
@ -386,6 +389,10 @@ const char *get_simple_output_encoder(const char *encoder)
|
|||
return "jim_av1_nvenc";
|
||||
} else if (strcmp(encoder, SIMPLE_ENCODER_APPLE_H264) == 0) {
|
||||
return "com.apple.videotoolbox.videoencoder.ave.avc";
|
||||
#ifdef ENABLE_HEVC
|
||||
} else if (strcmp(encoder, SIMPLE_ENCODER_APPLE_HEVC) == 0) {
|
||||
return "com.apple.videotoolbox.videoencoder.ave.hevc";
|
||||
#endif
|
||||
}
|
||||
|
||||
return "obs_x264";
|
||||
|
|
@ -703,6 +710,18 @@ void SimpleOutput::UpdateRecordingSettings_apple(int quality)
|
|||
obs_encoder_update(videoRecording, settings);
|
||||
}
|
||||
|
||||
#ifdef ENABLE_HEVC
|
||||
void SimpleOutput::UpdateRecordingSettings_apple_hevc(int quality)
|
||||
{
|
||||
OBSDataAutoRelease settings = obs_data_create();
|
||||
obs_data_set_string(settings, "rate_control", "CRF");
|
||||
obs_data_set_string(settings, "profile", "main");
|
||||
obs_data_set_int(settings, "quality", quality);
|
||||
|
||||
obs_encoder_update(videoRecording, settings);
|
||||
}
|
||||
#endif
|
||||
|
||||
void SimpleOutput::UpdateRecordingSettings_amd_cqp(int cqp)
|
||||
{
|
||||
OBSDataAutoRelease settings = obs_data_create();
|
||||
|
|
@ -745,6 +764,10 @@ void SimpleOutput::UpdateRecordingSettings()
|
|||
} else if (videoEncoder == SIMPLE_ENCODER_APPLE_H264) {
|
||||
/* These are magic numbers. 0 - 100, more is better. */
|
||||
UpdateRecordingSettings_apple(ultra_hq ? 70 : 50);
|
||||
#ifdef ENABLE_HEVC
|
||||
} else if (videoEncoder == SIMPLE_ENCODER_APPLE_HEVC) {
|
||||
UpdateRecordingSettings_apple_hevc(ultra_hq ? 70 : 50);
|
||||
#endif
|
||||
}
|
||||
UpdateRecordingAudioSettings();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue