mirror of
https://github.com/obsproject/obs-studio.git
synced 2024-07-19 17:49:14 +00:00
UI: Add codec compatability checkbox to ffmpeg output
Closes jp9000/obs-studio#804
This commit is contained in:
parent
ca2bc6b4b0
commit
3fe2a79c81
|
@ -539,6 +539,7 @@ Basic.Settings.Output.Adv.FFmpeg.AEncoder="Audio Encoder"
|
|||
Basic.Settings.Output.Adv.FFmpeg.AEncoderSettings="Audio Encoder Settings (if any)"
|
||||
Basic.Settings.Output.Adv.FFmpeg.MuxerSettings="Muxer Settings (if any)"
|
||||
Basic.Settings.Output.Adv.FFmpeg.GOPSize="Keyframe interval (frames)"
|
||||
Basic.Settings.Output.Adv.FFmpeg.IgnoreCodecCompat="Show all codecs (even if potentially incompatible)"
|
||||
|
||||
# basic mode 'output' settings - advanced section - recording subsection - completer
|
||||
FilenameFormatting.completer="%CCYY-%MM-%DD %hh-%mm-%ss\n%YY-%MM-%DD %hh-%mm-%ss\n%Y-%m-%d %H-%M-%S\n%y-%m-%d %H-%M-%S\n%a %Y-%m-%d %H-%M-%S\n%A %Y-%m-%d %H-%M-%S\n%Y-%b-%d %H-%M-%S\n%Y-%B-%d %H-%M-%S\n%Y-%m-%d %I-%M-%S-%p\n%Y-%m-%d %H-%M-%S-%z\n%Y-%m-%d %H-%M-%S-%Z"
|
||||
|
|
|
@ -1928,7 +1928,7 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<item row="7" column="0">
|
||||
<widget class="QLabel" name="label_40">
|
||||
<property name="text">
|
||||
<string>Basic.Settings.Output.VideoBitrate</string>
|
||||
|
@ -1938,7 +1938,7 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<item row="7" column="1">
|
||||
<widget class="QSpinBox" name="advOutFFVBitrate">
|
||||
<property name="minimum">
|
||||
<number>0</number>
|
||||
|
@ -1951,7 +1951,7 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="1">
|
||||
<item row="8" column="1">
|
||||
<widget class="QSpinBox" name="advOutFFVGOPSize">
|
||||
<property name="maximum">
|
||||
<number>1000000000</number>
|
||||
|
@ -1961,20 +1961,17 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0">
|
||||
<item row="8" column="0">
|
||||
<widget class="QLabel" name="label_63">
|
||||
<property name="text">
|
||||
<string>Basic.Settings.Output.Adv.FFmpeg.GOPSize</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>advOutFFVGOPSize</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="0">
|
||||
<item row="9" column="0">
|
||||
<widget class="QCheckBox" name="advOutFFUseRescale">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Expanding">
|
||||
|
@ -1990,7 +1987,7 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="1">
|
||||
<item row="9" column="1">
|
||||
<widget class="QComboBox" name="advOutFFRescale">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
|
@ -2000,7 +1997,14 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="0">
|
||||
<item row="10" column="1">
|
||||
<widget class="QCheckBox" name="advOutFFIgnoreCompat">
|
||||
<property name="text">
|
||||
<string>Basic.Settings.Output.Adv.FFmpeg.IgnoreCodecCompat</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="11" column="0">
|
||||
<widget class="QLabel" name="label_37">
|
||||
<property name="text">
|
||||
<string>Basic.Settings.Output.Adv.FFmpeg.VEncoder</string>
|
||||
|
@ -2010,10 +2014,10 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="1">
|
||||
<item row="11" column="1">
|
||||
<widget class="QComboBox" name="advOutFFVEncoder"/>
|
||||
</item>
|
||||
<item row="11" column="0">
|
||||
<item row="13" column="0">
|
||||
<widget class="QLabel" name="label_38">
|
||||
<property name="text">
|
||||
<string>Basic.Settings.Output.Adv.FFmpeg.VEncoderSettings</string>
|
||||
|
@ -2023,10 +2027,10 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="11" column="1">
|
||||
<item row="13" column="1">
|
||||
<widget class="QLineEdit" name="advOutFFVCfg"/>
|
||||
</item>
|
||||
<item row="12" column="0">
|
||||
<item row="14" column="0">
|
||||
<widget class="QLabel" name="label_41">
|
||||
<property name="text">
|
||||
<string>Basic.Settings.Output.AudioBitrate</string>
|
||||
|
@ -2036,7 +2040,7 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="12" column="1">
|
||||
<item row="14" column="1">
|
||||
<widget class="QSpinBox" name="advOutFFABitrate">
|
||||
<property name="minimum">
|
||||
<number>32</number>
|
||||
|
@ -2052,14 +2056,14 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="13" column="0">
|
||||
<item row="15" column="0">
|
||||
<widget class="QLabel" name="label_47">
|
||||
<property name="text">
|
||||
<string>Basic.Settings.Output.Adv.AudioTrack</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="13" column="1">
|
||||
<item row="15" column="1">
|
||||
<widget class="QWidget" name="widget_10" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
||||
|
@ -2128,7 +2132,7 @@
|
|||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="14" column="0">
|
||||
<item row="17" column="0">
|
||||
<widget class="QLabel" name="label_39">
|
||||
<property name="text">
|
||||
<string>Basic.Settings.Output.Adv.FFmpeg.AEncoder</string>
|
||||
|
@ -2138,10 +2142,10 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="14" column="1">
|
||||
<item row="17" column="1">
|
||||
<widget class="QComboBox" name="advOutFFAEncoder"/>
|
||||
</item>
|
||||
<item row="15" column="0">
|
||||
<item row="18" column="0">
|
||||
<widget class="QLabel" name="label_46">
|
||||
<property name="text">
|
||||
<string>Basic.Settings.Output.Adv.FFmpeg.AEncoderSettings</string>
|
||||
|
@ -2151,7 +2155,7 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="15" column="1">
|
||||
<item row="18" column="1">
|
||||
<widget class="QLineEdit" name="advOutFFACfg"/>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
|
@ -4158,6 +4162,7 @@
|
|||
<tabstop>advOutFFVGOPSize</tabstop>
|
||||
<tabstop>advOutFFUseRescale</tabstop>
|
||||
<tabstop>advOutFFRescale</tabstop>
|
||||
<tabstop>advOutFFIgnoreCompat</tabstop>
|
||||
<tabstop>advOutFFVEncoder</tabstop>
|
||||
<tabstop>advOutFFVCfg</tabstop>
|
||||
<tabstop>advOutFFABitrate</tabstop>
|
||||
|
|
|
@ -977,6 +977,8 @@ bool OBSBasic::InitBasicConfigDefaults()
|
|||
config_set_default_uint (basicConfig, "AdvOut", "FFVGOPSize", 250);
|
||||
config_set_default_bool (basicConfig, "AdvOut", "FFUseRescale",
|
||||
false);
|
||||
config_set_default_bool (basicConfig, "AdvOut", "FFIgnoreCompat",
|
||||
false);
|
||||
config_set_default_uint (basicConfig, "AdvOut", "FFABitrate", 160);
|
||||
config_set_default_uint (basicConfig, "AdvOut", "FFAudioTrack", 1);
|
||||
|
||||
|
|
|
@ -342,6 +342,7 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
|
|||
HookWidget(ui->advOutFFVBitrate, SCROLL_CHANGED, OUTPUTS_CHANGED);
|
||||
HookWidget(ui->advOutFFVGOPSize, SCROLL_CHANGED, OUTPUTS_CHANGED);
|
||||
HookWidget(ui->advOutFFUseRescale, CHECK_CHANGED, OUTPUTS_CHANGED);
|
||||
HookWidget(ui->advOutFFIgnoreCompat, CHECK_CHANGED, OUTPUTS_CHANGED);
|
||||
HookWidget(ui->advOutFFRescale, CBEDIT_CHANGED, OUTPUTS_CHANGED);
|
||||
HookWidget(ui->advOutFFVEncoder, COMBO_CHANGED, OUTPUTS_CHANGED);
|
||||
HookWidget(ui->advOutFFVCfg, EDIT_CHANGED, OUTPUTS_CHANGED);
|
||||
|
@ -352,7 +353,7 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
|
|||
HookWidget(ui->advOutFFTrack4, CHECK_CHANGED, OUTPUTS_CHANGED);
|
||||
HookWidget(ui->advOutFFTrack5, CHECK_CHANGED, OUTPUTS_CHANGED);
|
||||
HookWidget(ui->advOutFFTrack6, CHECK_CHANGED, OUTPUTS_CHANGED);
|
||||
HookWidget(ui->advOutFFAEncoder, COMBO_CHANGED, OUTPUTS_CHANGED);
|
||||
HookWidget(ui->advOutFFAEncoder, COMBO_CHANGED, OUTPUTS_CHANGED);
|
||||
HookWidget(ui->advOutFFACfg, EDIT_CHANGED, OUTPUTS_CHANGED);
|
||||
HookWidget(ui->advOutTrack1Bitrate, COMBO_CHANGED, OUTPUTS_CHANGED);
|
||||
HookWidget(ui->advOutTrack1Name, EDIT_CHANGED, OUTPUTS_CHANGED);
|
||||
|
@ -813,7 +814,9 @@ void OBSBasicSettings::ReloadCodecs(const ff_format_desc *formatDesc)
|
|||
if (formatDesc == nullptr)
|
||||
return;
|
||||
|
||||
OBSFFCodecDesc codecDescs(ff_codec_supported(formatDesc));
|
||||
bool ignore_compatability = ui->advOutFFIgnoreCompat->isChecked();
|
||||
OBSFFCodecDesc codecDescs(ff_codec_supported(formatDesc,
|
||||
ignore_compatability));
|
||||
|
||||
const ff_codec_desc *codec = codecDescs.get();
|
||||
|
||||
|
@ -1563,6 +1566,8 @@ void OBSBasicSettings::LoadAdvOutputFFmpegSettings()
|
|||
"FFVGOPSize");
|
||||
bool rescale = config_get_bool(main->Config(), "AdvOut",
|
||||
"FFRescale");
|
||||
bool codecCompat = config_get_bool(main->Config(), "AdvOut",
|
||||
"FFIgnoreCompat");
|
||||
const char *rescaleRes = config_get_string(main->Config(), "AdvOut",
|
||||
"FFRescaleRes");
|
||||
const char *vEncoder = config_get_string(main->Config(), "AdvOut",
|
||||
|
@ -1591,6 +1596,7 @@ void OBSBasicSettings::LoadAdvOutputFFmpegSettings()
|
|||
ui->advOutFFVBitrate->setValue(videoBitrate);
|
||||
ui->advOutFFVGOPSize->setValue(gopSize);
|
||||
ui->advOutFFUseRescale->setChecked(rescale);
|
||||
ui->advOutFFIgnoreCompat->setChecked(codecCompat);
|
||||
ui->advOutFFRescale->setEnabled(rescale);
|
||||
ui->advOutFFRescale->setCurrentText(rescaleRes);
|
||||
SelectEncoder(ui->advOutFFVEncoder, vEncoder, vEncoderId);
|
||||
|
@ -2753,6 +2759,7 @@ void OBSBasicSettings::SaveOutputSettings()
|
|||
SaveSpinBox(ui->advOutFFVBitrate, "AdvOut", "FFVBitrate");
|
||||
SaveSpinBox(ui->advOutFFVGOPSize, "AdvOut", "FFVGOPSize");
|
||||
SaveCheckBox(ui->advOutFFUseRescale, "AdvOut", "FFRescale");
|
||||
SaveCheckBox(ui->advOutFFIgnoreCompat, "AdvOut", "FFIgnoreCompat");
|
||||
SaveCombo(ui->advOutFFRescale, "AdvOut", "FFRescaleRes");
|
||||
SaveEncoder(ui->advOutFFVEncoder, "AdvOut", "FFVEncoder");
|
||||
SaveEdit(ui->advOutFFVCfg, "AdvOut", "FFVCustom");
|
||||
|
@ -3110,6 +3117,13 @@ void OBSBasicSettings::on_advOutRecEncoder_currentIndexChanged(int idx)
|
|||
}
|
||||
}
|
||||
|
||||
void OBSBasicSettings::on_advOutFFIgnoreCompat_stateChanged(int)
|
||||
{
|
||||
/* Little hack to reload codecs when checked */
|
||||
on_advOutFFFormat_currentIndexChanged(
|
||||
ui->advOutFFFormat->currentIndex());
|
||||
}
|
||||
|
||||
#define DEFAULT_CONTAINER_STR \
|
||||
QTStr("Basic.Settings.Output.Adv.FFmpeg.FormatDescDef")
|
||||
|
||||
|
|
|
@ -256,6 +256,7 @@ private slots:
|
|||
void on_advOutFFPathBrowse_clicked();
|
||||
void on_advOutEncoder_currentIndexChanged(int idx);
|
||||
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);
|
||||
|
|
Loading…
Reference in a new issue