slhck / ffmpeg-normalize

Audio Normalization for Python/ffmpeg
MIT License
1.28k stars 118 forks source link

Error on mp3 normalizing: Error initializing complex filters. Result too large #189

Closed canchanchara closed 2 years ago

canchanchara commented 2 years ago

:warning: Please read this carefully and edit the example responses! If you do not fill out this information, your bug report may be closed without comment.

Checklist (please tick all boxes)

Expected behavior I would like to normalize a mp3 file. It works with a lot of files, but this in attachment for example does not work.

Actual behavior I got this error:

[loudnorm @ 00000277a5ff3780] Value 115.400000 for parameter 'measured_tp' out of range [-99 - 99] [loudnorm @ 00000277a5ff3780] Error setting option measured_tp to value 115.4. [Parsed_loudnorm_0 @ 00000277a5fdd800] Error applying options to the filter. [AVFilterGraph @ 00000277a5fdf800] Error initializing filter 'loudnorm' with args 'i=-14.0:lra=11.0:tp=-2.0:offset=0.88:measured_i=0.0:measured_lra=0.0:measured_tp=115.4:measured_thresh=-10.0:linear=true:print_format=json' Error initializing complex filters. Result too large

Command The exact command you were trying to run:

ffmpeg-normalize -t -14 -lrt 11 42db7abc61a4c7d58873f95a4de335094c633406.mp3 -c:a libmp3lame -b:a 128k -o output.mp3

File to reproduce: 42db7abc61a4c7d58873f95a4de335094c633406.zip

Any output you get when running the command with the --debug flag:

C:\Users\David>ffmpeg-normalize --debug -t -14 -lrt 11 42db7abc61a4c7d58873f95a4de335094c633406.mp3 -c:a libmp3lame -b:a 128k -o output.mp3
DEBUG: Running command: ['C:\\Users\\David\\Documents\\project-tools\\ffmpeg-master-latest-win64-gpl\\bin\\ffmpeg.EXE', '-filters']
DEBUG: Parsing streams of C:\Users\David\Documents\git\project\file-optimizer\files\uploads\42db7abc61a4c7d58873f95a4de335094c633406.mp3
DEBUG: Running command: ['C:\\Users\\David\\Documents\\project-tools\\ffmpeg-master-latest-win64-gpl\\bin\\ffmpeg.EXE', '-i', 'C:\\Users\\David\\Documents\\git\\project\\file-optimizer\\files\\uploads\\42db7abc61a4c7d58873f95a4de335094c633406.mp3', '-c', 'copy', '-t', '0', '-map', '0', '-f', 'null', 'NUL']
DEBUG: Stream parsing command output:
DEBUG: ffmpeg version N-108116-g50a4dff69f-20220913 Copyright (c) 2000-2022 the FFmpeg developers
  built with gcc 12.1.0 (crosstool-NG 1.25.0.55_3defb7b)
  configuration: --prefix=/ffbuild/prefix --pkg-config-flags=--static --pkg-config=pkg-config --cross-prefix=x86_64-w64-mingw32- --arch=x86_64 --target-os=mingw32 --enable-gpl --enable-version3 --disable-debug --disable-w32threads --enable-pthreads --enable-iconv --enable-libxml2 --enable-zlib --enable-libfreetype --enable-libfribidi --enable-gmp --enable-lzma --enable-fontconfig --enable-libvorbis --enable-opencl --disable-libpulse --enable-libvmaf --disable-libxcb --disable-xlib --enable-amf --enable-libaom --enable-libaribb24 --enable-avisynth --enable-libdav1d --enable-libdavs2 --disable-libfdk-aac --enable-ffnvcodec --enable-cuda-llvm --enable-frei0r --enable-libgme --enable-libkvazaar --enable-libass --enable-libbluray --enable-libjxl --enable-libmp3lame --enable-libopus --enable-librist --enable-libssh --enable-libtheora --enable-libvpx --enable-libwebp --enable-lv2 --enable-libmfx --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopenmpt --enable-librav1e --enable-librubberband --enable-schannel --enable-sdl2 --enable-libsoxr --enable-libsrt --enable-libsvtav1 --enable-libtwolame --enable-libuavs3d --disable-libdrm --disable-vaapi --enable-libvidstab --enable-vulkan --enable-libshaderc --enable-libplacebo --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libzimg --enable-libzvbi --extra-cflags=-DLIBTWOLAME_STATIC --extra-cxxflags= --extra-ldflags=-pthread --extra-ldexeflags= --extra-libs=-lgomp --extra-version=20220913
  libavutil      57. 36.101 / 57. 36.101
  libavcodec     59. 43.100 / 59. 43.100
  libavformat    59. 31.100 / 59. 31.100
  libavdevice    59.  8.101 / 59.  8.101
  libavfilter     8. 48.100 /  8. 48.100
  libswscale      6.  8.112 /  6.  8.112
  libswresample   4.  9.100 /  4.  9.100
  libpostproc    56.  7.100 / 56.  7.100
