mirror of
https://github.com/obsproject/obs-studio.git
synced 2024-07-19 17:49:14 +00:00
UI: Add gop size option for custom ffmpeg output
Closes jp9000/obs-studio#804
This commit is contained in:
parent
bb51d3d2f8
commit
1fd302218b
|
@ -538,6 +538,7 @@ Basic.Settings.Output.Adv.FFmpeg.VEncoderSettings="Video Encoder Settings (if an
|
|||
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 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"
|
||||
|
|
|
@ -1951,7 +1951,30 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="1">
|
||||
<widget class="QSpinBox" name="advOutFFVGOPSize">
|
||||
<property name="maximum">
|
||||
<number>1000000000</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>250</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" 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">
|
||||
<widget class="QCheckBox" name="advOutFFUseRescale">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Expanding">
|
||||
|
@ -1967,7 +1990,7 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="1">
|
||||
<item row="8" column="1">
|
||||
<widget class="QComboBox" name="advOutFFRescale">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
|
@ -1977,7 +2000,7 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="0">
|
||||
<item row="9" column="0">
|
||||
<widget class="QLabel" name="label_37">
|
||||
<property name="text">
|
||||
<string>Basic.Settings.Output.Adv.FFmpeg.VEncoder</string>
|
||||
|
@ -1987,10 +2010,10 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="1">
|
||||
<item row="9" column="1">
|
||||
<widget class="QComboBox" name="advOutFFVEncoder"/>
|
||||
</item>
|
||||
<item row="10" column="0">
|
||||
<item row="11" column="0">
|
||||
<widget class="QLabel" name="label_38">
|
||||
<property name="text">
|
||||
<string>Basic.Settings.Output.Adv.FFmpeg.VEncoderSettings</string>
|
||||
|
@ -2000,10 +2023,10 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="1">
|
||||
<item row="11" column="1">
|
||||
<widget class="QLineEdit" name="advOutFFVCfg"/>
|
||||
</item>
|
||||
<item row="11" column="0">
|
||||
<item row="12" column="0">
|
||||
<widget class="QLabel" name="label_41">
|
||||
<property name="text">
|
||||
<string>Basic.Settings.Output.AudioBitrate</string>
|
||||
|
@ -2013,7 +2036,7 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="11" column="1">
|
||||
<item row="12" column="1">
|
||||
<widget class="QSpinBox" name="advOutFFABitrate">
|
||||
<property name="minimum">
|
||||
<number>32</number>
|
||||
|
@ -2029,14 +2052,14 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="12" column="0">
|
||||
<item row="13" column="0">
|
||||
<widget class="QLabel" name="label_47">
|
||||
<property name="text">
|
||||
<string>Basic.Settings.Output.Adv.AudioTrack</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="12" column="1">
|
||||
<item row="13" column="1">
|
||||
<widget class="QWidget" name="widget_10" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
||||
|
@ -2105,7 +2128,7 @@
|
|||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="13" column="0">
|
||||
<item row="14" column="0">
|
||||
<widget class="QLabel" name="label_39">
|
||||
<property name="text">
|
||||
<string>Basic.Settings.Output.Adv.FFmpeg.AEncoder</string>
|
||||
|
@ -2115,10 +2138,10 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="13" column="1">
|
||||
<item row="14" column="1">
|
||||
<widget class="QComboBox" name="advOutFFAEncoder"/>
|
||||
</item>
|
||||
<item row="14" column="0">
|
||||
<item row="15" column="0">
|
||||
<widget class="QLabel" name="label_46">
|
||||
<property name="text">
|
||||
<string>Basic.Settings.Output.Adv.FFmpeg.AEncoderSettings</string>
|
||||
|
@ -2128,7 +2151,7 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="14" column="1">
|
||||
<item row="15" column="1">
|
||||
<widget class="QLineEdit" name="advOutFFACfg"/>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
|
@ -4132,6 +4155,7 @@
|
|||
<tabstop>advOutFFURL</tabstop>
|
||||
<tabstop>advOutFFFormat</tabstop>
|
||||
<tabstop>advOutFFVBitrate</tabstop>
|
||||
<tabstop>advOutFFVGOPSize</tabstop>
|
||||
<tabstop>advOutFFUseRescale</tabstop>
|
||||
<tabstop>advOutFFRescale</tabstop>
|
||||
<tabstop>advOutFFVEncoder</tabstop>
|
||||
|
|
|
@ -1170,6 +1170,8 @@ inline void AdvancedOutput::SetupFFmpeg()
|
|||
const char *url = config_get_string(main->Config(), "AdvOut", "FFURL");
|
||||
int vBitrate = config_get_int(main->Config(), "AdvOut",
|
||||
"FFVBitrate");
|
||||
int gopSize = config_get_int(main->Config(), "AdvOut",
|
||||
"FFVGOPSize");
|
||||
bool rescale = config_get_bool(main->Config(), "AdvOut",
|
||||
"FFRescale");
|
||||
const char *rescaleRes = config_get_string(main->Config(), "AdvOut",
|
||||
|
@ -1202,6 +1204,7 @@ inline void AdvancedOutput::SetupFFmpeg()
|
|||
obs_data_set_string(settings, "format_name", formatName);
|
||||
obs_data_set_string(settings, "format_mime_type", mimeType);
|
||||
obs_data_set_string(settings, "muxer_settings", muxCustom);
|
||||
obs_data_set_int(settings, "gop_size", gopSize);
|
||||
obs_data_set_int(settings, "video_bitrate", vBitrate);
|
||||
obs_data_set_string(settings, "video_encoder", vEncoder);
|
||||
obs_data_set_int(settings, "video_encoder_id", vEncoderId);
|
||||
|
|
|
@ -974,6 +974,7 @@ bool OBSBasic::InitBasicConfigDefaults()
|
|||
GetDefaultVideoSavePath().c_str());
|
||||
config_set_default_string(basicConfig, "AdvOut", "FFExtension", "mp4");
|
||||
config_set_default_uint (basicConfig, "AdvOut", "FFVBitrate", 2500);
|
||||
config_set_default_uint (basicConfig, "AdvOut", "FFVGOPSize", 250);
|
||||
config_set_default_bool (basicConfig, "AdvOut", "FFUseRescale",
|
||||
false);
|
||||
config_set_default_uint (basicConfig, "AdvOut", "FFABitrate", 160);
|
||||
|
|
|
@ -340,6 +340,7 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
|
|||
HookWidget(ui->advOutFFFormat, COMBO_CHANGED, OUTPUTS_CHANGED);
|
||||
HookWidget(ui->advOutFFMCfg, EDIT_CHANGED, OUTPUTS_CHANGED);
|
||||
HookWidget(ui->advOutFFVBitrate, SCROLL_CHANGED, OUTPUTS_CHANGED);
|
||||
HookWidget(ui->advOutFFVGOPSize, SCROLL_CHANGED, OUTPUTS_CHANGED);
|
||||
HookWidget(ui->advOutFFUseRescale, CHECK_CHANGED, OUTPUTS_CHANGED);
|
||||
HookWidget(ui->advOutFFRescale, CBEDIT_CHANGED, OUTPUTS_CHANGED);
|
||||
HookWidget(ui->advOutFFVEncoder, COMBO_CHANGED, OUTPUTS_CHANGED);
|
||||
|
@ -1558,6 +1559,8 @@ void OBSBasicSettings::LoadAdvOutputFFmpegSettings()
|
|||
"FFMCustom");
|
||||
int videoBitrate = config_get_int(main->Config(), "AdvOut",
|
||||
"FFVBitrate");
|
||||
int gopSize = config_get_int(main->Config(), "AdvOut",
|
||||
"FFVGOPSize");
|
||||
bool rescale = config_get_bool(main->Config(), "AdvOut",
|
||||
"FFRescale");
|
||||
const char *rescaleRes = config_get_string(main->Config(), "AdvOut",
|
||||
|
@ -1586,6 +1589,7 @@ void OBSBasicSettings::LoadAdvOutputFFmpegSettings()
|
|||
SelectFormat(ui->advOutFFFormat, format, mimeType);
|
||||
ui->advOutFFMCfg->setText(muxCustom);
|
||||
ui->advOutFFVBitrate->setValue(videoBitrate);
|
||||
ui->advOutFFVGOPSize->setValue(gopSize);
|
||||
ui->advOutFFUseRescale->setChecked(rescale);
|
||||
ui->advOutFFRescale->setEnabled(rescale);
|
||||
ui->advOutFFRescale->setCurrentText(rescaleRes);
|
||||
|
@ -1701,6 +1705,7 @@ void OBSBasicSettings::SetAdvOutputFFmpegEnablement(
|
|||
switch (encoderType) {
|
||||
case FF_CODEC_VIDEO:
|
||||
ui->advOutFFVBitrate->setEnabled(enabled);
|
||||
ui->advOutFFVGOPSize->setEnabled(enabled);
|
||||
ui->advOutFFUseRescale->setEnabled(enabled);
|
||||
ui->advOutFFRescale->setEnabled(enabled && rescale);
|
||||
ui->advOutFFVEncoder->setEnabled(enabled || enableEncoder);
|
||||
|
@ -2746,6 +2751,7 @@ void OBSBasicSettings::SaveOutputSettings()
|
|||
SaveFormat(ui->advOutFFFormat);
|
||||
SaveEdit(ui->advOutFFMCfg, "AdvOut", "FFMCustom");
|
||||
SaveSpinBox(ui->advOutFFVBitrate, "AdvOut", "FFVBitrate");
|
||||
SaveSpinBox(ui->advOutFFVGOPSize, "AdvOut", "FFVGOPSize");
|
||||
SaveCheckBox(ui->advOutFFUseRescale, "AdvOut", "FFRescale");
|
||||
SaveCombo(ui->advOutFFRescale, "AdvOut", "FFRescaleRes");
|
||||
SaveEncoder(ui->advOutFFVEncoder, "AdvOut", "FFVEncoder");
|
||||
|
|
Loading…
Reference in a new issue