2013-12-11 20:50:10 -08:00
|
|
|
/******************************************************************************
|
|
|
|
Copyright (C) 2013 by Hugh Bailey <obs.jim@gmail.com>
|
2015-02-16 23:45:34 -08:00
|
|
|
Philippe Groarke <philippe.groarke@gmail.com>
|
2013-12-11 20:50:10 -08:00
|
|
|
|
|
|
|
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-10 20:14:20 -08:00
|
|
|
#pragma once
|
|
|
|
|
2014-01-26 14:36:15 -08:00
|
|
|
#include <util/util.hpp>
|
2014-01-24 20:19:50 -08:00
|
|
|
#include <QDialog>
|
2013-12-12 20:47:42 -08:00
|
|
|
#include <memory>
|
2015-02-16 23:45:34 -08:00
|
|
|
#include <string>
|
2013-12-10 20:14:20 -08:00
|
|
|
|
2015-03-28 00:21:16 -07:00
|
|
|
#include <libff/ff-util.h>
|
|
|
|
|
2014-03-07 11:56:31 -08:00
|
|
|
#include <obs.h>
|
|
|
|
|
2014-03-06 20:08:12 -08:00
|
|
|
class OBSBasic;
|
2014-01-24 20:19:50 -08:00
|
|
|
class QAbstractButton;
|
2014-03-07 11:56:31 -08:00
|
|
|
class QComboBox;
|
2015-05-25 01:37:13 -07:00
|
|
|
class QCheckBox;
|
2015-06-17 12:07:55 -07:00
|
|
|
class QLabel;
|
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 01:49:07 -07:00
|
|
|
class OBSPropertiesView;
|
2014-11-01 13:50:36 -07:00
|
|
|
class OBSHotkeyWidget;
|
2014-01-24 20:19:50 -08:00
|
|
|
|
|
|
|
#include "ui_OBSBasicSettings.h"
|
2013-12-10 20:14:20 -08:00
|
|
|
|
2015-04-30 22:07:42 -07:00
|
|
|
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);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2015-03-28 00:21:16 -07:00
|
|
|
class OBSFFDeleter
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
void operator()(const ff_format_desc *format)
|
|
|
|
{
|
|
|
|
ff_format_desc_free(format);
|
|
|
|
}
|
|
|
|
void operator()(const ff_codec_desc *codec)
|
|
|
|
{
|
|
|
|
ff_codec_desc_free(codec);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
using OBSFFCodecDesc = std::unique_ptr<const ff_codec_desc,
|
|
|
|
OBSFFDeleter>;
|
|
|
|
using OBSFFFormatDesc = std::unique_ptr<const ff_format_desc,
|
|
|
|
OBSFFDeleter>;
|
|
|
|
|
2014-01-24 20:19:50 -08:00
|
|
|
class OBSBasicSettings : public QDialog {
|
|
|
|
Q_OBJECT
|
2013-12-11 20:50:10 -08:00
|
|
|
|
2014-01-24 20:19:50 -08:00
|
|
|
private:
|
2014-03-06 20:08:12 -08:00
|
|
|
OBSBasic *main;
|
|
|
|
|
2014-01-24 20:19:50 -08:00
|
|
|
std::unique_ptr<Ui::OBSBasicSettings> ui;
|
2014-11-01 13:50:36 -07:00
|
|
|
|
2015-02-03 20:19:48 -08:00
|
|
|
bool generalChanged = false;
|
2015-02-07 08:09:57 -08:00
|
|
|
bool stream1Changed = false;
|
2015-02-03 20:19:48 -08:00
|
|
|
bool outputsChanged = false;
|
|
|
|
bool audioChanged = false;
|
|
|
|
bool videoChanged = false;
|
2014-11-01 13:50:36 -07:00
|
|
|
bool hotkeysChanged = false;
|
2015-02-11 12:55:06 -08:00
|
|
|
bool advancedChanged = false;
|
2015-02-03 20:19:48 -08:00
|
|
|
int pageIndex = 0;
|
|
|
|
bool loading = true;
|
2015-02-16 23:45:34 -08:00
|
|
|
std::string savedTheme;
|
2015-02-03 20:19:48 -08:00
|
|
|
|
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-18 22:29:36 -07:00
|
|
|
int lastSimpleRecQualityIdx = 0;
|
|
|
|
|
2015-03-28 00:21:16 -07:00
|
|
|
OBSFFFormatDesc formats;
|
|
|
|
|
2015-02-03 20:19:48 -08:00
|
|
|
OBSPropertiesView *streamProperties = nullptr;
|
2015-01-26 13:41:22 -08:00
|
|
|
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 01:49:07 -07:00
|
|
|
|
2015-06-17 12:07:55 -07: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-18 22:29:36 -07:00
|
|
|
QPointer<QLabel> simpleOutRecWarning;
|
2015-06-17 12:07:55 -07:00
|
|
|
|
2015-04-30 22:07:42 -07:00
|
|
|
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;
|
|
|
|
|
2014-11-01 13:50:36 -07:00
|
|
|
std::vector<std::pair<bool, QPointer<OBSHotkeyWidget>>> hotkeys;
|
|
|
|
OBSSignal hotkeyRegistered;
|
|
|
|
OBSSignal hotkeyUnregistered;
|
|
|
|
|
2014-06-23 19:54:20 -07:00
|
|
|
void SaveCombo(QComboBox *widget, const char *section,
|
|
|
|
const char *value);
|
|
|
|
void SaveComboData(QComboBox *widget, const char *section,
|
|
|
|
const char *value);
|
2015-01-26 13:41:22 -08:00
|
|
|
void SaveCheckBox(QAbstractButton *widget, const char *section,
|
|
|
|
const char *value, bool invert = false);
|
2014-06-23 19:54:20 -07:00
|
|
|
void SaveEdit(QLineEdit *widget, const char *section,
|
|
|
|
const char *value);
|
|
|
|
void SaveSpinBox(QSpinBox *widget, const char *section,
|
|
|
|
const char *value);
|
2015-03-28 00:21:16 -07:00
|
|
|
void SaveFormat(QComboBox *combo);
|
|
|
|
void SaveEncoder(QComboBox *combo, const char *section,
|
|
|
|
const char *value);
|
2014-06-23 19:54:20 -07:00
|
|
|
|
2014-01-26 14:36:15 -08:00
|
|
|
inline bool Changed() const
|
|
|
|
{
|
2015-02-07 08:09:57 -08:00
|
|
|
return generalChanged || outputsChanged || stream1Changed ||
|
2014-11-01 13:50:36 -07:00
|
|
|
audioChanged || videoChanged || advancedChanged ||
|
|
|
|
hotkeysChanged;
|
2014-01-26 14:36:15 -08:00
|
|
|
}
|
|
|
|
|
2014-05-09 15:04:39 -07:00
|
|
|
inline void EnableApplyButton(bool en)
|
|
|
|
{
|
|
|
|
ui->buttonBox->button(QDialogButtonBox::Apply)->setEnabled(en);
|
|
|
|
}
|
|
|
|
|
2014-01-26 14:36:15 -08:00
|
|
|
inline void ClearChanged()
|
|
|
|
{
|
|
|
|
generalChanged = false;
|
2015-02-07 08:09:57 -08:00
|
|
|
stream1Changed = false;
|
2014-01-26 14:36:15 -08:00
|
|
|
outputsChanged = false;
|
|
|
|
audioChanged = false;
|
|
|
|
videoChanged = false;
|
2014-11-01 13:50:36 -07:00
|
|
|
hotkeysChanged = false;
|
2015-02-11 12:55:06 -08:00
|
|
|
advancedChanged= false;
|
2014-05-09 15:04:39 -07:00
|
|
|
EnableApplyButton(false);
|
2014-01-26 14:36:15 -08:00
|
|
|
}
|
|
|
|
|
2015-05-25 01:37:13 -07:00
|
|
|
#ifdef _WIN32
|
|
|
|
bool aeroWasDisabled = false;
|
|
|
|
QCheckBox *toggleAero = nullptr;
|
|
|
|
void ToggleDisableAero(bool checked);
|
|
|
|
#endif
|
|
|
|
|
2014-03-07 11:56:31 -08:00
|
|
|
void HookWidget(QWidget *widget, const char *signal, const char *slot);
|
|
|
|
|
2014-01-26 14:36:15 -08:00
|
|
|
bool QueryChanges();
|
|
|
|
|
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 01:49:07 -07:00
|
|
|
void LoadServiceTypes();
|
2015-01-26 13:41:22 -08:00
|
|
|
void LoadEncoderTypes();
|
2015-02-11 12:55:06 -08:00
|
|
|
void LoadColorRanges();
|
2015-03-28 00:21:16 -07:00
|
|
|
void LoadFormats();
|
|
|
|
void ReloadCodecs(const ff_format_desc *formatDesc);
|
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 01:49:07 -07:00
|
|
|
|
2014-01-26 14:36:15 -08:00
|
|
|
void LoadGeneralSettings();
|
2015-02-07 08:09:57 -08:00
|
|
|
void LoadStream1Settings();
|
2014-03-10 13:10:35 -07:00
|
|
|
void LoadOutputSettings();
|
2014-02-23 15:27:19 -08:00
|
|
|
void LoadAudioSettings();
|
2014-01-26 14:36:15 -08:00
|
|
|
void LoadVideoSettings();
|
2014-11-01 13:50:36 -07:00
|
|
|
void LoadHotkeySettings(obs_hotkey_id ignoreKey=OBS_INVALID_HOTKEY_ID);
|
2015-02-11 12:55:06 -08:00
|
|
|
void LoadAdvancedSettings();
|
2014-02-23 15:27:19 -08:00
|
|
|
void LoadSettings(bool changedOnly);
|
2014-01-26 14:36:15 -08:00
|
|
|
|
2015-01-26 13:41:22 -08:00
|
|
|
OBSPropertiesView *CreateEncoderPropertyView(const char *encoder,
|
|
|
|
const char *path, bool changed = false);
|
|
|
|
|
2014-01-26 14:36:15 -08:00
|
|
|
/* general */
|
|
|
|
void LoadLanguageList();
|
2015-02-16 23:45:34 -08:00
|
|
|
void LoadThemeList();
|
2014-01-26 14:36:15 -08:00
|
|
|
|
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 01:49:07 -07:00
|
|
|
/* output */
|
|
|
|
void LoadSimpleOutputSettings();
|
2015-01-26 13:41:22 -08:00
|
|
|
void LoadAdvOutputStreamingSettings();
|
|
|
|
void LoadAdvOutputStreamingEncoderProperties();
|
|
|
|
void LoadAdvOutputRecordingSettings();
|
|
|
|
void LoadAdvOutputRecordingEncoderProperties();
|
|
|
|
void LoadAdvOutputFFmpegSettings();
|
|
|
|
void LoadAdvOutputAudioSettings();
|
2015-03-28 00:21:16 -07:00
|
|
|
void SetAdvOutputFFmpegEnablement(
|
|
|
|
ff_codec_type 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 01:49:07 -07:00
|
|
|
|
2014-03-06 06:02:25 -08:00
|
|
|
/* audio */
|
2015-06-23 18:47:22 -07:00
|
|
|
void LoadListValues(QComboBox *widget, obs_property_t *prop, int index);
|
2014-03-06 06:02:25 -08:00
|
|
|
void LoadAudioDevices();
|
2015-04-30 22:07:42 -07:00
|
|
|
void LoadAudioSources();
|
2014-03-06 06:02:25 -08:00
|
|
|
|
2014-01-26 14:36:15 -08:00
|
|
|
/* video */
|
|
|
|
void LoadRendererList();
|
2015-02-08 01:29:15 -08:00
|
|
|
void ResetDownscales(uint32_t cx, uint32_t cy,
|
|
|
|
uint32_t out_cx, uint32_t out_cy);
|
2014-12-15 01:08:46 -08:00
|
|
|
void LoadDownscaleFilters();
|
2014-01-26 14:36:15 -08:00
|
|
|
void LoadResolutionLists();
|
|
|
|
void LoadFPSData();
|
|
|
|
|
|
|
|
void SaveGeneralSettings();
|
2015-02-07 08:09:57 -08:00
|
|
|
void SaveStream1Settings();
|
2014-03-10 13:10:35 -07:00
|
|
|
void SaveOutputSettings();
|
2014-02-23 15:27:19 -08:00
|
|
|
void SaveAudioSettings();
|
2014-01-26 14:36:15 -08:00
|
|
|
void SaveVideoSettings();
|
2014-11-01 13:50:36 -07:00
|
|
|
void SaveHotkeySettings();
|
2015-02-11 12:55:06 -08:00
|
|
|
void SaveAdvancedSettings();
|
2014-01-26 14:36:15 -08:00
|
|
|
void SaveSettings();
|
2013-12-17 12:56:58 -08:00
|
|
|
|
2015-09-06 16:12:03 -07:00
|
|
|
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-18 22:29:36 -07:00
|
|
|
void FillSimpleRecordingValues();
|
|
|
|
|
2014-01-24 20:19:50 -08:00
|
|
|
private slots:
|
2015-02-16 23:45:34 -08:00
|
|
|
void on_theme_activated(int idx);
|
|
|
|
|
2014-01-26 14:36:15 -08:00
|
|
|
void on_listWidget_itemSelectionChanged();
|
2014-01-24 20:19:50 -08:00
|
|
|
void on_buttonBox_clicked(QAbstractButton *button);
|
|
|
|
|
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 01:49:07 -07:00
|
|
|
void on_streamType_currentIndexChanged(int idx);
|
2014-05-20 23:27:27 -07:00
|
|
|
void on_simpleOutputBrowse_clicked();
|
2015-01-26 13:41:22 -08:00
|
|
|
void on_advOutRecPathBrowse_clicked();
|
|
|
|
void on_advOutFFPathBrowse_clicked();
|
|
|
|
void on_advOutEncoder_currentIndexChanged(int idx);
|
|
|
|
void on_advOutRecEncoder_currentIndexChanged(int idx);
|
2015-03-28 00:21:16 -07:00
|
|
|
void on_advOutFFFormat_currentIndexChanged(int idx);
|
|
|
|
void on_advOutFFAEncoder_currentIndexChanged(int idx);
|
|
|
|
void on_advOutFFVEncoder_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 01:49:07 -07:00
|
|
|
|
2015-04-17 23:40:35 -07:00
|
|
|
void on_colorFormat_currentIndexChanged(const QString &text);
|
|
|
|
|
2014-01-26 14:36:15 -08:00
|
|
|
void on_baseResolution_editTextChanged(const QString &text);
|
2014-03-07 11:56:31 -08:00
|
|
|
|
|
|
|
void GeneralChanged();
|
|
|
|
void AudioChanged();
|
|
|
|
void AudioChangedRestart();
|
2015-04-30 22:07:42 -07:00
|
|
|
void ReloadAudioSources();
|
2014-03-10 13:10:35 -07:00
|
|
|
void OutputsChanged();
|
2015-02-07 08:09:57 -08:00
|
|
|
void Stream1Changed();
|
2014-03-07 11:56:31 -08:00
|
|
|
void VideoChanged();
|
|
|
|
void VideoChangedResolution();
|
|
|
|
void VideoChangedRestart();
|
2014-11-01 13:50:36 -07:00
|
|
|
void HotkeysChanged();
|
|
|
|
void ReloadHotkeys(obs_hotkey_id ignoreKey=OBS_INVALID_HOTKEY_ID);
|
2015-02-11 12:55:06 -08:00
|
|
|
void AdvancedChanged();
|
|
|
|
void AdvancedChangedRestart();
|
2014-01-26 14:36:15 -08:00
|
|
|
|
2015-09-06 16:12:03 -07:00
|
|
|
void UpdateStreamDelayEstimate();
|
|
|
|
|
2015-06-17 12:07:55 -07:00
|
|
|
void AdvOutRecCheckWarnings();
|
|
|
|
|
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-18 22:29:36 -07:00
|
|
|
void SimpleRecordingQualityChanged();
|
|
|
|
void SimpleRecordingEncoderChanged();
|
|
|
|
void SimpleRecordingQualityLosslessWarning(int idx);
|
|
|
|
|
2014-01-24 20:19:50 -08:00
|
|
|
protected:
|
|
|
|
virtual void closeEvent(QCloseEvent *event);
|
2013-12-17 12:56:58 -08:00
|
|
|
|
2013-12-10 20:14:20 -08:00
|
|
|
public:
|
2014-01-24 20:19:50 -08:00
|
|
|
OBSBasicSettings(QWidget *parent);
|
2013-12-10 20:14:20 -08:00
|
|
|
};
|