From 724644ef03ed3657d674b78d3ea5e874562db37a Mon Sep 17 00:00:00 2001 From: jp9000 Date: Fri, 17 Apr 2015 23:40:35 -0700 Subject: [PATCH] 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. --- obs/data/locale/en-US.ini | 1 + obs/forms/OBSBasicSettings.ui | 16 ++++++++++++++++ obs/window-basic-settings.cpp | 11 +++++++++++ obs/window-basic-settings.hpp | 2 ++ 4 files changed, 30 insertions(+) diff --git a/obs/data/locale/en-US.ini b/obs/data/locale/en-US.ini index 35c0f25ba..818e0813e 100644 --- a/obs/data/locale/en-US.ini +++ b/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" diff --git a/obs/forms/OBSBasicSettings.ui b/obs/forms/OBSBasicSettings.ui index ffae1de54..9726f64fb 100644 --- a/obs/forms/OBSBasicSettings.ui +++ b/obs/forms/OBSBasicSettings.ui @@ -2518,6 +2518,22 @@ + + true + + + + + + + color: rgb(255, 0, 4); + + + + + + true + diff --git a/obs/window-basic-settings.cpp b/obs/window-basic-settings.cpp index fafd3e3e5..3b2347d9a 100644 --- a/obs/window-basic-settings.cpp +++ b/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) diff --git a/obs/window-basic-settings.hpp b/obs/window-basic-settings.hpp index f6da637e1..93bf7b9d2 100644 --- a/obs/window-basic-settings.hpp +++ b/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();