Input #0, mp3, from 'C:\Users\David\Documents\git\project\file-optimizer\files\uploads\42db7abc61a4c7d58873f95a4de335094c633406.mp3':
  Metadata:
    album           : <anonymized>
    artist          : <anonymized>
    comment         : <anonymized>
    encoded_by      : Switch Testversion © NCH Software
    genre           : Speech
    title           : <anonymized>
    track           : 9
    date            : 2022
  Duration: 00:27:08.68, start: 0.000000, bitrate: 128 kb/s
  Stream #0:0: Audio: mp3, 32000 Hz, mono, fltp, 128 kb/s
  Stream #0:1: Video: mjpeg (Baseline), yuvj444p(pc, bt470bg/unknown/unknown), 500x500 [SAR 96:96 DAR 1:1], 90k tbr, 90k tbn (attached pic)
    Metadata:
      comment         : Cover (front)
Output #0, null, to 'NUL':
  Metadata:
    album           : <anonymized>
    artist          : <anonymized>
    comment         : <anonymized>
    encoded_by      : Switch Testversion © NCH Software
    genre           : Speech
    title           : <anonymized>
    track           : 9
    date            : 2022
    encoder         : Lavf59.31.100
  Stream #0:0: Audio: mp3, 32000 Hz, mono, fltp, 128 kb/s
  Stream #0:1: Video: mjpeg (Baseline), yuvj444p(pc, bt470bg/unknown/unknown), 500x500 [SAR 96:96 DAR 1:1], q=2-31, 90k tbr, 90k tbn (attached pic)
    Metadata:
      comment         : Cover (front)
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame=    0 fps=0.0 q=-1.0 Lsize=N/A time=-577014:32:22.77 bitrate=N/A speed=N/A    /s speed=N/A
video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Output file is empty, nothing was encoded

