slhck / ffmpeg-normalize

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

Conversion failed: mp3 to libopus #175

Closed homocomputeris closed 2 years ago

homocomputeris 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 Normalize MP3 to Opus in OGG

Actual behavior Conversion fails, although OGG to OGG converts with no issues.

Command The exact command you were trying to run:

ffmpeg-normalize pronunciation_ja_ぎっくり腰.mp3 -c:a libopus -b:a 128k -ar 48000 -o normalized/out.ogg
WARNING: Audio stream has a duration of less than 3 seconds. Normalization may not work. See https://github.com/slhck/ffmpeg-normalize/issues/87 for more info.
ERROR: Error while running command /usr/bin/ffmpeg -y -nostdin -i 'pronunciation_ja_ぎっくり腰.mp3' -filter_complex '[0:0]loudnorm=i=-23.0:lra=7.0:tp=-2.0:offset=0.01:measured_i=-13.13:measured_lra=0.0:measured_tp=-0.42:measured_thresh=-26.54: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 libopus -b:a 128k -ar 48000 -c:s copy /tmp/4dy3kkb2.ogg! Error: Error running command ['/usr/bin/ffmpeg', '-y', '-nostdin', '-i', 'pronunciation_ja_ぎっくり腰.mp3', '-filter_complex', '[0:0]loudnorm=i=-23.0:lra=7.0:tp=-2.0:offset=0.01:measured_i=-13.13:measured_lra=0.0:measured_tp=-0.42:measured_thresh=-26.54: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', 'libopus', '-b:a', '128k', '-ar', '48000', '-c:s', 'copy', '/tmp/4dy3kkb2.ogg']: ffmpeg version n5.0 Copyright (c) 2000-2022 the FFmpeg developers
built with gcc 11.2.0 (GCC)
configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-amf --enable-avisynth --enable-cuda-llvm --enable-lto --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libmfx --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librav1e --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-libzimg --enable-nvdec --enable-nvenc --enable-shared --enable-version3
libavutil      57. 17.100 / 57. 17.100
libavcodec     59. 18.100 / 59. 18.100
libavformat    59. 16.100 / 59. 16.100
libavdevice    59.  4.100 / 59.  4.100
libavfilter     8. 24.100 /  8. 24.100
libswscale      6.  4.100 /  6.  4.100
libswresample   4.  3.100 /  4.  3.100
libpostproc    56.  3.100 / 56.  3.100
[mp3 @ 0x560c6d61c0c0] Estimating duration from bitrate, this may be inaccurate
Input #0, mp3, from 'pronunciation_ja_ぎっくり腰.mp3':
Metadata:
title           : ぎっくり腰
artist          : Forvo
album           : Pronunciation in Japanese
comment         : https://forvo.com/word/ぎっくり腰/#ja
: https://forvo.com/license/
Duration: 00:00:02.54, start: 0.000000, bitrate: 165 kb/s
Stream #0:0: Audio: mp3, 44100 Hz, stereo, fltp, 128 kb/s
Stream #0:1: Video: png, rgb24(pc), 200x200, 90k tbr, 90k tbn (attached pic)
Metadata:
title           : Forvo
comment         : Other
Stream mapping:
Stream #0:0 (mp3float) -> loudnorm:default
Stream #0:1 -> #0:0 (copy)
loudnorm:default -> Stream #0:1 (libopus)
[ogg @ 0x560c6d62e600] Unsupported codec id in stream 0
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Error initializing output stream 0:1 --
[Parsed_loudnorm_0 @ 0x560c6d633900]
{
"input_i" : "-inf",
"input_tp" : "-inf",
"input_lra" : "0.00",
"input_thresh" : "-70.00",
"output_i" : "-inf",
"output_tp" : "-inf",
"output_lra" : "0.00",
"output_thresh" : "-70.00",
"normalization_type" : "dynamic",
"target_offset" : "inf"
}
Conversion failed!

