obs-studio/UI/window-basic-settings.hpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

525 lines
14 KiB
C++
Raw Normal View History

/******************************************************************************
2023-05-19 00:37:26 +00:00
Copyright (C) 2023 by Lain Bailey <lain@obsproject.com>
Philippe Groarke <philippe.groarke@gmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
******************************************************************************/
2013-12-11 04:14:20 +00:00
#pragma once
#include <util/util.hpp>
#include <QDialog>
#include <QPointer>
#include <memory>
#include <string>
2013-12-11 04:14:20 +00:00
#include <obs.hpp>
#include "auth-base.hpp"
2023-07-30 13:19:08 +00:00
#include "ffmpeg-utils.hpp"
#include "obs-app-theming.hpp"
class OBSBasic;
class QAbstractButton;
class QRadioButton;
class QComboBox;
class QCheckBox;
class QLabel;
class QButtonGroup;
obs-studio UI: Implement stream settings UI - Updated the services API so that it links up with an output and the output gets data from that service rather than via settings. This allows the service context to have control over how an output is used, and makes it so that the URL/key/etc isn't necessarily some static setting. Also, if the service is attached to an output, it will stick around until the output is destroyed. - The settings interface has been updated so that it can allow the usage of service plugins. What this means is that now you can create a service plugin that can control aspects of the stream, and it allows each service to create their own user interface if they create a service plugin module. - Testing out saving of current service information. Saves/loads from JSON in to obs_data_t, seems to be working quite nicely, and the service object information is saved/preserved on exit, and loaded again on startup. - I agonized over the settings user interface for days, and eventually I just decided that the only way that users weren't going to be fumbling over options was to split up the settings in to simple/basic output, pre-configured, and then advanced for advanced use (such as multiple outputs or services, which I'll implement later). This was particularly painful to really design right, I wanted more features and wanted to include everything in one interface but ultimately just realized from experience that users are just not technically knowledgable about it and will end up fumbling with the settings rather than getting things done. Basically, what this means is that casual users only have to enter in about 3 things to configure their stream: Stream key, audio bitrate, and video bitrate. I am really happy with this interface for those types of users, but it definitely won't be sufficient for advanced usage or for custom outputs, so that stuff will have to be separated. - Improved the JSON usage for the 'common streaming services' context, I realized that JSON arrays are there to ensure sorting, while forgetting that general items are optimized for hashing. So basically I'm just using arrays now to sort items in it.
2014-04-24 08:49:07 +00:00
class OBSPropertiesView;
class OBSHotkeyWidget;
#include "ui_OBSBasicSettings.h"
2013-12-11 04:14:20 +00:00
#define VOLUME_METER_DECAY_FAST 23.53
#define VOLUME_METER_DECAY_MEDIUM 11.76
#define VOLUME_METER_DECAY_SLOW 8.57
class SilentUpdateCheckBox : public QCheckBox {
Q_OBJECT
public slots:
void setCheckedSilently(bool checked)
{
bool blocked = blockSignals(true);
setChecked(checked);
blockSignals(blocked);
}
};
class SilentUpdateSpinBox : public QSpinBox {
Q_OBJECT
public slots:
void setValueSilently(int val)
{
bool blocked = blockSignals(true);
setValue(val);
blockSignals(blocked);
}
};
class OBSBasicSettings : public QDialog {
Q_OBJECT
2019-07-15 11:50:23 +00:00
Q_PROPERTY(QIcon generalIcon READ GetGeneralIcon WRITE SetGeneralIcon
DESIGNABLE true)
2023-09-28 02:55:19 +00:00
Q_PROPERTY(QIcon appearanceIcon READ GetAppearanceIcon WRITE
SetAppearanceIcon DESIGNABLE true)
2019-07-15 11:50:23 +00:00
Q_PROPERTY(QIcon streamIcon READ GetStreamIcon WRITE SetStreamIcon
DESIGNABLE true)
Q_PROPERTY(QIcon outputIcon READ GetOutputIcon WRITE SetOutputIcon
DESIGNABLE true)
Q_PROPERTY(QIcon audioIcon READ GetAudioIcon WRITE SetAudioIcon
DESIGNABLE true)
Q_PROPERTY(QIcon videoIcon READ GetVideoIcon WRITE SetVideoIcon
DESIGNABLE true)
Q_PROPERTY(QIcon hotkeysIcon READ GetHotkeysIcon WRITE SetHotkeysIcon
DESIGNABLE true)
Q_PROPERTY(QIcon accessibilityIcon READ GetAccessibilityIcon WRITE
SetAccessibilityIcon DESIGNABLE true)
2019-07-15 11:50:23 +00:00
Q_PROPERTY(QIcon advancedIcon READ GetAdvancedIcon WRITE SetAdvancedIcon
DESIGNABLE true)
2023-09-28 02:55:19 +00:00
enum Pages {
GENERAL,
APPEARANCE,
STREAM,
OUTPUT,
AUDIO,
VIDEO,
HOTKEYS,
ACCESSIBILITY,
ADVANCED,
NUM_PAGES
};
private:
OBSBasic *main;
std::unique_ptr<Ui::OBSBasicSettings> ui;
std::shared_ptr<Auth> auth;
bool generalChanged = false;
bool stream1Changed = false;
bool outputsChanged = false;
bool audioChanged = false;
bool videoChanged = false;
bool hotkeysChanged = false;
bool a11yChanged = false;
bool appearanceChanged = false;
bool advancedChanged = false;
int pageIndex = 0;
bool loading = true;
bool forceAuthReload = false;
2022-10-01 12:29:48 +00:00
bool forceUpdateCheck = false;
int sampleRateIndex = 0;
int channelIndex = 0;
bool llBufferingEnabled = false;
bool hotkeysLoaded = false;
UI: Add recording presets to simple output So certain high-profile individuals were complaining that it was difficult to configure recording settings for quality in OBS. So, I decided to add a very easy-to-use auto-configuration for high quality encoding -- including lossless encoding. This feature will automatically configure ideal recording settings based upon a specified quality level. Recording quality presets added to simple output: - Same as stream: Copies the encoded streaming data with no extra usage hit. - High quality: uses a higher CRF value (starting at 23) if using x264. - Indistinguishable quality: uses a low CRF value (starting at 16) if using x264. - Lossless will spawn an FFmpeg output that uses huffyuv encoding. If a user tries to select lossless, they will be warned both via a dialog prompt and a warning message in the settings window to ensure they understand that it requires tremendous amounts of free space. It will always use the AVI file format. Extra Notes: - When High/Indistinguishable quality is set, it will allow you to select the recording encoder. Currently, it just allows you to select x264 (at either veryfast or ultrafast). Later on, it'll be useful to be able to set up pre-configured presets for hardware encoders once more are implemented and tested. - I decided to allow the use of x264 at both veryfast or ultrafast presets. The reasoning is two-fold: 1.) ultrafast is perfectly viable even for near indistinguishable quality as long as it has the appropriate CRF value. It's nice if you want to record but would like to or need to reduce the impact of encoding on the CPU. It will automatically compensate for the preset at the cost of larger file size. 2.) It was suggested to just always use ultrafast, but ultrafast requires 2-4x as much disk space for the same CRF (most likely due to x264 compensating for the preset). Providing veryfast is important if you really want to reduce file size and/or reduce blocking at lower quality levels. - When a recording preset is used, a secondary audio encoder is also spawned at 192 bitrate to ensure high quality audio. I chose 192 because that's the limit of the media foundation aac encoder on windows, which I want to make sure is used if available due to its high performance. - The CRF calculation is based upon resolution, quality, and whether it's set to ultrafast. First, quality sets the base CRF, 23 for "good" quality, 16 for "very high" quality. If set to ultrafast, it'll subtract 2 points from the CRF value to help compensate. Lower resolutions will also lower the CRF value to help improve higher details with a smaller pixel ratio.
2015-09-19 05:29:36 +00:00
int lastSimpleRecQualityIdx = 0;
int lastServiceIdx = -1;
int lastIgnoreRecommended = -1;
int lastChannelSetupIdx = 0;
UI: Add recording presets to simple output So certain high-profile individuals were complaining that it was difficult to configure recording settings for quality in OBS. So, I decided to add a very easy-to-use auto-configuration for high quality encoding -- including lossless encoding. This feature will automatically configure ideal recording settings based upon a specified quality level. Recording quality presets added to simple output: - Same as stream: Copies the encoded streaming data with no extra usage hit. - High quality: uses a higher CRF value (starting at 23) if using x264. - Indistinguishable quality: uses a low CRF value (starting at 16) if using x264. - Lossless will spawn an FFmpeg output that uses huffyuv encoding. If a user tries to select lossless, they will be warned both via a dialog prompt and a warning message in the settings window to ensure they understand that it requires tremendous amounts of free space. It will always use the AVI file format. Extra Notes: - When High/Indistinguishable quality is set, it will allow you to select the recording encoder. Currently, it just allows you to select x264 (at either veryfast or ultrafast). Later on, it'll be useful to be able to set up pre-configured presets for hardware encoders once more are implemented and tested. - I decided to allow the use of x264 at both veryfast or ultrafast presets. The reasoning is two-fold: 1.) ultrafast is perfectly viable even for near indistinguishable quality as long as it has the appropriate CRF value. It's nice if you want to record but would like to or need to reduce the impact of encoding on the CPU. It will automatically compensate for the preset at the cost of larger file size. 2.) It was suggested to just always use ultrafast, but ultrafast requires 2-4x as much disk space for the same CRF (most likely due to x264 compensating for the preset). Providing veryfast is important if you really want to reduce file size and/or reduce blocking at lower quality levels. - When a recording preset is used, a secondary audio encoder is also spawned at 192 bitrate to ensure high quality audio. I chose 192 because that's the limit of the media foundation aac encoder on windows, which I want to make sure is used if available due to its high performance. - The CRF calculation is based upon resolution, quality, and whether it's set to ultrafast. First, quality sets the base CRF, 23 for "good" quality, 16 for "very high" quality. If set to ultrafast, it'll subtract 2 points from the CRF value to help compensate. Lower resolutions will also lower the CRF value to help improve higher details with a smaller pixel ratio.
2015-09-19 05:29:36 +00:00
static constexpr uint32_t ENCODER_HIDE_FLAGS =
(OBS_ENCODER_CAP_DEPRECATED | OBS_ENCODER_CAP_INTERNAL);
OBSTheme *savedTheme = nullptr;
2023-07-30 13:19:08 +00:00
std::vector<FFmpegFormat> formats;
OBSPropertiesView *streamProperties = nullptr;
OBSPropertiesView *streamEncoderProps = nullptr;
OBSPropertiesView *recordEncoderProps = nullptr;
obs-studio UI: Implement stream settings UI - Updated the services API so that it links up with an output and the output gets data from that service rather than via settings. This allows the service context to have control over how an output is used, and makes it so that the URL/key/etc isn't necessarily some static setting. Also, if the service is attached to an output, it will stick around until the output is destroyed. - The settings interface has been updated so that it can allow the usage of service plugins. What this means is that now you can create a service plugin that can control aspects of the stream, and it allows each service to create their own user interface if they create a service plugin module. - Testing out saving of current service information. Saves/loads from JSON in to obs_data_t, seems to be working quite nicely, and the service object information is saved/preserved on exit, and loaded again on startup. - I agonized over the settings user interface for days, and eventually I just decided that the only way that users weren't going to be fumbling over options was to split up the settings in to simple/basic output, pre-configured, and then advanced for advanced use (such as multiple outputs or services, which I'll implement later). This was particularly painful to really design right, I wanted more features and wanted to include everything in one interface but ultimately just realized from experience that users are just not technically knowledgable about it and will end up fumbling with the settings rather than getting things done. Basically, what this means is that casual users only have to enter in about 3 things to configure their stream: Stream key, audio bitrate, and video bitrate. I am really happy with this interface for those types of users, but it definitely won't be sufficient for advanced usage or for custom outputs, so that stuff will have to be separated. - Improved the JSON usage for the 'common streaming services' context, I realized that JSON arrays are there to ensure sorting, while forgetting that general items are optimized for hashing. So basically I'm just using arrays now to sort items in it.
2014-04-24 08:49:07 +00:00
QPointer<QLabel> advOutRecWarning;
UI: Add recording presets to simple output So certain high-profile individuals were complaining that it was difficult to configure recording settings for quality in OBS. So, I decided to add a very easy-to-use auto-configuration for high quality encoding -- including lossless encoding. This feature will automatically configure ideal recording settings based upon a specified quality level. Recording quality presets added to simple output: - Same as stream: Copies the encoded streaming data with no extra usage hit. - High quality: uses a higher CRF value (starting at 23) if using x264. - Indistinguishable quality: uses a low CRF value (starting at 16) if using x264. - Lossless will spawn an FFmpeg output that uses huffyuv encoding. If a user tries to select lossless, they will be warned both via a dialog prompt and a warning message in the settings window to ensure they understand that it requires tremendous amounts of free space. It will always use the AVI file format. Extra Notes: - When High/Indistinguishable quality is set, it will allow you to select the recording encoder. Currently, it just allows you to select x264 (at either veryfast or ultrafast). Later on, it'll be useful to be able to set up pre-configured presets for hardware encoders once more are implemented and tested. - I decided to allow the use of x264 at both veryfast or ultrafast presets. The reasoning is two-fold: 1.) ultrafast is perfectly viable even for near indistinguishable quality as long as it has the appropriate CRF value. It's nice if you want to record but would like to or need to reduce the impact of encoding on the CPU. It will automatically compensate for the preset at the cost of larger file size. 2.) It was suggested to just always use ultrafast, but ultrafast requires 2-4x as much disk space for the same CRF (most likely due to x264 compensating for the preset). Providing veryfast is important if you really want to reduce file size and/or reduce blocking at lower quality levels. - When a recording preset is used, a secondary audio encoder is also spawned at 192 bitrate to ensure high quality audio. I chose 192 because that's the limit of the media foundation aac encoder on windows, which I want to make sure is used if available due to its high performance. - The CRF calculation is based upon resolution, quality, and whether it's set to ultrafast. First, quality sets the base CRF, 23 for "good" quality, 16 for "very high" quality. If set to ultrafast, it'll subtract 2 points from the CRF value to help compensate. Lower resolutions will also lower the CRF value to help improve higher details with a smaller pixel ratio.
2015-09-19 05:29:36 +00:00
QPointer<QLabel> simpleOutRecWarning;
QString curPreset;
QString curQSVPreset;
2016-04-18 23:12:59 +00:00
QString curNVENCPreset;
QString curAMDPreset;
2022-11-08 08:38:23 +00:00
QString curAMDAV1Preset;
QString curAdvStreamEncoder;
QString curAdvRecordEncoder;
using AudioSource_t =
std::tuple<OBSWeakSource, QPointer<QCheckBox>,
QPointer<QSpinBox>, QPointer<QCheckBox>,
QPointer<QSpinBox>>;
std::vector<AudioSource_t> audioSources;
std::vector<OBSSignal> audioSourceSignals;
OBSSignal sourceCreated;
OBSSignal channelChanged;
std::vector<std::pair<bool, QPointer<OBSHotkeyWidget>>> hotkeys;
OBSSignal hotkeyRegistered;
OBSSignal hotkeyUnregistered;
uint32_t outputCX = 0;
uint32_t outputCY = 0;
QPointer<QCheckBox> simpleVodTrack;
QPointer<QCheckBox> vodTrackCheckbox;
QPointer<QWidget> vodTrackContainer;
QPointer<QRadioButton> vodTrack[MAX_AUDIO_MIXES];
QIcon hotkeyConflictIcon;
void SaveCombo(QComboBox *widget, const char *section,
const char *value);
void SaveComboData(QComboBox *widget, const char *section,
const char *value);
void SaveCheckBox(QAbstractButton *widget, const char *section,
const char *value, bool invert = false);
void SaveGroupBox(QGroupBox *widget, const char *section,
const char *value);
void SaveEdit(QLineEdit *widget, const char *section,
const char *value);
void SaveSpinBox(QSpinBox *widget, const char *section,
const char *value);
void SaveFormat(QComboBox *combo);
void SaveEncoder(QComboBox *combo, const char *section,
const char *value);
bool ResFPSValid(obs_service_resolution *res_list, size_t res_count,
int max_fps);
void ClosestResFPS(obs_service_resolution *res_list, size_t res_count,
int max_fps, int &new_cx, int &new_cy, int &new_fps);
inline bool Changed() const
{
return generalChanged || appearanceChanged || outputsChanged ||
stream1Changed || audioChanged || videoChanged ||
advancedChanged || hotkeysChanged || a11yChanged;
}
inline void EnableApplyButton(bool en)
{
ui->buttonBox->button(QDialogButtonBox::Apply)->setEnabled(en);
}
inline void ClearChanged()
{
generalChanged = false;
stream1Changed = false;
outputsChanged = false;
audioChanged = false;
videoChanged = false;
hotkeysChanged = false;
a11yChanged = false;
advancedChanged = false;
appearanceChanged = false;
EnableApplyButton(false);
}
template<typename Widget, typename WidgetParent, typename... SignalArgs,
typename... SlotArgs>
void HookWidget(Widget *widget,
void (WidgetParent::*signal)(SignalArgs...),
void (OBSBasicSettings::*slot)(SlotArgs...))
{
QObject::connect(widget, signal, this, slot);
widget->setProperty("changed", QVariant(false));
}
bool QueryChanges();
bool QueryAllowedToClose();
void ResetEncoders(bool streamOnly = false);
void LoadColorRanges();
void LoadColorSpaces();
void LoadColorFormats();
void LoadFormats();
2023-07-30 13:19:08 +00:00
void ReloadCodecs(const FFmpegFormat &format);
obs-studio UI: Implement stream settings UI - Updated the services API so that it links up with an output and the output gets data from that service rather than via settings. This allows the service context to have control over how an output is used, and makes it so that the URL/key/etc isn't necessarily some static setting. Also, if the service is attached to an output, it will stick around until the output is destroyed. - The settings interface has been updated so that it can allow the usage of service plugins. What this means is that now you can create a service plugin that can control aspects of the stream, and it allows each service to create their own user interface if they create a service plugin module. - Testing out saving of current service information. Saves/loads from JSON in to obs_data_t, seems to be working quite nicely, and the service object information is saved/preserved on exit, and loaded again on startup. - I agonized over the settings user interface for days, and eventually I just decided that the only way that users weren't going to be fumbling over options was to split up the settings in to simple/basic output, pre-configured, and then advanced for advanced use (such as multiple outputs or services, which I'll implement later). This was particularly painful to really design right, I wanted more features and wanted to include everything in one interface but ultimately just realized from experience that users are just not technically knowledgable about it and will end up fumbling with the settings rather than getting things done. Basically, what this means is that casual users only have to enter in about 3 things to configure their stream: Stream key, audio bitrate, and video bitrate. I am really happy with this interface for those types of users, but it definitely won't be sufficient for advanced usage or for custom outputs, so that stuff will have to be separated. - Improved the JSON usage for the 'common streaming services' context, I realized that JSON arrays are there to ensure sorting, while forgetting that general items are optimized for hashing. So basically I'm just using arrays now to sort items in it.
2014-04-24 08:49:07 +00:00
void UpdateColorFormatSpaceWarning();
void LoadGeneralSettings();
void LoadStream1Settings();
void LoadOutputSettings();
void LoadAudioSettings();
void LoadVideoSettings();
void
LoadHotkeySettings(obs_hotkey_id ignoreKey = OBS_INVALID_HOTKEY_ID);
void LoadA11ySettings(bool presetChange = false);
void LoadAppearanceSettings(bool reload = false);
void LoadAdvancedSettings();
void LoadSettings(bool changedOnly);
OBSPropertiesView *CreateEncoderPropertyView(const char *encoder,
const char *path,
bool changed = false);
/* general */
void LoadLanguageList();
void LoadThemeList(bool firstLoad);
2022-10-01 12:29:48 +00:00
void LoadBranchesList();
/* stream */
void InitStreamPage();
inline bool IsCustomService() const;
inline bool IsWHIP() const;
void LoadServices(bool showAll);
void OnOAuthStreamKeyConnected();
void OnAuthConnected();
QString lastService;
QString protocol;
QString lastCustomServer;
int prevLangIndex;
bool prevBrowserAccel;
void ServiceChanged(bool resetFields = false);
QString FindProtocol();
void UpdateServerList();
void UpdateKeyLink();
void UpdateVodTrackSetting();
void UpdateServiceRecommendations();
void UpdateMoreInfoLink();
void UpdateAdvNetworkGroup();
/* Appearance */
void InitAppearancePage();
private slots:
void RecreateOutputResolutionWidget();
bool UpdateResFPSLimits();
void DisplayEnforceWarning(bool checked);
void on_show_clicked();
void on_authPwShow_clicked();
void on_connectAccount_clicked();
void on_disconnectAccount_clicked();
void on_useStreamKey_clicked();
void on_useAuth_toggled();
void on_hotkeyFilterReset_clicked();
void on_hotkeyFilterSearch_textChanged(const QString text);
void on_hotkeyFilterInput_KeyChanged(obs_key_combination_t combo);
private:
obs-studio UI: Implement stream settings UI - Updated the services API so that it links up with an output and the output gets data from that service rather than via settings. This allows the service context to have control over how an output is used, and makes it so that the URL/key/etc isn't necessarily some static setting. Also, if the service is attached to an output, it will stick around until the output is destroyed. - The settings interface has been updated so that it can allow the usage of service plugins. What this means is that now you can create a service plugin that can control aspects of the stream, and it allows each service to create their own user interface if they create a service plugin module. - Testing out saving of current service information. Saves/loads from JSON in to obs_data_t, seems to be working quite nicely, and the service object information is saved/preserved on exit, and loaded again on startup. - I agonized over the settings user interface for days, and eventually I just decided that the only way that users weren't going to be fumbling over options was to split up the settings in to simple/basic output, pre-configured, and then advanced for advanced use (such as multiple outputs or services, which I'll implement later). This was particularly painful to really design right, I wanted more features and wanted to include everything in one interface but ultimately just realized from experience that users are just not technically knowledgable about it and will end up fumbling with the settings rather than getting things done. Basically, what this means is that casual users only have to enter in about 3 things to configure their stream: Stream key, audio bitrate, and video bitrate. I am really happy with this interface for those types of users, but it definitely won't be sufficient for advanced usage or for custom outputs, so that stuff will have to be separated. - Improved the JSON usage for the 'common streaming services' context, I realized that JSON arrays are there to ensure sorting, while forgetting that general items are optimized for hashing. So basically I'm just using arrays now to sort items in it.
2014-04-24 08:49:07 +00:00
/* output */
void LoadSimpleOutputSettings();
void LoadAdvOutputStreamingSettings();
void LoadAdvOutputStreamingEncoderProperties();
void LoadAdvOutputRecordingSettings();
void LoadAdvOutputRecordingEncoderProperties();
void LoadAdvOutputFFmpegSettings();
void LoadAdvOutputAudioSettings();
2023-07-30 13:19:08 +00:00
void SetAdvOutputFFmpegEnablement(FFmpegCodecType encoderType,
bool enabled,
bool enableEncode = false);
obs-studio UI: Implement stream settings UI - Updated the services API so that it links up with an output and the output gets data from that service rather than via settings. This allows the service context to have control over how an output is used, and makes it so that the URL/key/etc isn't necessarily some static setting. Also, if the service is attached to an output, it will stick around until the output is destroyed. - The settings interface has been updated so that it can allow the usage of service plugins. What this means is that now you can create a service plugin that can control aspects of the stream, and it allows each service to create their own user interface if they create a service plugin module. - Testing out saving of current service information. Saves/loads from JSON in to obs_data_t, seems to be working quite nicely, and the service object information is saved/preserved on exit, and loaded again on startup. - I agonized over the settings user interface for days, and eventually I just decided that the only way that users weren't going to be fumbling over options was to split up the settings in to simple/basic output, pre-configured, and then advanced for advanced use (such as multiple outputs or services, which I'll implement later). This was particularly painful to really design right, I wanted more features and wanted to include everything in one interface but ultimately just realized from experience that users are just not technically knowledgable about it and will end up fumbling with the settings rather than getting things done. Basically, what this means is that casual users only have to enter in about 3 things to configure their stream: Stream key, audio bitrate, and video bitrate. I am really happy with this interface for those types of users, but it definitely won't be sufficient for advanced usage or for custom outputs, so that stuff will have to be separated. - Improved the JSON usage for the 'common streaming services' context, I realized that JSON arrays are there to ensure sorting, while forgetting that general items are optimized for hashing. So basically I'm just using arrays now to sort items in it.
2014-04-24 08:49:07 +00:00
/* audio */
void LoadListValues(QComboBox *widget, obs_property_t *prop, int index);
void LoadAudioDevices();
void LoadAudioSources();
/* video */
void LoadRendererList();
void ResetDownscales(uint32_t cx, uint32_t cy,
bool ignoreAllSignals = false);
void LoadDownscaleFilters();
void LoadResolutionLists();
void LoadFPSData();
/* a11y */
void UpdateA11yColors();
void SetDefaultColors();
void ResetDefaultColors();
QColor GetColor(uint32_t colorVal, QString label);
uint32_t preset = 0;
uint32_t selectRed = 0x0000FF;
uint32_t selectGreen = 0x00FF00;
uint32_t selectBlue = 0xFF7F00;
uint32_t mixerGreen = 0x267f26;
uint32_t mixerYellow = 0x267f7f;
uint32_t mixerRed = 0x26267f;
uint32_t mixerGreenActive = 0x4cff4c;
uint32_t mixerYellowActive = 0x4cffff;
uint32_t mixerRedActive = 0x4c4cff;
void SaveGeneralSettings();
void SaveStream1Settings();
void SaveOutputSettings();
void SaveAudioSettings();
void SaveVideoSettings();
void SaveHotkeySettings();
void SaveA11ySettings();
void SaveAppearanceSettings();
void SaveAdvancedSettings();
void SaveSettings();
void SearchHotkeys(const QString &text,
obs_key_combination_t filterCombo);
void UpdateSimpleOutStreamDelayEstimate();
void UpdateAdvOutStreamDelayEstimate();
UI: Add recording presets to simple output So certain high-profile individuals were complaining that it was difficult to configure recording settings for quality in OBS. So, I decided to add a very easy-to-use auto-configuration for high quality encoding -- including lossless encoding. This feature will automatically configure ideal recording settings based upon a specified quality level. Recording quality presets added to simple output: - Same as stream: Copies the encoded streaming data with no extra usage hit. - High quality: uses a higher CRF value (starting at 23) if using x264. - Indistinguishable quality: uses a low CRF value (starting at 16) if using x264. - Lossless will spawn an FFmpeg output that uses huffyuv encoding. If a user tries to select lossless, they will be warned both via a dialog prompt and a warning message in the settings window to ensure they understand that it requires tremendous amounts of free space. It will always use the AVI file format. Extra Notes: - When High/Indistinguishable quality is set, it will allow you to select the recording encoder. Currently, it just allows you to select x264 (at either veryfast or ultrafast). Later on, it'll be useful to be able to set up pre-configured presets for hardware encoders once more are implemented and tested. - I decided to allow the use of x264 at both veryfast or ultrafast presets. The reasoning is two-fold: 1.) ultrafast is perfectly viable even for near indistinguishable quality as long as it has the appropriate CRF value. It's nice if you want to record but would like to or need to reduce the impact of encoding on the CPU. It will automatically compensate for the preset at the cost of larger file size. 2.) It was suggested to just always use ultrafast, but ultrafast requires 2-4x as much disk space for the same CRF (most likely due to x264 compensating for the preset). Providing veryfast is important if you really want to reduce file size and/or reduce blocking at lower quality levels. - When a recording preset is used, a secondary audio encoder is also spawned at 192 bitrate to ensure high quality audio. I chose 192 because that's the limit of the media foundation aac encoder on windows, which I want to make sure is used if available due to its high performance. - The CRF calculation is based upon resolution, quality, and whether it's set to ultrafast. First, quality sets the base CRF, 23 for "good" quality, 16 for "very high" quality. If set to ultrafast, it'll subtract 2 points from the CRF value to help compensate. Lower resolutions will also lower the CRF value to help improve higher details with a smaller pixel ratio.
2015-09-19 05:29:36 +00:00
void FillSimpleRecordingValues();
void FillAudioMonitoringDevices();
UI: Add recording presets to simple output So certain high-profile individuals were complaining that it was difficult to configure recording settings for quality in OBS. So, I decided to add a very easy-to-use auto-configuration for high quality encoding -- including lossless encoding. This feature will automatically configure ideal recording settings based upon a specified quality level. Recording quality presets added to simple output: - Same as stream: Copies the encoded streaming data with no extra usage hit. - High quality: uses a higher CRF value (starting at 23) if using x264. - Indistinguishable quality: uses a low CRF value (starting at 16) if using x264. - Lossless will spawn an FFmpeg output that uses huffyuv encoding. If a user tries to select lossless, they will be warned both via a dialog prompt and a warning message in the settings window to ensure they understand that it requires tremendous amounts of free space. It will always use the AVI file format. Extra Notes: - When High/Indistinguishable quality is set, it will allow you to select the recording encoder. Currently, it just allows you to select x264 (at either veryfast or ultrafast). Later on, it'll be useful to be able to set up pre-configured presets for hardware encoders once more are implemented and tested. - I decided to allow the use of x264 at both veryfast or ultrafast presets. The reasoning is two-fold: 1.) ultrafast is perfectly viable even for near indistinguishable quality as long as it has the appropriate CRF value. It's nice if you want to record but would like to or need to reduce the impact of encoding on the CPU. It will automatically compensate for the preset at the cost of larger file size. 2.) It was suggested to just always use ultrafast, but ultrafast requires 2-4x as much disk space for the same CRF (most likely due to x264 compensating for the preset). Providing veryfast is important if you really want to reduce file size and/or reduce blocking at lower quality levels. - When a recording preset is used, a secondary audio encoder is also spawned at 192 bitrate to ensure high quality audio. I chose 192 because that's the limit of the media foundation aac encoder on windows, which I want to make sure is used if available due to its high performance. - The CRF calculation is based upon resolution, quality, and whether it's set to ultrafast. First, quality sets the base CRF, 23 for "good" quality, 16 for "very high" quality. If set to ultrafast, it'll subtract 2 points from the CRF value to help compensate. Lower resolutions will also lower the CRF value to help improve higher details with a smaller pixel ratio.
2015-09-19 05:29:36 +00:00
void RecalcOutputResPixels(const char *resText);
bool AskIfCanCloseSettings();
void UpdateYouTubeAppDockSettings();
2019-07-15 11:50:23 +00:00
QIcon generalIcon;
2023-09-28 02:55:19 +00:00
QIcon appearanceIcon;
2019-07-15 11:50:23 +00:00
QIcon streamIcon;
QIcon outputIcon;
QIcon audioIcon;
QIcon videoIcon;
QIcon hotkeysIcon;
QIcon accessibilityIcon;
2019-07-15 11:50:23 +00:00
QIcon advancedIcon;
QIcon GetGeneralIcon() const;
2023-09-28 02:55:19 +00:00
QIcon GetAppearanceIcon() const;
2019-07-15 11:50:23 +00:00
QIcon GetStreamIcon() const;
QIcon GetOutputIcon() const;
QIcon GetAudioIcon() const;
QIcon GetVideoIcon() const;
QIcon GetHotkeysIcon() const;
QIcon GetAccessibilityIcon() const;
2019-07-15 11:50:23 +00:00
QIcon GetAdvancedIcon() const;
int CurrentFLVTrack();
int SimpleOutGetSelectedAudioTracks();
int AdvOutGetSelectedAudioTracks();
int AdvOutGetStreamingSelectedAudioTracks();
OBSService GetStream1Service();
2022-12-17 17:26:59 +00:00
bool ServiceAndVCodecCompatible();
bool ServiceAndACodecCompatible();
bool ServiceSupportsCodecCheck();
inline bool AllowsMultiTrack(const char *protocol);
void SwapMultiTrack(const char *protocol);
private slots:
void on_theme_activated(int idx);
void on_themeVariant_activated(int idx);
void on_listWidget_itemSelectionChanged();
void on_buttonBox_clicked(QAbstractButton *button);
void on_service_currentIndexChanged(int idx);
void on_customServer_textChanged(const QString &text);
void on_simpleOutputBrowse_clicked();
void on_advOutRecPathBrowse_clicked();
void on_advOutFFPathBrowse_clicked();
void on_advOutEncoder_currentIndexChanged();
void on_advOutRecEncoder_currentIndexChanged(int idx);
void on_advOutFFIgnoreCompat_stateChanged(int state);
void on_advOutFFFormat_currentIndexChanged(int idx);
void on_advOutFFAEncoder_currentIndexChanged(int idx);
void on_advOutFFVEncoder_currentIndexChanged(int idx);
void on_advOutFFType_currentIndexChanged(int idx);
obs-studio UI: Implement stream settings UI - Updated the services API so that it links up with an output and the output gets data from that service rather than via settings. This allows the service context to have control over how an output is used, and makes it so that the URL/key/etc isn't necessarily some static setting. Also, if the service is attached to an output, it will stick around until the output is destroyed. - The settings interface has been updated so that it can allow the usage of service plugins. What this means is that now you can create a service plugin that can control aspects of the stream, and it allows each service to create their own user interface if they create a service plugin module. - Testing out saving of current service information. Saves/loads from JSON in to obs_data_t, seems to be working quite nicely, and the service object information is saved/preserved on exit, and loaded again on startup. - I agonized over the settings user interface for days, and eventually I just decided that the only way that users weren't going to be fumbling over options was to split up the settings in to simple/basic output, pre-configured, and then advanced for advanced use (such as multiple outputs or services, which I'll implement later). This was particularly painful to really design right, I wanted more features and wanted to include everything in one interface but ultimately just realized from experience that users are just not technically knowledgable about it and will end up fumbling with the settings rather than getting things done. Basically, what this means is that casual users only have to enter in about 3 things to configure their stream: Stream key, audio bitrate, and video bitrate. I am really happy with this interface for those types of users, but it definitely won't be sufficient for advanced usage or for custom outputs, so that stuff will have to be separated. - Improved the JSON usage for the 'common streaming services' context, I realized that JSON arrays are there to ensure sorting, while forgetting that general items are optimized for hashing. So basically I'm just using arrays now to sort items in it.
2014-04-24 08:49:07 +00:00
void on_colorFormat_currentIndexChanged(int idx);
void on_colorSpace_currentIndexChanged(int idx);
void on_filenameFormatting_textEdited(const QString &text);
void on_outputResolution_editTextChanged(const QString &text);
void on_baseResolution_editTextChanged(const QString &text);
void on_disableOSXVSync_clicked();
void on_choose1_clicked();
void on_choose2_clicked();
void on_choose3_clicked();
void on_choose4_clicked();
void on_choose5_clicked();
void on_choose6_clicked();
void on_choose7_clicked();
void on_choose8_clicked();
void on_choose9_clicked();
void on_colorPreset_currentIndexChanged(int idx);
void GeneralChanged();
void HideOBSWindowWarning(int state);
void AudioChanged();
void AudioChangedRestart();
void ReloadAudioSources();
void SurroundWarning(int idx);
void SpeakerLayoutChanged(int idx);
void LowLatencyBufferingChanged(bool checked);
void UpdateAudioWarnings();
void OutputsChanged();
void Stream1Changed();
void VideoChanged();
void VideoChangedResolution();
void HotkeysChanged();
bool ScanDuplicateHotkeys(QFormLayout *layout);
void ReloadHotkeys(obs_hotkey_id ignoreKey = OBS_INVALID_HOTKEY_ID);
void A11yChanged();
void AppearanceChanged();
void AdvancedChanged();
void AdvancedChangedRestart();
void UpdateStreamDelayEstimate();
void UpdateAutomaticReplayBufferCheckboxes();
void AdvOutSplitFileChanged();
void AdvOutRecCheckWarnings();
void AdvOutRecCheckCodecs();
UI: Add recording presets to simple output So certain high-profile individuals were complaining that it was difficult to configure recording settings for quality in OBS. So, I decided to add a very easy-to-use auto-configuration for high quality encoding -- including lossless encoding. This feature will automatically configure ideal recording settings based upon a specified quality level. Recording quality presets added to simple output: - Same as stream: Copies the encoded streaming data with no extra usage hit. - High quality: uses a higher CRF value (starting at 23) if using x264. - Indistinguishable quality: uses a low CRF value (starting at 16) if using x264. - Lossless will spawn an FFmpeg output that uses huffyuv encoding. If a user tries to select lossless, they will be warned both via a dialog prompt and a warning message in the settings window to ensure they understand that it requires tremendous amounts of free space. It will always use the AVI file format. Extra Notes: - When High/Indistinguishable quality is set, it will allow you to select the recording encoder. Currently, it just allows you to select x264 (at either veryfast or ultrafast). Later on, it'll be useful to be able to set up pre-configured presets for hardware encoders once more are implemented and tested. - I decided to allow the use of x264 at both veryfast or ultrafast presets. The reasoning is two-fold: 1.) ultrafast is perfectly viable even for near indistinguishable quality as long as it has the appropriate CRF value. It's nice if you want to record but would like to or need to reduce the impact of encoding on the CPU. It will automatically compensate for the preset at the cost of larger file size. 2.) It was suggested to just always use ultrafast, but ultrafast requires 2-4x as much disk space for the same CRF (most likely due to x264 compensating for the preset). Providing veryfast is important if you really want to reduce file size and/or reduce blocking at lower quality levels. - When a recording preset is used, a secondary audio encoder is also spawned at 192 bitrate to ensure high quality audio. I chose 192 because that's the limit of the media foundation aac encoder on windows, which I want to make sure is used if available due to its high performance. - The CRF calculation is based upon resolution, quality, and whether it's set to ultrafast. First, quality sets the base CRF, 23 for "good" quality, 16 for "very high" quality. If set to ultrafast, it'll subtract 2 points from the CRF value to help compensate. Lower resolutions will also lower the CRF value to help improve higher details with a smaller pixel ratio.
2015-09-19 05:29:36 +00:00
void SimpleRecordingQualityChanged();
void SimpleRecordingEncoderChanged();
void SimpleRecordingQualityLosslessWarning(int idx);
void SimpleReplayBufferChanged();
void AdvReplayBufferChanged();
void SimpleStreamingEncoderChanged();
OBSService SpawnTempService();
2018-12-14 13:42:05 +00:00
void SetGeneralIcon(const QIcon &icon);
2023-09-28 02:55:19 +00:00
void SetAppearanceIcon(const QIcon &icon);
2018-12-14 13:42:05 +00:00
void SetStreamIcon(const QIcon &icon);
void SetOutputIcon(const QIcon &icon);
void SetAudioIcon(const QIcon &icon);
void SetVideoIcon(const QIcon &icon);
void SetHotkeysIcon(const QIcon &icon);
void SetAccessibilityIcon(const QIcon &icon);
2018-12-14 13:42:05 +00:00
void SetAdvancedIcon(const QIcon &icon);
2021-06-27 22:30:00 +00:00
void UseStreamKeyAdvClicked();
2022-12-17 17:26:59 +00:00
void SimpleStreamAudioEncoderChanged();
void AdvAudioEncodersChanged();
protected:
2020-07-19 06:31:15 +00:00
virtual void closeEvent(QCloseEvent *event) override;
virtual void showEvent(QShowEvent *event) override;
void reject() override;
2013-12-11 04:14:20 +00:00
public:
OBSBasicSettings(QWidget *parent);
~OBSBasicSettings();
inline const QIcon &GetHotkeyConflictIcon() const
{
return hotkeyConflictIcon;
}
2013-12-11 04:14:20 +00:00
};