DEBUG: Found duration: 1628.068 s
DEBUG: Found audio stream at index 0
DEBUG: Found video stream at index 1
INFO: Normalizing file 42db7abc61a4c7d58873f95a4de335094c633406.mp3 (1 of 1)
DEBUG: Running normalization for C:\Users\David\Documents\git\project\file-optimizer\files\uploads\42db7abc61a4c7d58873f95a4de335094c633406.mp3
DEBUG: Parsing normalization info for C:\Users\David\Documents\git\project\file-optimizer\files\uploads\42db7abc61a4c7d58873f95a4de335094c633406.mp3
INFO: Running first pass loudnorm filter for stream 0
DEBUG: Running command: ['C:\\Users\\David\\Documents\\project-tools\\ffmpeg-master-latest-win64-gpl\\bin\\ffmpeg.EXE', '-nostdin', '-y', '-i', 'C:\\Users\\David\\Documents\\git\\project\\file-optimizer\\files\\uploads\\42db7abc61a4c7d58873f95a4de335094c633406.mp3', '-filter_complex', '[0:0]loudnorm=i=-14.0:lra=11.0:tp=-2.0:offset=0.0:print_format=json', '-vn', '-sn', '-f', 'null', 'NUL']
DEBUG: ffmpeg output: ffmpeg version N-108116-g50a4dff69f-20220913 Copyright (c) 2000-2022 the FFmpeg developers
built with gcc 12.1.0 (crosstool-NG 1.25.0.55_3defb7b)
configuration: --prefix=/ffbuild/prefix --pkg-config-flags=--static --pkg-config=pkg-config --cross-prefix=x86_64-w64-mingw32- --arch=x86_64 --target-os=mingw32 --enable-gpl --enable-version3 --disable-debug --disable-w32threads --enable-pthreads --enable-iconv --enable-libxml2 --enable-zlib --enable-libfreetype --enable-libfribidi --enable-gmp --enable-lzma --enable-fontconfig --enable-libvorbis --enable-opencl --disable-libpulse --enable-libvmaf --disable-libxcb --disable-xlib --enable-amf --enable-libaom --enable-libaribb24 --enable-avisynth --enable-libdav1d --enable-libdavs2 --disable-libfdk-aac --enable-ffnvcodec --enable-cuda-llvm --enable-frei0r --enable-libgme --enable-libkvazaar --enable-libass --enable-libbluray --enable-libjxl --enable-libmp3lame --enable-libopus --enable-librist --enable-libssh --enable-libtheora --enable-libvpx --enable-libwebp --enable-lv2 --enable-libmfx --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopenmpt --enable-librav1e --enable-librubberband --enable-schannel --enable-sdl2 --enable-libsoxr --enable-libsrt --enable-libsvtav1 --enable-libtwolame --enable-libuavs3d --disable-libdrm --disable-vaapi --enable-libvidstab --enable-vulkan --enable-libshaderc --enable-libplacebo --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libzimg --enable-libzvbi --extra-cflags=-DLIBTWOLAME_STATIC --extra-cxxflags= --extra-ldflags=-pthread --extra-ldexeflags= --extra-libs=-lgomp --extra-version=20220913
libavutil      57. 36.101 / 57. 36.101
libavcodec     59. 43.100 / 59. 43.100
libavformat    59. 31.100 / 59. 31.100
libavdevice    59.  8.101 / 59.  8.101
libavfilter     8. 48.100 /  8. 48.100
libswscale      6.  8.112 /  6.  8.112
libswresample   4.  9.100 /  4.  9.100
libpostproc    56.  7.100 / 56.  7.100
Input #0, mp3, from 'C:\Users\David\Documents\git\project\file-optimizer\files\uploads\42db7abc61a4c7d58873f95a4de335094c633406.mp3':
Metadata:
album           : <anonymized>
artist          : <anonymized>
comment         : <anonymized>
encoded_by      : Switch Testversion © NCH Software
genre           : Speech
title           : <anonymized>
track           : 9
date            : 2022
Duration: 00:27:08.68, start: 0.000000, bitrate: 128 kb/s
Stream #0:0: Audio: mp3, 32000 Hz, mono, fltp, 128 kb/s
Stream #0:1: Video: mjpeg (Baseline), yuvj444p(pc, bt470bg/unknown/unknown), 500x500 [SAR 96:96 DAR 1:1], 90k tbr, 90k tbn (attached pic)
Metadata:
comment         : Cover (front)
Stream mapping:
Stream #0:0 (mp3float) -> loudnorm:default
loudnorm:default -> Stream #0:0 (pcm_s16le)
Output #0, null, to 'NUL':
Metadata:
album           : <anonymized>
artist          : <anonymized>
comment         : Tausende gratis Ressourcen: www.project.org
encoded_by      : Switch Testversion © NCH Software
genre           : Speech
title           : <anonymized>
track           : 9
date            : 2022
encoder         : Lavf59.31.100
Stream #0:0: Audio: pcm_s16le, 192000 Hz, mono, s16, 3072 kb/s
Metadata:
encoder         : Lavc59.43.100 pcm_s16le
video:0kB audio:610754kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
[Parsed_loudnorm_0 @ 000002757b3bee00]
{
"input_i" : "29.95",
"input_tp" : "115.40",
"input_lra" : "0.00",
"input_thresh" : "-10.00",
"output_i" : "-14.88",
"output_tp" : "-2.00",
"output_lra" : "4.60",
"output_thresh" : "-25.31",
"normalization_type" : "dynamic",
"target_offset" : "0.88"
}