Traceback (most recent call last):
  File "/usr/bin/ffmpeg-normalize", line 33, in <module>
    sys.exit(load_entry_point('ffmpeg-normalize==1.22.9', 'console_scripts', 'ffmpeg-normalize')())
  File "/usr/lib/python3.10/site-packages/ffmpeg_normalize/__main__.py", line 544, in main
    ffmpeg_normalize.run_normalization()
  File "/usr/lib/python3.10/site-packages/ffmpeg_normalize/_ffmpeg_normalize.py", line 195, in run_normalization
    raise e
  File "/usr/lib/python3.10/site-packages/ffmpeg_normalize/_ffmpeg_normalize.py", line 184, in run_normalization
    media_file.run_normalization()
  File "/usr/lib/python3.10/site-packages/ffmpeg_normalize/_media_file.py", line 162, in run_normalization
    for _ in self._second_pass():
  File "/usr/lib/python3.10/site-packages/ffmpeg_normalize/_media_file.py", line 369, in _second_pass
    raise e
  File "/usr/lib/python3.10/site-packages/ffmpeg_normalize/_media_file.py", line 358, in _second_pass
    raise e
  File "/usr/lib/python3.10/site-packages/ffmpeg_normalize/_media_file.py", line 350, in _second_pass
    for progress in cmd_runner.run_ffmpeg_command():
  File "/usr/lib/python3.10/site-packages/ffmpeg_normalize/_cmd_utils.py", line 66, in run_ffmpeg_command
    for progress in ff.run_command_with_progress():
  File "/usr/lib/python3.10/site-packages/ffmpeg_progress_yield/ffmpeg_progress_yield.py", line 107, in run_command_with_progress
    raise RuntimeError(
RuntimeError: Error running command ['/usr/bin/ffmpeg', '-y', '-nostdin', '-i', 'pronunciation_ja_ぎっくり腰.mp3', '-filter_complex', '[0:0]loudnorm=i=-23.0:lra=7.0:tp=-2.0:offset=0.01:measured_i=-13.13:measured_lra=0.0:measured_tp=-0.42:measured_thresh=-26.54: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', 'libopus', '-b:a', '128k', '-ar', '48000', '-c:s', 'copy', '/tmp/4dy3kkb2.ogg']: ffmpeg version n5.0 Copyright (c) 2000-2022 the FFmpeg developers
built with gcc 11.2.0 (GCC)
configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-amf --enable-avisynth --enable-cuda-llvm --enable-lto --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libmfx --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librav1e --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-libzimg --enable-nvdec --enable-nvenc --enable-shared --enable-version3
libavutil      57. 17.100 / 57. 17.100
libavcodec     59. 18.100 / 59. 18.100
libavformat    59. 16.100 / 59. 16.100
libavdevice    59.  4.100 / 59.  4.100
libavfilter     8. 24.100 /  8. 24.100
libswscale      6.  4.100 /  6.  4.100
libswresample   4.  3.100 /  4.  3.100
libpostproc    56.  3.100 / 56.  3.100
[mp3 @ 0x560c6d61c0c0] Estimating duration from bitrate, this may be inaccurate
Input #0, mp3, from 'pronunciation_ja_ぎっくり腰.mp3':
Metadata:
title           : ぎっくり腰
artist          : Forvo
album           : Pronunciation in Japanese
comment         : https://forvo.com/word/ぎっくり腰/#ja
: https://forvo.com/license/
Duration: 00:00:02.54, start: 0.000000, bitrate: 165 kb/s
Stream #0:0: Audio: mp3, 44100 Hz, stereo, fltp, 128 kb/s
Stream #0:1: Video: png, rgb24(pc), 200x200, 90k tbr, 90k tbn (attached pic)
Metadata:
title           : Forvo
comment         : Other
Stream mapping:
Stream #0:0 (mp3float) -> loudnorm:default
Stream #0:1 -> #0:0 (copy)
loudnorm:default -> Stream #0:1 (libopus)
[ogg @ 0x560c6d62e600] Unsupported codec id in stream 0
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Error initializing output stream 0:1 --
[Parsed_loudnorm_0 @ 0x560c6d633900]
{
"input_i" : "-inf",
"input_tp" : "-inf",
"input_lra" : "0.00",
"input_thresh" : "-70.00",
"output_i" : "-inf",
"output_tp" : "-inf",
"output_lra" : "0.00",
"output_thresh" : "-70.00",
"normalization_type" : "dynamic",
"target_offset" : "inf"
}
Conversion failed!

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

ffmpeg-normalize --debug pronunciation_ja_ぎっくり腰.mp3 -c:a libopus -b:a 128k -ar 48000 -o normalized/out.ogg
DEBUG: Running command: ['/usr/bin/ffmpeg', '-filters']
DEBUG: Parsing streams of pronunciation_ja_ぎっくり腰.mp3
DEBUG: Running command: ['/usr/bin/ffmpeg', '-i', 'pronunciation_ja_ぎっくり腰.mp3', '-c', 'copy', '-t', '0', '-map', '0', '-f', 'null', '/dev/null']
DEBUG: Stream parsing command output:
DEBUG: ffmpeg version n5.0 Copyright (c) 2000-2022 the FFmpeg developers
  built with gcc 11.2.0 (GCC)
  configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-amf --enable-avisynth --enable-cuda-llvm --enable-lto --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libmfx --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librav1e --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-libzimg --enable-nvdec --enable-nvenc --enable-shared --enable-version3
  libavutil      57. 17.100 / 57. 17.100
  libavcodec     59. 18.100 / 59. 18.100
  libavformat    59. 16.100 / 59. 16.100
  libavdevice    59.  4.100 / 59.  4.100
  libavfilter     8. 24.100 /  8. 24.100
  libswscale      6.  4.100 /  6.  4.100
  libswresample   4.  3.100 /  4.  3.100
  libpostproc    56.  3.100 / 56.  3.100
[mp3 @ 0x557e6c616740] Estimating duration from bitrate, this may be inaccurate
Input #0, mp3, from 'pronunciation_ja_ぎっくり腰.mp3':
  Metadata:
    title           : ぎっくり腰
    artist          : Forvo
    album           : Pronunciation in Japanese
    comment         : https://forvo.com/word/ぎっくり腰/#ja
                    : https://forvo.com/license/
  Duration: 00:00:02.54, start: 0.000000, bitrate: 165 kb/s
  Stream #0:0: Audio: mp3, 44100 Hz, stereo, fltp, 128 kb/s
  Stream #0:1: Video: png, rgb24(pc), 200x200, 90k tbr, 90k tbn (attached pic)
    Metadata:
      title           : Forvo
      comment         : Other
Output #0, null, to '/dev/null':
  Metadata:
    title           : ぎっくり腰
    artist          : Forvo
    album           : Pronunciation in Japanese
    comment         : https://forvo.com/word/ぎっくり腰/#ja
                    : https://forvo.com/license/
    encoder         : Lavf59.16.100
  Stream #0:0: Audio: mp3, 44100 Hz, stereo, fltp, 128 kb/s
  Stream #0:1: Video: png, rgb24(pc), 200x200, q=2-31, 90k tbr, 90k tbn (attached pic)
    Metadata:
      title           : Forvo
      comment         : Other
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=00:00:00.00 bitrate=N/A speed=   0x    
video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Output file is empty, nothing was encoded (check -ss / -t / -frames parameters if used)

DEBUG: Found duration: 2.054 s
DEBUG: Found audio stream at index 0
WARNING: Audio stream has a duration of less than 3 seconds. Normalization may not work. See https://github.com/slhck/ffmpeg-normalize/issues/87 for more info.
DEBUG: Found video stream at index 1
INFO: Normalizing file pronunciation_ja_ぎっくり腰.mp3 (1 of 1)
DEBUG: Running normalization for pronunciation_ja_ぎっくり腰.mp3
DEBUG: Parsing normalization info for pronunciation_ja_ぎっくり腰.mp3
INFO: Running first pass loudnorm filter for stream 0
DEBUG: Running command: ['/usr/bin/ffmpeg', '-nostdin', '-y', '-i', 'pronunciation_ja_ぎっくり腰.mp3', '-filter_complex', '[0:0]loudnorm=i=-23.0:lra=7.0:tp=-2.0:offset=0.0:print_format=json', '-vn', '-sn', '-f', 'null', '/dev/null']
DEBUG: ffmpeg output: ffmpeg version n5.0 Copyright (c) 2000-2022 the FFmpeg developers
built with gcc 11.2.0 (GCC)
configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-amf --enable-avisynth --enable-cuda-llvm --enable-lto --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libmfx --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librav1e --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-libzimg --enable-nvdec --enable-nvenc --enable-shared --enable-version3
libavutil      57. 17.100 / 57. 17.100
libavcodec     59. 18.100 / 59. 18.100
libavformat    59. 16.100 / 59. 16.100
libavdevice    59.  4.100 / 59.  4.100
libavfilter     8. 24.100 /  8. 24.100
libswscale      6.  4.100 /  6.  4.100
libswresample   4.  3.100 /  4.  3.100
libpostproc    56.  3.100 / 56.  3.100
[mp3 @ 0x558a892c5000] Estimating duration from bitrate, this may be inaccurate
Input #0, mp3, from 'pronunciation_ja_ぎっくり腰.mp3':
Metadata:
title           : ぎっくり腰
artist          : Forvo
album           : Pronunciation in Japanese
comment         : https://forvo.com/word/ぎっくり腰/#ja
: https://forvo.com/license/
Duration: 00:00:02.54, start: 0.000000, bitrate: 165 kb/s
Stream #0:0: Audio: mp3, 44100 Hz, stereo, fltp, 128 kb/s
Stream #0:1: Video: png, rgb24(pc), 200x200, 90k tbr, 90k tbn (attached pic)
Metadata:
title           : Forvo
comment         : Other
Stream mapping:
Stream #0:0 (mp3float) -> loudnorm:default
loudnorm:default -> Stream #0:0 (pcm_s16le)
Output #0, null, to '/dev/null':
Metadata:
title           : ぎっくり腰
artist          : Forvo
album           : Pronunciation in Japanese
comment         : https://forvo.com/word/ぎっくり腰/#ja
: https://forvo.com/license/
encoder         : Lavf59.16.100
Stream #0:0: Audio: pcm_s16le, 192000 Hz, stereo, s16, 6144 kb/s
Metadata:
encoder         : Lavc59.18.100 pcm_s16le
video:0kB audio:1900kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
[Parsed_loudnorm_0 @ 0x558a892d9f80]
{
"input_i" : "-13.13",
"input_tp" : "-0.42",
"input_lra" : "0.00",
"input_thresh" : "-26.54",
"output_i" : "-23.01",
"output_tp" : "-10.29",
"output_lra" : "0.00",
"output_thresh" : "-36.42",
"normalization_type" : "linear",
"target_offset" : "0.01"
}
DEBUG: Loudnorm first pass command output: ffmpeg version n5.0 Copyright (c) 2000-2022 the FFmpeg developers
built with gcc 11.2.0 (GCC)
configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-amf --enable-avisynth --enable-cuda-llvm --enable-lto --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libmfx --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librav1e --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-libzimg --enable-nvdec --enable-nvenc --enable-shared --enable-version3
libavutil      57. 17.100 / 57. 17.100
libavcodec     59. 18.100 / 59. 18.100
libavformat    59. 16.100 / 59. 16.100
libavdevice    59.  4.100 / 59.  4.100
libavfilter     8. 24.100 /  8. 24.100
libswscale      6.  4.100 /  6.  4.100
libswresample   4.  3.100 /  4.  3.100
libpostproc    56.  3.100 / 56.  3.100
[mp3 @ 0x558a892c5000] Estimating duration from bitrate, this may be inaccurate
Input #0, mp3, from 'pronunciation_ja_ぎっくり腰.mp3':
Metadata:
title           : ぎっくり腰
artist          : Forvo
album           : Pronunciation in Japanese
comment         : https://forvo.com/word/ぎっくり腰/#ja
: https://forvo.com/license/
Duration: 00:00:02.54, start: 0.000000, bitrate: 165 kb/s
Stream #0:0: Audio: mp3, 44100 Hz, stereo, fltp, 128 kb/s
Stream #0:1: Video: png, rgb24(pc), 200x200, 90k tbr, 90k tbn (attached pic)
Metadata:
title           : Forvo
comment         : Other
Stream mapping:
Stream #0:0 (mp3float) -> loudnorm:default
loudnorm:default -> Stream #0:0 (pcm_s16le)
Output #0, null, to '/dev/null':
Metadata:
title           : ぎっくり腰
artist          : Forvo
album           : Pronunciation in Japanese
comment         : https://forvo.com/word/ぎっくり腰/#ja
: https://forvo.com/license/
encoder         : Lavf59.16.100
Stream #0:0: Audio: pcm_s16le, 192000 Hz, stereo, s16, 6144 kb/s
Metadata:
encoder         : Lavc59.18.100 pcm_s16le
video:0kB audio:1900kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
[Parsed_loudnorm_0 @ 0x558a892d9f80]
{
"input_i" : "-13.13",
"input_tp" : "-0.42",
"input_lra" : "0.00",
"input_thresh" : "-26.54",
"output_i" : "-23.01",
"output_tp" : "-10.29",
"output_lra" : "0.00",
"output_thresh" : "-36.42",
"normalization_type" : "linear",
"target_offset" : "0.01"
}
DEBUG: Loudnorm stats parsed: {"input_i": "-13.13", "input_tp": "-0.42", "input_lra": "0.00", "input_thresh": "-26.54", "output_i": "-23.01", "output_tp": "-10.29", "output_lra": "0.00", "output_thresh": "-36.42", "normalization_type": "linear", "target_offset": "0.01"}
INFO: Running second pass for pronunciation_ja_ぎっくり腰.mp3
DEBUG: Running command: ['/usr/bin/ffmpeg', '-y', '-nostdin', '-i', 'pronunciation_ja_ぎっくり腰.mp3', '-filter_complex', '[0:0]loudnorm=i=-23.0:lra=7.0:tp=-2.0:offset=0.01:measured_i=-13.13:measured_lra=0.0:measured_tp=-0.42:measured_thresh=-26.54: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', 'libopus', '-b:a', '128k', '-ar', '48000', '-c:s', 'copy', '/tmp/tmbn6z7a.ogg']
ERROR: Error while running command /usr/bin/ffmpeg -y -nostdin -i 'pronunciation_ja_ぎっくり腰.mp3' -filter_complex '[0:0]loudnorm=i=-23.0:lra=7.0:tp=-2.0:offset=0.01:measured_i=-13.13:measured_lra=0.0:measured_tp=-0.42:measured_thresh=-26.54: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 libopus -b:a 128k -ar 48000 -c:s copy /tmp/tmbn6z7a.ogg! Error: Error running command ['/usr/bin/ffmpeg', '-y', '-nostdin', '-i', 'pronunciation_ja_ぎっくり腰.mp3', '-filter_complex', '[0:0]loudnorm=i=-23.0:lra=7.0:tp=-2.0:offset=0.01:measured_i=-13.13:measured_lra=0.0:measured_tp=-0.42:measured_thresh=-26.54: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', 'libopus', '-b:a', '128k', '-ar', '48000', '-c:s', 'copy', '/tmp/tmbn6z7a.ogg']: ffmpeg version n5.0 Copyright (c) 2000-2022 the FFmpeg developers
built with gcc 11.2.0 (GCC)
configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-amf --enable-avisynth --enable-cuda-llvm --enable-lto --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libmfx --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librav1e --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-libzimg --enable-nvdec --enable-nvenc --enable-shared --enable-version3
libavutil      57. 17.100 / 57. 17.100
libavcodec     59. 18.100 / 59. 18.100
libavformat    59. 16.100 / 59. 16.100
libavdevice    59.  4.100 / 59.  4.100
libavfilter     8. 24.100 /  8. 24.100
libswscale      6.  4.100 /  6.  4.100
libswresample   4.  3.100 /  4.  3.100
libpostproc    56.  3.100 / 56.  3.100
[mp3 @ 0x55ea8d6d80c0] Estimating duration from bitrate, this may be inaccurate
Input #0, mp3, from 'pronunciation_ja_ぎっくり腰.mp3':
Metadata:
title           : ぎっくり腰
artist          : Forvo
album           : Pronunciation in Japanese
comment         : https://forvo.com/word/ぎっくり腰/#ja
: https://forvo.com/license/
Duration: 00:00:02.54, start: 0.000000, bitrate: 165 kb/s
Stream #0:0: Audio: mp3, 44100 Hz, stereo, fltp, 128 kb/s
Stream #0:1: Video: png, rgb24(pc), 200x200, 90k tbr, 90k tbn (attached pic)
Metadata:
title           : Forvo
comment         : Other
Stream mapping:
Stream #0:0 (mp3float) -> loudnorm:default
Stream #0:1 -> #0:0 (copy)
loudnorm:default -> Stream #0:1 (libopus)
[ogg @ 0x55ea8d6ea600] Unsupported codec id in stream 0
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Error initializing output stream 0:1 --
[Parsed_loudnorm_0 @ 0x55ea8d6ef900]
{
"input_i" : "-inf",
"input_tp" : "-inf",
"input_lra" : "0.00",
"input_thresh" : "-70.00",
"output_i" : "-inf",
"output_tp" : "-inf",
"output_lra" : "0.00",
"output_thresh" : "-70.00",
"normalization_type" : "dynamic",
"target_offset" : "inf"
}
Conversion failed!
Traceback (most recent call last):
  File "/usr/bin/ffmpeg-normalize", line 33, in <module>
    sys.exit(load_entry_point('ffmpeg-normalize==1.22.9', 'console_scripts', 'ffmpeg-normalize')())
  File "/usr/lib/python3.10/site-packages/ffmpeg_normalize/__main__.py", line 544, in main
    ffmpeg_normalize.run_normalization()
  File "/usr/lib/python3.10/site-packages/ffmpeg_normalize/_ffmpeg_normalize.py", line 195, in run_normalization
    raise e
  File "/usr/lib/python3.10/site-packages/ffmpeg_normalize/_ffmpeg_normalize.py", line 184, in run_normalization
    media_file.run_normalization()
  File "/usr/lib/python3.10/site-packages/ffmpeg_normalize/_media_file.py", line 162, in run_normalization
    for _ in self._second_pass():
  File "/usr/lib/python3.10/site-packages/ffmpeg_normalize/_media_file.py", line 369, in _second_pass
    raise e
  File "/usr/lib/python3.10/site-packages/ffmpeg_normalize/_media_file.py", line 358, in _second_pass
    raise e
  File "/usr/lib/python3.10/site-packages/ffmpeg_normalize/_media_file.py", line 350, in _second_pass
    for progress in cmd_runner.run_ffmpeg_command():
  File "/usr/lib/python3.10/site-packages/ffmpeg_normalize/_cmd_utils.py", line 66, in run_ffmpeg_command
    for progress in ff.run_command_with_progress():
  File "/usr/lib/python3.10/site-packages/ffmpeg_progress_yield/ffmpeg_progress_yield.py", line 107, in run_command_with_progress
    raise RuntimeError(
RuntimeError: Error running command ['/usr/bin/ffmpeg', '-y', '-nostdin', '-i', 'pronunciation_ja_ぎっくり腰.mp3', '-filter_complex', '[0:0]loudnorm=i=-23.0:lra=7.0:tp=-2.0:offset=0.01:measured_i=-13.13:measured_lra=0.0:measured_tp=-0.42:measured_thresh=-26.54: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', 'libopus', '-b:a', '128k', '-ar', '48000', '-c:s', 'copy', '/tmp/tmbn6z7a.ogg']: ffmpeg version n5.0 Copyright (c) 2000-2022 the FFmpeg developers
built with gcc 11.2.0 (GCC)
configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-amf --enable-avisynth --enable-cuda-llvm --enable-lto --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libmfx --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librav1e --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-libzimg --enable-nvdec --enable-nvenc --enable-shared --enable-version3
libavutil      57. 17.100 / 57. 17.100
libavcodec     59. 18.100 / 59. 18.100
libavformat    59. 16.100 / 59. 16.100
libavdevice    59.  4.100 / 59.  4.100
libavfilter     8. 24.100 /  8. 24.100
libswscale      6.  4.100 /  6.  4.100
libswresample   4.  3.100 /  4.  3.100
libpostproc    56.  3.100 / 56.  3.100
[mp3 @ 0x55ea8d6d80c0] Estimating duration from bitrate, this may be inaccurate
Input #0, mp3, from 'pronunciation_ja_ぎっくり腰.mp3':
Metadata:
title           : ぎっくり腰
artist          : Forvo
album           : Pronunciation in Japanese
comment         : https://forvo.com/word/ぎっくり腰/#ja
: https://forvo.com/license/
Duration: 00:00:02.54, start: 0.000000, bitrate: 165 kb/s
Stream #0:0: Audio: mp3, 44100 Hz, stereo, fltp, 128 kb/s
Stream #0:1: Video: png, rgb24(pc), 200x200, 90k tbr, 90k tbn (attached pic)
Metadata:
title           : Forvo
comment         : Other
Stream mapping:
Stream #0:0 (mp3float) -> loudnorm:default
Stream #0:1 -> #0:0 (copy)
loudnorm:default -> Stream #0:1 (libopus)
[ogg @ 0x55ea8d6ea600] Unsupported codec id in stream 0
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Error initializing output stream 0:1 --
[Parsed_loudnorm_0 @ 0x55ea8d6ef900]
{
"input_i" : "-inf",
"input_tp" : "-inf",
"input_lra" : "0.00",
"input_thresh" : "-70.00",
"output_i" : "-inf",
"output_tp" : "-inf",
"output_lra" : "0.00",
"output_thresh" : "-70.00",
"normalization_type" : "dynamic",
"target_offset" : "inf"
}
Conversion failed!

Environment (please complete the following information):

slhck commented 2 years ago

Your input has cover art embedded as a PNG. ffmpeg interprets this as a video. The output OGG container does not support video, so you should remove that with the -vn flag.

This is actually the same as https://github.com/slhck/ffmpeg-normalize/issues/174#issuecomment-1100296727 — I should somehow try to automatically fix these cases via some exclusions in code.

homocomputeris commented 2 years ago

Should -vn be passed to ffmpeg-normalize or as -e=-vn?

slhck commented 2 years ago

Just call:

ffmpeg-normalize pronunciation_ja_ぎっくり腰.mp3 -c:a libopus -b:a 128k -ar 48000 -vn -o normalized/out.ogg

Or upgrade to the latest version, which automatically disables video for OGG output.

(Using an extra option would also work, since the name of the option is the same for ffmpeg.)

slhck commented 2 years ago

Fixed in 1.22.10.