浏览代码

UI: Add warning for non-NV12 color formats

Non-NV12 video formats are primarily intended for recording.  For
streaming, if the libobs color format is not set to NV12, it's likely
that the video frames will have to be converted to NV12, which will use
extra CPU usage.  Due to that fact, it's important to warn the user of
that potential extra increased CPU usage that may be required when
streaming.
jp9000 10 年之前
父节点
当前提交
724644ef03
共有 4 个文件被更改,包括 30 次插入0 次删除
  1. 1 0
      obs/data/locale/en-US.ini
  2. 16 0
      obs/forms/OBSBasicSettings.ui
  3. 11 0
      obs/window-basic-settings.cpp
  4. 2 0
      obs/window-basic-settings.hpp

+ 1 - 0
obs/data/locale/en-US.ini

@@ -333,6 +333,7 @@ Basic.Settings.Audio.AuxDevice3="Mic/Auxiliary Audio Device 3"
 
 # basic mode 'advanced' settings
 Basic.Settings.Advanced="Advanced"
+Basic.Settings.Advanced.FormatWarning="Warning:  Color formats other than NV12 are primarily intended for recording, and are not recommended when streaming.  Streaming may incur increased CPU usage due to color format conversion."
 Basic.Settings.Advanced.Audio.BufferingTime="Audio Buffering Time"
 Basic.Settings.Advanced.Video.ColorFormat="Color Format"
 Basic.Settings.Advanced.Video.ColorSpace="YUV Color Space"

+ 16 - 0
obs/forms/OBSBasicSettings.ui

@@ -2518,6 +2518,22 @@
                   <property name="text">
                    <string notr="true"/>
                   </property>
+                  <property name="wordWrap">
+                   <bool>true</bool>
+                  </property>
+                 </widget>
+                </item>
+                <item>
+                 <widget class="QLabel" name="advancedMsg2">
+                  <property name="styleSheet">
+                   <string notr="true">color: rgb(255, 0, 4);</string>
+                  </property>
+                  <property name="text">
+                   <string notr="true"/>
+                  </property>
+                  <property name="wordWrap">
+                   <bool>true</bool>
+                  </property>
                  </widget>
                 </item>
                </layout>

+ 11 - 0
obs/window-basic-settings.cpp

@@ -1793,6 +1793,17 @@ void OBSBasicSettings::on_advOutFFVEncoder_currentIndexChanged(int idx)
 	}
 }
 
+void OBSBasicSettings::on_colorFormat_currentIndexChanged(const QString &text)
+{
+	bool usingNV12 = text == "NV12";
+
+	if (usingNV12)
+		ui->advancedMsg2->setText(QString());
+	else
+		ui->advancedMsg2->setText(
+				QTStr("Basic.Settings.Advanced.FormatWarning"));
+}
+
 #define INVALID_RES_STR "Basic.Settings.Video.InvalidResolution"
 
 static bool ValidResolutions(Ui::OBSBasicSettings *ui)

+ 2 - 0
obs/window-basic-settings.hpp

@@ -187,6 +187,8 @@ private slots:
 	void on_advOutFFAEncoder_currentIndexChanged(int idx);
 	void on_advOutFFVEncoder_currentIndexChanged(int idx);
 
+	void on_colorFormat_currentIndexChanged(const QString &text);
+
 	void on_baseResolution_editTextChanged(const QString &text);
 
 	void GeneralChanged();