DEBUG: Loudnorm first pass command output: ffmpeg version N-108116-g50a4dff69f-20220913 Copyright (c) 2000-2022 the FFmpeg developers
built with gcc 12.1.0 (crosstool-NG 1.25.0.55_3defb7b)
configuration: --prefix=/ffbuild/prefix --pkg-config-flags=--static --pkg-config=pkg-config --cross-prefix=x86_64-w64-mingw32- --arch=x86_64 --target-os=mingw32 --enable-gpl --enable-version3 --disable-debug --disable-w32threads --enable-pthreads --enable-iconv --enable-libxml2 --enable-zlib --enable-libfreetype --enable-libfribidi --enable-gmp --enable-lzma --enable-fontconfig --enable-libvorbis --enable-opencl --disable-libpulse --enable-libvmaf --disable-libxcb --disable-xlib --enable-amf --enable-libaom --enable-libaribb24 --enable-avisynth --enable-libdav1d --enable-libdavs2 --disable-libfdk-aac --enable-ffnvcodec --enable-cuda-llvm --enable-frei0r --enable-libgme --enable-libkvazaar --enable-libass --enable-libbluray --enable-libjxl --enable-libmp3lame --enable-libopus --enable-librist --enable-libssh --enable-libtheora --enable-libvpx --enable-libwebp --enable-lv2 --enable-libmfx --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopenmpt --enable-librav1e --enable-librubberband --enable-schannel --enable-sdl2 --enable-libsoxr --enable-libsrt --enable-libsvtav1 --enable-libtwolame --enable-libuavs3d --disable-libdrm --disable-vaapi --enable-libvidstab --enable-vulkan --enable-libshaderc --enable-libplacebo --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libzimg --enable-libzvbi --extra-cflags=-DLIBTWOLAME_STATIC --extra-cxxflags= --extra-ldflags=-pthread --extra-ldexeflags= --extra-libs=-lgomp --extra-version=20220913
libavutil      57. 36.101 / 57. 36.101
libavcodec     59. 43.100 / 59. 43.100
libavformat    59. 31.100 / 59. 31.100
libavdevice    59.  8.101 / 59.  8.101
libavfilter     8. 48.100 /  8. 48.100
libswscale      6.  8.112 /  6.  8.112
libswresample   4.  9.100 /  4.  9.100
libpostproc    56.  7.100 / 56.  7.100
Input #0, mp3, from 'C:\Users\David\Documents\git\project\file-optimizer\files\uploads\42db7abc61a4c7d58873f95a4de335094c633406.mp3':
Metadata:
album           : <anonymized>
artist          : <anonymized>
comment         : Tausende gratis Ressourcen: www.project.org
encoded_by      : Switch Testversion © NCH Software
genre           : Speech
title           : <anonymized>
track           : 9
date            : 2022
Duration: 00:27:08.68, start: 0.000000, bitrate: 128 kb/s
Stream #0:0: Audio: mp3, 32000 Hz, mono, fltp, 128 kb/s
Stream #0:1: Video: mjpeg (Baseline), yuvj444p(pc, bt470bg/unknown/unknown), 500x500 [SAR 96:96 DAR 1:1], 90k tbr, 90k tbn (attached pic)
Metadata:
comment         : Cover (front)
Stream mapping:
Stream #0:0 (mp3float) -> loudnorm:default
loudnorm:default -> Stream #0:0 (pcm_s16le)
Output #0, null, to 'NUL':
Metadata:
album           : <anonymized>
artist          : <anonymized>
comment         : <anonymized>
encoded_by      : Switch Testversion © NCH Software
genre           : Speech
title           : <anonymized>
track           : 9
date            : 2022
encoder         : Lavf59.31.100
Stream #0:0: Audio: pcm_s16le, 192000 Hz, mono, s16, 3072 kb/s
Metadata:
encoder         : Lavc59.43.100 pcm_s16le
video:0kB audio:610754kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
[Parsed_loudnorm_0 @ 000002757b3bee00]
{
"input_i" : "29.95",
"input_tp" : "115.40",
"input_lra" : "0.00",
"input_thresh" : "-10.00",
"output_i" : "-14.88",
"output_tp" : "-2.00",
"output_lra" : "4.60",
"output_thresh" : "-25.31",
"normalization_type" : "dynamic",
"target_offset" : "0.88"
}

