[vlc-commits] [Git][videolan/vlc][master] qt: Volume (gain) control improvement to profile editor

Steve Lhomme (@robUx4) gitlab at videolan.org
Tue Jun 23 19:08:41 UTC 2026



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
6f3408b8 by SK Devane at 2026-06-23T18:50:52+00:00
qt: Volume (gain) control improvement to profile editor

A new QDoubleSpinBox, with a 'Volume' label with up/down arrows, has been

added to the Audio Codec section of the Convert/Save profile editor dialog.

When users select a non-zero volume percentage, the normvol audio filter

will be employed in the transcoding process, with the relevant peak-level

multiplier (i.e. 200% = 2.0x, 0 = 1.0x).

Fixes: #29824

- - - - -


2 changed files:

- modules/gui/qt/dialogs/sout/profile_selector.cpp
- modules/gui/qt/dialogs/sout/profiles.ui


Changes:

=====================================
modules/gui/qt/dialogs/sout/profile_selector.cpp
=====================================
@@ -328,11 +328,30 @@ void VLCProfileSelector::updateOptions( int i )
             HASHPICK( "acodec", "samplerate" );
             transcode.option( "samplerate", value.toInt() );
 
-            HASHPICK( "audio", "filters" );
-            if ( !value.isEmpty() )
+            /* Build audio filter chain: user-selected filters + optional gain boost */
             {
-                QStringList valuesList = QUrl::fromPercentEncoding( value.toLatin1() ).split( ";" );
-                transcode.option( "afilter", valuesList.join( ":" ) );
+                QStringList audioFilters;
+
+                HASHPICK( "audio", "filters" );
+                if ( !value.isEmpty() )
+                    audioFilters << QUrl::fromPercentEncoding( value.toLatin1() ).split( ";" );
+
+                HASHPICK( "acodec", "gain" );
+                if ( !value.isEmpty() )
+                {
+                    double gainPct = value.toDouble();
+                    if ( gainPct > 0.0 )
+                    {
+                        /* normvol peak-level multiplier: 100% = 1.0 (no change),
+                         * 200% = 2.0 (double volume), 50% = 0.5 (half volume). */
+                        double gainMult = gainPct / 100.0;
+                        audioFilters.prepend(
+                            QString("normvol{max-level=%1}").arg( gainMult, 0, 'f', 2 ) );
+                    }
+                }
+
+                if ( !audioFilters.isEmpty() )
+                    transcode.option( "afilter", audioFilters.join( ":" ) );
             }
 
         }


=====================================
modules/gui/qt/dialogs/sout/profiles.ui
=====================================
@@ -715,6 +715,45 @@
               <item row="3" column="1">
                <widget class="QComboBox" name="valueholder_acodec_samplerate"/>
               </item>
+              <item row="4" column="0">
+               <widget class="QLabel" name="aGainLabel">
+                <property name="text">
+                 <string>Volume</string>
+                </property>
+                <property name="buddy">
+                 <cstring>valueholder_acodec_gain</cstring>
+                </property>
+               </widget>
+              </item>
+              <item row="4" column="1">
+               <widget class="QDoubleSpinBox" name="valueholder_acodec_gain">
+                <property name="toolTip">
+                 <string>Boost or reduce the audio volume of the output file.
+0 = No change. 100% = original volume. 200% = double volume.</string>
+                </property>
+                <property name="alignment">
+                 <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+                </property>
+                <property name="specialValueText">
+                 <string>No change</string>
+                </property>
+                <property name="suffix">
+                 <string> %</string>
+                </property>
+                <property name="minimum">
+                 <double>0.000000</double>
+                </property>
+                <property name="maximum">
+                 <double>400.000000</double>
+                </property>
+                <property name="singleStep">
+                 <double>10.000000</double>
+                </property>
+                <property name="value">
+                 <double>0.000000</double>
+                </property>
+               </widget>
+              </item>
              </layout>
             </widget>
             <widget class="QWidget" name="tab_4">



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/6f3408b87f612e4ebca2d88e2324d7e075b80023

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/6f3408b87f612e4ebca2d88e2324d7e075b80023
You're receiving this email because of your account on code.videolan.org. Manage all notifications: https://code.videolan.org/-/profile/notifications | Help: https://code.videolan.org/help




More information about the vlc-commits mailing list