10

With the risk of feeling really really stupid here, but I seem not to be able to set the volume of VLC from command line??

vlc file.mp3 --vol 0

I have read the man pages as well as googled but I can not get the above to work. Also tried --volume 0, -vol 0, -volume 0 (as well as putting the volume option before the file name).

No matter, VLC starts with its preset volume. Using VLC 1.1.5 on Ubuntu. (I intend to use the line in a bash script therefore I can not use the VLC GUI) /J


Update

I have tried different values. I now run vlc with very verbose. This section looks a bit suspicious (but I have no idea how to interpret it!):

[0xb7108d14] main audio output warning: PTS is out of range (-9483), dropping buffer
[0xb7108d14] main audio output warning: PTS is out of range (-35533), dropping buffer
[0x94384ac] mpgatofixed32 audio filter debug: libmad error: bad main_data_begin pointer
[0xb7108d14] pulse audio output debug: Pulse stream started
[0xb7108d14] main audio output warning: output date isn't PTS date, requesting resampling (86708)
Warning: call to rand()
[0xb7108d14] main audio output warning: buffer is 86706 late, triggering upsampling
[0xb7104654] qt4 interface debug: IM: Setting an input
[0xb7108d14] main audio output warning: output date isn't PTS date, requesting resampling (44448)
[0xb7108d14] main audio output warning: audio drift is too big (130928), dropping buffer
[0x94384ac] mpgatofixed32 audio filter debug: libmad error: bad main_data_begin pointer
[0xb7108d14] main audio output debug: audio output is starving (20040), playing silence
[0xb7108d14] main audio output warning: resampling stopped after 16895748 usec (drift: 19049)
Geoff
  • 7,935
  • 3
  • 35
  • 43
Julio
  • 145
  • 1
  • 2
  • 8
  • Current versions of vlc dont support this natively, but you can do it via pulse audio library or with rc interface https://github.com/rhaas80/pa_volume – Hayden Thring Apr 17 '23 at 10:30

4 Answers4

7

Seems to be a known bug. Volume option doesn't have any effect

RandomSF
  • 106
  • 2
1

For anyone that comes by this later, I had to disable the "Save audio" option under the audio settings for this to work. I also had to use one of the other audio settings. Mine was:

--mmdevice-volume=<float [0.000000 .. 1.250000]> 

Other options are

--directx-volume=<float [0.000000 .. 2.000000]> 
--waveout-volume=<float [0.000000 .. 2.000000]> 
Jason Wisely
  • 125
  • 8
1

Further to Jason Wisely's answer, I used the following on VLC version 3.0.6 and it worked to play a song with VLC at 35% volume. The device really matters because neither directx of waveout worked for me.

start "" "C:\Program Files (x86)\VideoLAN\VLC\vlc.exe" --mmdevice-volume=0.35 "F:\Beastmode.mp3"

However, it's somewhat moot because your system volume will determine the apparent volume anyway. So to control the system volume I downloaded nircmd and put it into system32. nircmd uses 65535 as 100% volume, so a 50% volume is 65535 ÷ 2 = 32767.5, and I round to 32767. After that, the following is how I keep a consistent volume of 14% system volume and 80% VLC volume when starting VLC:

nircmd.exe setsysvolume 9200 
start "" "C:\Program Files (x86)\VideoLAN\VLC\vlc.exe" --mmdevice-volume=0.35 "F:\Beastmode.mp3"
Cody Gray - on strike
  • 239,200
  • 50
  • 490
  • 574
0

From the documentation:

  • --volume <integer> sets the level of audio output (between 0 and 1024). Also only applies to local playback (like --noaudio).

Have you tried using any other values besides 0? What about other files (from a source different from the ones you've tried)?

Try using the very verbose (-vv) option to see if it tells you anything.

Dennis Williamson
  • 346,391
  • 90
  • 374
  • 439