DEBUG: Loudnorm stats parsed: {"input_i": "29.95", "input_tp": "115.40", "input_lra": "0.00", "input_thresh": "-10.00", "output_i": "-14.88", "output_tp": "-2.00", "output_lra": "4.60", "output_thresh": "-25.31", "normalization_type": "dynamic", "target_offset": "0.88"}
INFO: Running second pass for C:\Users\David\Documents\git\project\file-optimizer\files\uploads\42db7abc61a4c7d58873f95a4de335094c633406.mp3
WARNING: Input file had measured input loudness greater than zero (29.95), capping at 0
DEBUG: Running command: ['C:\\Users\\David\\Documents\\project-tools\\ffmpeg-master-latest-win64-gpl\\bin\\ffmpeg.EXE', '-y', '-nostdin', '-i', 'C:\\Users\\David\\Documents\\git\\project\\file-optimizer\\files\\uploads\\42db7abc61a4c7d58873f95a4de335094c633406.mp3', '-filter_complex', '[0:0]loudnorm=i=-14.0:lra=11.0:tp=-2.0:offset=0.88:measured_i=0.0:measured_lra=0.0:measured_tp=115.4:measured_thresh=-10.0:linear=true:print_format=json[norm0]', '-map_metadata', '0', '-map_metadata:s:a:0', '0:s:a:0', '-map_metadata:s:v:0', '0:s:v:0', '-map_chapters', '0', '-map', '0:1', '-c:v', 'copy', '-map', '[norm0]', '-c:a', 'libmp3lame', '-b:a', '128k', '-c:s', 'copy', 'C:\\Users\\David\\AppData\\Local\\Temp\\rd70szt1.mp3']
ERROR: Error while running command 'C:\Users\David\Documents\project-tools\ffmpeg-master-latest-win64-gpl\bin\ffmpeg.EXE' -y -nostdin -i 'C:\Users\David\Documents\git\project\file-optimizer\files\uploads\42db7abc61a4c7d58873f95a4de335094c633406.mp3' -filter_complex '[0:0]loudnorm=i=-14.0:lra=11.0:tp=-2.0:offset=0.88:measured_i=0.0:measured_lra=0.0:measured_tp=115.4:measured_thresh=-10.0:linear=true:print_format=json[norm0]' -map_metadata 0 -map_metadata:s:a:0 0:s:a:0 -map_metadata:s:v:0 0:s:v:0 -map_chapters 0 -map 0:1 -c:v copy -map '[norm0]' -c:a libmp3lame -b:a 128k -c:s copy 'C:\Users\David\AppData\Local\Temp\rd70szt1.mp3'! Error: Error running command ['C:\\Users\\David\\Documents\\project-tools\\ffmpeg-master-latest-win64-gpl\\bin\\ffmpeg.EXE', '-y', '-nostdin', '-i', 'C:\\Users\\David\\Documents\\git\\project\\file-optimizer\\files\\uploads\\42db7abc61a4c7d58873f95a4de335094c633406.mp3', '-filter_complex', '[0:0]loudnorm=i=-14.0:lra=11.0:tp=-2.0:offset=0.88:measured_i=0.0:measured_lra=0.0:measured_tp=115.4:measured_thresh=-10.0:linear=true:print_format=json[norm0]', '-map_metadata', '0', '-map_metadata:s:a:0', '0:s:a:0', '-map_metadata:s:v:0', '0:s:v:0', '-map_chapters', '0', '-map', '0:1', '-c:v', 'copy', '-map', '[norm0]', '-c:a', 'libmp3lame', '-b:a', '128k', '-c:s', 'copy', 'C:\\Users\\David\\AppData\\Local\\Temp\\rd70szt1.mp3']: ffmpeg version N-108116-g50a4dff69f-20220913 Copyright (c) 2000-2022 the FFmpeg developers
built with gcc 12.1.0 (crosstool-NG 1.25.0.55_3defb7b)
configuration: --prefix=/ffbuild/prefix --pkg-config-flags=--static --pkg-config=pkg-config --cross-prefix=x86_64-w64-mingw32- --arch=x86_64 --target-os=mingw32 --enable-gpl --enable-version3 --disable-debug --disable-w32threads --enable-pthreads --enable-iconv --enable-libxml2 --enable-zlib --enable-libfreetype --enable-libfribidi --enable-gmp --enable-lzma --enable-fontconfig --enable-libvorbis --enable-opencl --disable-libpulse --enable-libvmaf --disable-libxcb --disable-xlib --enable-amf --enable-libaom --enable-libaribb24 --enable-avisynth --enable-libdav1d --enable-libdavs2 --disable-libfdk-aac --enable-ffnvcodec --enable-cuda-llvm --enable-frei0r --enable-libgme --enable-libkvazaar --enable-libass --enable-libbluray --enable-libjxl --enable-libmp3lame --enable-libopus --enable-librist --enable-libssh --enable-libtheora --enable-libvpx --enable-libwebp --enable-lv2 --enable-libmfx --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopenmpt --enable-librav1e --enable-librubberband --enable-schannel --enable-sdl2 --enable-libsoxr --enable-libsrt --enable-libsvtav1 --enable-libtwolame --enable-libuavs3d --disable-libdrm --disable-vaapi --enable-libvidstab --enable-vulkan --enable-libshaderc --enable-libplacebo --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libzimg --enable-libzvbi --extra-cflags=-DLIBTWOLAME_STATIC --extra-cxxflags= --extra-ldflags=-pthread --extra-ldexeflags= --extra-libs=-lgomp --extra-version=20220913
libavutil      57. 36.101 / 57. 36.101
libavcodec     59. 43.100 / 59. 43.100
libavformat    59. 31.100 / 59. 31.100
libavdevice    59.  8.101 / 59.  8.101
libavfilter     8. 48.100 /  8. 48.100
libswscale      6.  8.112 /  6.  8.112
libswresample   4.  9.100 /  4.  9.100
libpostproc    56.  7.100 / 56.  7.100
Input #0, mp3, from 'C:\Users\David\Documents\git\project\file-optimizer\files\uploads\42db7abc61a4c7d58873f95a4de335094c633406.mp3':
Metadata:
album           : <anonymized>
artist          : <anonymized>
comment         : <anonymized>
encoded_by      : Switch Testversion © NCH Software
genre           : Speech
title           : <anonymized>
track           : 9
date            : 2022
Duration: 00:27:08.68, start: 0.000000, bitrate: 128 kb/s
Stream #0:0: Audio: mp3, 32000 Hz, mono, fltp, 128 kb/s
Stream #0:1: Video: mjpeg (Baseline), yuvj444p(pc, bt470bg/unknown/unknown), 500x500 [SAR 96:96 DAR 1:1], 90k tbr, 90k tbn (attached pic)
Metadata:
comment         : Cover (front)
[loudnorm @ 000001dcfcfb2700] Value 115.400000 for parameter 'measured_tp' out of range [-99 - 99]
[loudnorm @ 000001dcfcfb2700] Error setting option measured_tp to value 115.4.
[Parsed_loudnorm_0 @ 000001dcfcf9d6c0] Error applying options to the filter.
[AVFilterGraph @ 000001dcfcf9ff00] Error initializing filter 'loudnorm' with args 'i=-14.0:lra=11.0:tp=-2.0:offset=0.88:measured_i=0.0:measured_lra=0.0:measured_tp=115.4:measured_thresh=-10.0:linear=true:print_format=json'
**Error initializing complex filters.
Result too large**

