slhck / ffmpeg-normalize

Audio Normalization for Python/ffmpeg
MIT License
1.25k stars 117 forks source link

Error with astats #168

Closed Vidyaranya closed 2 years ago

Vidyaranya commented 2 years ago

I am running a ffmpeg-normalize command as follows

ffmpeg-normalize asd.wav -nt rms -t=-27 -o asd.wav -ar 16000 -f

But I end up getting an error as follows


  File "/usr/local/bin/ffmpeg-normalize", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.7/dist-packages/ffmpeg_normalize/__main__.py", line 544, in main
    ffmpeg_normalize.run_normalization()
  File "/usr/local/lib/python3.7/dist-packages/ffmpeg_normalize/_ffmpeg_normalize.py", line 195, in run_normalization
    raise e
  File "/usr/local/lib/python3.7/dist-packages/ffmpeg_normalize/_ffmpeg_normalize.py", line 184, in run_normalization
    media_file.run_normalization()
  File "/usr/local/lib/python3.7/dist-packages/ffmpeg_normalize/_media_file.py", line 154, in run_normalization
    self._first_pass()
  File "/usr/local/lib/python3.7/dist-packages/ffmpeg_normalize/_media_file.py", line 183, in _first_pass
    for _ in fun():
  File "/usr/local/lib/python3.7/dist-packages/ffmpeg_normalize/_streams.py", line 155, in parse_astats
    for progress in cmd_runner.run_ffmpeg_command():
  File "/usr/local/lib/python3.7/dist-packages/ffmpeg_normalize/_cmd_utils.py", line 55, in run_ffmpeg_command
    for progress in ff.run_command_with_progress():
  File "/usr/local/lib/python3.7/dist-packages/ffmpeg_progress_yield/ffmpeg_progress_yield.py", line 108, in run_command_with_progress
    "Error running command {}: {}".format(self.cmd, str("\n".join(stderr)))
RuntimeError: Error running command ['/usr/bin/ffmpeg', '-nostdin', '-y', '-i', 'asd.wav', '-filter_complex', '[0:0]astats=measure_overall=Peak_level+RMS_level:measure_perchannel=0', '-vn', '-sn', '-f', 'null', '/dev/null']: ffmpeg version 3.4.8-0ubuntu0.2 Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 7 (Ubuntu 7.5.0-3ubuntu1~18.04)
configuration: --prefix=/usr --extra-version=0ubuntu0.2 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
libavutil      55. 78.100 / 55. 78.100
libavcodec     57.107.100 / 57.107.100
libavformat    57. 83.100 / 57. 83.100
libavdevice    57. 10.100 / 57. 10.100
libavfilter     6.107.100 /  6.107.100
libavresample   3.  7.  0 /  3.  7.  0
libswscale      4.  8.100 /  4.  8.100
libswresample   2.  9.100 /  2.  9.100
libpostproc    54.  7.100 / 54.  7.100
Guessed Channel Layout for Input Stream #0.0 : stereo
Input #0, wav, from 'asd.wav':
Metadata:
encoder         : Lavf58.76.100
Duration: 00:02:18.15, bitrate: 1411 kb/s
Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, stereo, s16, 1411 kb/s
[Parsed_astats_0 @ 0x561f893cd540] Option 'measure_overall' not found
[AVFilterGraph @ 0x561f89396be0] Error initializing filter 'astats' with args 'measure_overall=Peak_level+RMS_level:measure_perchannel=0'
Error initializing complex filters.
Option not found```

Is there something I need to do to fix this error?
slhck commented 2 years ago

It seems you are using a version of ffmpeg that does not have the astats filter yet. Please install a recent ffmpeg version.

slhck commented 2 years ago

It seems the option was only introduced in ffmpeg 4.2, so please use anything more recent than that. Your build is quite old now.