Opened 10 years ago

Closed 10 years ago

#3234 closed enhancement (fixed)

Eval in volume filter problem

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

Description

Summary of the bug:

ffmpeg can not eval - and + operatoors in volume filter

How to reproduce:

d:\>ffmpeg -i input.flac -af volume=0.1+0.2 output.flac
ffmpeg version N-59275-g9b195dd Copyright (c) 2000-2013 the FFmpeg developers
  built on Dec 21 2013 22:06:20 with gcc 4.8.2 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
  libavutil      52. 58.101 / 52. 58.101
  libavcodec     55. 45.103 / 55. 45.103
  libavformat    55. 22.100 / 55. 22.100
  libavdevice    55.  5.102 / 55.  5.102
  libavfilter     4.  0.100 /  4.  0.100
  libswscale      2.  5.101 /  2.  5.101
  libswresample   0. 17.104 /  0. 17.104
  libpostproc    52.  3.100 / 52.  3.100
Input #0, flac, from 'input.flac':
  Metadata:
    track           : 1
  Duration: 00:04:26.59, bitrate: 756 kb/s
    Stream #0:0: Audio: flac, 44100 Hz, stereo, s16
[volume @ 00000000026b98c0] [Eval @ 000000000022a9c0] Undefined constant or missing '(' in ''
[volume @ 00000000026b98c0] Unable to parse option value "+0.2"
[volume @ 00000000026b98c0] [Eval @ 000000000022aa10] Undefined constant or missing '(' in ''
[volume @ 00000000026b98c0] Unable to parse option value "+0.2"
[volume @ 00000000026b98c0] Error setting option volume to value 0.1+0.2.
[Parsed_volume_0 @ 00000000026d0300] Error applying options to the filter.
[AVFilterGraph @ 00000000026733c0] Error initializing filter 'volume' with args '0.1+0.2'
Error opening filters!
d:\>ffmpeg -i input.flac -af volume=sin(-0.1) output.flac
ffmpeg version N-59275-g9b195dd Copyright (c) 2000-2013 the FFmpeg developers
  built on Dec 21 2013 22:06:20 with gcc 4.8.2 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
  libavutil      52. 58.101 / 52. 58.101
  libavcodec     55. 45.103 / 55. 45.103
  libavformat    55. 22.100 / 55. 22.100
  libavdevice    55.  5.102 / 55.  5.102
  libavfilter     4.  0.100 /  4.  0.100
  libswscale      2.  5.101 /  2.  5.101
  libswresample   0. 17.104 /  0. 17.104
  libpostproc    52.  3.100 / 52.  3.100
Input #0, flac, from 'input.flac':
  Metadata:
    track           : 1
  Duration: 00:04:26.59, bitrate: 756 kb/s
    Stream #0:0: Audio: flac, 44100 Hz, stereo, s16
File 'output.flac' already exists. Overwrite ? [y/N] y
[volume @ 000000000034b200] [Eval @ 000000000022a9c0] Undefined constant or missing '(' in ''
[volume @ 000000000034b200] Unable to parse option value "sin(-0.1)"
[volume @ 000000000034b200] [Eval @ 000000000022aa10] Undefined constant or missing '(' in ''
[volume @ 000000000034b200] Unable to parse option value "sin(-0.1)"
[volume @ 000000000034b200] Error setting option volume to value sin(-0.1).
[Parsed_volume_0 @ 0000000002787ea0] Error applying options to the filter.
[AVFilterGraph @ 0000000000303320] Error initializing filter 'volume' with args 'sin(-0.1)'
Error opening filters!

Change History (4)

comment:1 by Carl Eugen Hoyos, 10 years ago

Component: FFmpegavfilter
Keywords: volume added
Priority: normalwish
Status: newopen
Type: defectenhancement

comment:2 by Alex-Frst, 10 years ago

type: defect => enhancement

Smth like this works fine, for example:

ffmpeg -i input.flac -af volume=sin(0.1*2.2/0.21)*2 output.flac

Is problem with + and - operators really a feature but not a defect?

in reply to:  2 comment:3 by Carl Eugen Hoyos, 10 years ago

Priority: wishnormal
Type: enhancementdefect

Replying to Ajaja:

type: defect => enhancement

Smth like this works fine, for example:

ffmpeg -i input.flac -af volume=sin(0.1*2.2/0.21)*2 output.flac

Is problem with + and - operators really a feature but not a defect?

I agree that this is at least not completely clear.

comment:4 by Stefano Sabatini, 10 years ago

Analyzed by developer: set
Reproduced by developer: set
Resolution: fixed
Status: openclosed
Type: defectenhancement

When you assign an option constant you should not rely on expressions such as CONST op CONST.

Anyway the volume syntax was extended in:

commit 7619a87cc8b9a1ac6ea6cf03b674f5a74b1ac90c
Author: Stefano Sabatini <stefasab@gmail.com>
Date:   Sat Feb 23 00:17:17 2013 +0100

    lavfi/volume: support volume expression and per-frame expression evaluation
    
    The eval mode allows to evaluate the expression per-frame or just at
    init.
    
    In particular, address ticket #3234.

and thus such expression is now admitted by the volume syntax.

Note: See TracTickets for help on using tickets.