Traceback (most recent call last):
  File "C:\Users\David\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\David\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Users\David\AppData\Local\Programs\Python\Python310\Scripts\ffmpeg-normalize.exe\__main__.py", line 7, in <module>
  File "C:\Users\David\AppData\Local\Programs\Python\Python310\lib\site-packages\ffmpeg_normalize\__main__.py", line 554, in main
    ffmpeg_normalize.run_normalization()
  File "C:\Users\David\AppData\Local\Programs\Python\Python310\lib\site-packages\ffmpeg_normalize\_ffmpeg_normalize.py", line 205, in run_normalization
    raise e
  File "C:\Users\David\AppData\Local\Programs\Python\Python310\lib\site-packages\ffmpeg_normalize\_ffmpeg_normalize.py", line 194, in run_normalization
    media_file.run_normalization()
  File "C:\Users\David\AppData\Local\Programs\Python\Python310\lib\site-packages\ffmpeg_normalize\_media_file.py", line 165, in run_normalization
    for _ in self._second_pass():
  File "C:\Users\David\AppData\Local\Programs\Python\Python310\lib\site-packages\ffmpeg_normalize\_media_file.py", line 381, in _second_pass
    raise e
  File "C:\Users\David\AppData\Local\Programs\Python\Python310\lib\site-packages\ffmpeg_normalize\_media_file.py", line 370, in _second_pass
    raise e
  File "C:\Users\David\AppData\Local\Programs\Python\Python310\lib\site-packages\ffmpeg_normalize\_media_file.py", line 362, in _second_pass
    for progress in cmd_runner.run_ffmpeg_command():
  File "C:\Users\David\AppData\Local\Programs\Python\Python310\lib\site-packages\ffmpeg_normalize\_cmd_utils.py", line 78, in run_ffmpeg_command
    for progress in ff.run_command_with_progress():
  File "C:\Users\David\AppData\Local\Programs\Python\Python310\lib\site-packages\ffmpeg_progress_yield\ffmpeg_progress_yield.py", line 107, in run_command_with_progress
    raise RuntimeError(
RuntimeError: Error running command ['C:\\Users\\David\\Documents\\project-tools\\ffmpeg-master-latest-win64-gpl\\bin\\ffmpeg.EXE', '-y', '-nostdin', '-i', 'C:\\Users\\David\\Documents\\git\\project\\file-optimizer\\files\\uploads\\42db7abc61a4c7d58873f95a4de335094c633406.mp3', '-filter_complex', '[0:0]loudnorm=i=-14.0:lra=11.0:tp=-2.0:offset=0.88:measured_i=0.0:measured_lra=0.0:measured_tp=115.4:measured_thresh=-10.0:linear=true:print_format=json[norm0]', '-map_metadata', '0', '-map_metadata:s:a:0', '0:s:a:0', '-map_metadata:s:v:0', '0:s:v:0', '-map_chapters', '0', '-map', '0:1', '-c:v', 'copy', '-map', '[norm0]', '-c:a', 'libmp3lame', '-b:a', '128k', '-c:s', 'copy', 'C:\\Users\\David\\AppData\\Local\\Temp\\rd70szt1.mp3']: ffmpeg version N-108116-g50a4dff69f-20220913 Copyright (c) 2000-2022 the FFmpeg developers
built with gcc 12.1.0 (crosstool-NG 1.25.0.55_3defb7b)
configuration: --prefix=/ffbuild/prefix --pkg-config-flags=--static --pkg-config=pkg-config --cross-prefix=x86_64-w64-mingw32- --arch=x86_64 --target-os=mingw32 --enable-gpl --enable-version3 --disable-debug --disable-w32threads --enable-pthreads --enable-iconv --enable-libxml2 --enable-zlib --enable-libfreetype --enable-libfribidi --enable-gmp --enable-lzma --enable-fontconfig --enable-libvorbis --enable-opencl --disable-libpulse --enable-libvmaf --disable-libxcb --disable-xlib --enable-amf --enable-libaom --enable-libaribb24 --enable-avisynth --enable-libdav1d --enable-libdavs2 --disable-libfdk-aac --enable-ffnvcodec --enable-cuda-llvm --enable-frei0r --enable-libgme --enable-libkvazaar --enable-libass --enable-libbluray --enable-libjxl --enable-libmp3lame --enable-libopus --enable-librist --enable-libssh --enable-libtheora --enable-libvpx --enable-libwebp --enable-lv2 --enable-libmfx --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopenmpt --enable-librav1e --enable-librubberband --enable-schannel --enable-sdl2 --enable-libsoxr --enable-libsrt --enable-libsvtav1 --enable-libtwolame --enable-libuavs3d --disable-libdrm --disable-vaapi --enable-libvidstab --enable-vulkan --enable-libshaderc --enable-libplacebo --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libzimg --enable-libzvbi --extra-cflags=-DLIBTWOLAME_STATIC --extra-cxxflags= --extra-ldflags=-pthread --extra-ldexeflags= --extra-libs=-lgomp --extra-version=20220913
libavutil      57. 36.101 / 57. 36.101
libavcodec     59. 43.100 / 59. 43.100
libavformat    59. 31.100 / 59. 31.100
libavdevice    59.  8.101 / 59.  8.101
libavfilter     8. 48.100 /  8. 48.100
libswscale      6.  8.112 /  6.  8.112
libswresample   4.  9.100 /  4.  9.100
libpostproc    56.  7.100 / 56.  7.100
Input #0, mp3, from 'C:\Users\David\Documents\git\project\file-optimizer\files\uploads\42db7abc61a4c7d58873f95a4de335094c633406.mp3':
Metadata:
album           : <anonymized>
artist          : <anonymized>
comment         : <anonymized>
encoded_by      : Switch Testversion © NCH Software
genre           : Speech
title           : <anonymized>
track           : 9
date            : 2022
Duration: 00:27:08.68, start: 0.000000, bitrate: 128 kb/s
Stream #0:0: Audio: mp3, 32000 Hz, mono, fltp, 128 kb/s
Stream #0:1: Video: mjpeg (Baseline), yuvj444p(pc, bt470bg/unknown/unknown), 500x500 [SAR 96:96 DAR 1:1], 90k tbr, 90k tbn (attached pic)
Metadata:
comment         : Cover (front)
[loudnorm @ 000001dcfcfb2700] Value 115.400000 for parameter 'measured_tp' out of range [-99 - 99]
[loudnorm @ 000001dcfcfb2700] Error setting option measured_tp to value 115.4.
[Parsed_loudnorm_0 @ 000001dcfcf9d6c0] Error applying options to the filter.
[AVFilterGraph @ 000001dcfcf9ff00] Error initializing filter 'loudnorm' with args 'i=-14.0:lra=11.0:tp=-2.0:offset=0.88:measured_i=0.0:measured_lra=0.0:measured_tp=115.4:measured_thresh=-10.0:linear=true:print_format=json'
Error initializing complex filters.
Result too large

Environment (please complete the following information):

slhck commented 2 years ago

This seems to be an upstream bug.

[loudnorm @ 000001dcfcfb2700] Value 115.400000 for parameter 'measured_tp' out of range [-99 - 99]

It measured a true peak of 115.4 in the first pass, but the filter itself only accepts an input in a smaller range for the second pass.

canchanchara commented 2 years ago

Do you have any idea for an workaround in ffmpeg-normalize?

slhck commented 2 years ago

I constrain these values now. Feels like an ugly workaround but it should rarely happen in practice. Release will come in a minute.