Opened 5 years ago

Closed 5 years ago

#720 closed defect (invalid)

Volume filter does not work

Reported by: jeremysalwen Owned by:
Priority: normal Component: avfilter
Version: git-master Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: yes

Description

What you were trying to accomplish:

Test a libavfilter filter in ffmpeg.

The problem you encountered:

the libavfilter filter "volume" had no effect on the audio.

Console output:

$ ./ffmpeg -v 9 -loglevel 99 -i ~/write.wav -vf volume=0.1 ~/lol.wav
ffmpeg version N-35540-g0cc9949, Copyright (c) 2000-2011 the FFmpeg developers

built on Dec 7 2011 22:26:02 with gcc 4.6.1
configuration: --enable-filter=earwax
libavutil 51. 30. 0 / 51. 30. 0
libavcodec 53. 41. 2 / 53. 41. 2
libavformat 53. 24. 0 / 53. 24. 0
libavdevice 53. 4. 0 / 53. 4. 0
libavfilter 2. 51. 0 / 2. 51. 0
libswscale 2. 1. 0 / 2. 1. 0

[wav @ 0x2f857e0] Format wav probed with size=2048 and score=99
[pcm_s16le @ 0x2f8bc00] err{or,}_recognition separate: 1; 1
[pcm_s16le @ 0x2f8bc00] err{or,}_recognition combined: 1; 65537
[wav @ 0x2f857e0] parser not found for codec pcm_s16le, packets or times may be invalid.
[wav @ 0x2f857e0] max_analyze_duration 5000000 reached at 5015510
Input #0, wav, from '/home/jeremy/write.wav':

Duration: 00:04:01.86, bitrate: 1411 kb/s

Stream #0:0, 218, 1/44100: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, 2 channels, s16, 1411 kb/s

[pcm_s16le @ 0x302d0e0] err{or,}_recognition separate: 1; 1
[pcm_s16le @ 0x302d0e0] err{or,}_recognition combined: 1; 65537
[pcm_s16le @ 0x2f8bc00] err{or,}_recognition separate: 1; 65537
[pcm_s16le @ 0x2f8bc00] err{or,}_recognition combined: 1; 65537
Output #0, wav, to '/home/jeremy/lol.wav':

Metadata:

encoder : Lavf53.24.0
Stream #0:0, 0, 1/44100: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, 2 channels, s16, 1411 kb/s

Stream mapping:

Stream #0:0 -> #0:0 (pcm_s16le -> pcm_s16le)

Press [q] to stop, ? for help
size= 41665kB time=00:04:01.86 bitrate=1411.2kbits/s
video:0kB audio:41665kB global headers:0kB muxing overhead 0.000108%

Change History (2)

comment:1 follow-up: Changed 5 years ago by jeremysalwen

Also note that with -af I get

./ffmpeg -v 9 -loglevel 99 -i ~/write.wav -af volume=0.1 ~/lol.wav
ffmpeg version N-35540-g0cc9949, Copyright (c) 2000-2011 the FFmpeg developers

built on Dec 7 2011 22:26:02 with gcc 4.6.1
configuration: --enable-filter=earwax
libavutil 51. 30. 0 / 51. 30. 0
libavcodec 53. 41. 2 / 53. 41. 2
libavformat 53. 24. 0 / 53. 24. 0
libavdevice 53. 4. 0 / 53. 4. 0
libavfilter 2. 51. 0 / 2. 51. 0
libswscale 2. 1. 0 / 2. 1. 0

[wav @ 0x20e07e0] Format wav probed with size=2048 and score=99
[pcm_s16le @ 0x20e6c00] err{or,}_recognition separate: 1; 1
[pcm_s16le @ 0x20e6c00] err{or,}_recognition combined: 1; 65537
[wav @ 0x20e07e0] parser not found for codec pcm_s16le, packets or times may be invalid.
[wav @ 0x20e07e0] max_analyze_duration 5000000 reached at 5015510
Input #0, wav, from '/home/jeremy/write.wav':

Duration: 00:04:01.86, bitrate: 1411 kb/s

Stream #0:0, 218, 1/44100: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, 2 channels, s16, 1411 kb/s

Unrecognized option 'af'
Failed to set value 'volume=0.1' for option 'af'

comment:2 in reply to: ↑ 1 Changed 5 years ago by saste

  • Analyzed by developer set
  • Reproduced by developer set
  • Resolution set to invalid
  • Status changed from new to closed

Replying to jeremysalwen:

Also note that with -af I get

./ffmpeg -v 9 -loglevel 99 -i ~/write.wav -af volume=0.1 ~/lol.wav
ffmpeg version N-35540-g0cc9949, Copyright (c) 2000-2011 the FFmpeg developers

built on Dec 7 2011 22:26:02 with gcc 4.6.1
configuration: --enable-filter=earwax
libavutil 51. 30. 0 / 51. 30. 0
libavcodec 53. 41. 2 / 53. 41. 2
libavformat 53. 24. 0 / 53. 24. 0
libavdevice 53. 4. 0 / 53. 4. 0
libavfilter 2. 51. 0 / 2. 51. 0
libswscale 2. 1. 0 / 2. 1. 0

[...]

Unrecognized option 'af'
Failed to set value 'volume=0.1' for option 'af'

Hi, this is correct, -af was never integrated in the main repository, and using -vf for audio filters i evidently wrong, so the only way to use audio filtering is through the lavfi input device.

You use it this way:

ffmpeg -f lavfi -i "amovie=INFILE,volume=0.1" OUTFILE

Closing the ticket as invalid, feel free to add a feature request for integrating -af into the main repository so you can track it.

Note: See TracTickets for help on using tickets.