0

I am trying to normalize the audio of a video file (mp4), but ffmpeg is throwing an error..

The command:

ffmpeg -i input.mp4  -af "[0:a]compand=.3|.3:1|1:-90/-60|-60/-40|-40/-30|-20/ -20:6:0:-90:0.2[audio]" -map 0:v -map "[audio]" -codec:v copy output.mp4

The output :

    ffmpeg version N-50911-g9efcfbe Copyright (c) 2000-2013 the FFmpeg developers
  built on Mar 13 2013 21:26:48 with gcc 4.7.2 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libgsm --enable-libilbc --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-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
  libavutil      52. 19.100 / 52. 19.100
  libavcodec     55.  0.100 / 55.  0.100
  libavformat    55.  0.100 / 55.  0.100
  libavdevice    54.  4.100 / 54.  4.100
  libavfilter     3. 45.103 /  3. 45.103
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'filename.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 1
    compatible_brands: isomavc1
    creation_time   : 2015-03-15 13:31:29
  Duration: 02:49:04.00, start: 0.000000, bitrate: 1917 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080, 1819 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 47.95 tbc
    Metadata:
      creation_time   : 2015-03-15 13:31:29
      handler_name    : video.264#trackID=1:fps=23.976 - Imported with GPAC 0.5.0-rev
    Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 93 kb/s
    Metadata:
      creation_time   : 2015-03-15 13:31:43
      handler_name    : GPAC ISO Audio Handler

The error:

Output with label 'audio' does not exist in any defined filter graph, or was already used elsewhere.

I am guessing its a simple syntax issue? But what , have tried various variations to no solution.

1 Answer 1

2

You need to use -filter_complex instead of -af (or -filter:a). The former is needed for filtegraphs with labels and more than one input/output.

ffmpeg -i input.mp4  -filter_complex "[0:a]compand=.3|.3:1|1:-90/-60|-60/-40|-40/-30|-20/ -20:6:0:-90:0.2[audio]" -map 0:v -map "[audio]" -codec:v copy output.mp4

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .