Skip to content

No change in level #312

@rsholmes

Description

@rsholmes

Perhaps I am misunderstanding how to use this, but if I run ffmpeg-normalize on an m4a with low level, for instance test.m4a from this repository, then the output file normalized/test.m4a has exactly the same low level.

Audio spectrum on output file from Audacity:

Image

Checklist (please tick all boxes)

  • [√ ] I am using the latest version of ffmpeg-normalize (run pip3 install --upgrade ffmpeg-normalize)
  • [ √] I am using the latest stable version of ffmpeg or a recent build from Git master

Expected behavior
Expect normalized level

Actual behavior
No change in level

Command

ffmpeg-normalize test.m4a -c:a aac -ext --debug

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

DEBUG: Running command: /usr/local/bin/ffmpeg -filters
DEBUG: Validating all input files before processing...
DEBUG: Running command: /usr/local/bin/ffmpeg -i test.m4a -c copy -t 0 -map 0 -f null /dev/null
DEBUG: Current extension is set from output file, using extension: m4a
DEBUG: Parsing streams of test.m4a
DEBUG: Running command: /usr/local/bin/ffmpeg -i test.m4a -c copy -t 0 -map 0 -f null /dev/null
DEBUG: Stream parsing command output:
DEBUG: ffmpeg version 8.1 Copyright (c) 2000-2026 the FFmpeg developers
  built with gcc 13 (Ubuntu 13.3.0-6ubuntu2~24.04.1)
  configuration: --prefix=/usr/local --disable-static --enable-shared --enable-gpl --enable-libx264 --enable-libx265 --enable-libvpx --enable-libmp3lame --enable-libopus --enable-libaom --enable-libass --enable-libfreetype --enable-libvorbis --enable-libtheora
  libavutil      60. 26.100 / 60. 26.100
  libavcodec     62. 28.100 / 62. 28.100
  libavformat    62. 12.100 / 62. 12.100
  libavdevice    62.  3.100 / 62.  3.100
  libavfilter    11. 14.100 / 11. 14.100
  libswscale      9.  5.100 /  9.  5.100
  libswresample   6.  3.100 /  6.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test.m4a':
  Metadata:
    major_brand     : M4A 
    minor_version   : 512
    compatible_brands: M4A isomiso2
    encoder         : Lavf62.3.100
  Duration: 00:00:03.00, start: 0.000000, bitrate: 68 kb/s
  Stream #0:0[0x1](und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 64 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Output #0, null, to '/dev/null':
  Metadata:
    major_brand     : M4A 
    minor_version   : 512
    compatible_brands: M4A isomiso2
    encoder         : Lavf62.12.100
  Stream #0:0(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 64 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
Press [q] to stop, [?] for help
[out#0/null @ 0x5fbfb3ed84c0] video:0KiB audio:0KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: unknown
size=N/A time=00:00:00.13 bitrate=N/A speed=1.05e+03x elapsed=0:00:00.00    

DEBUG: Found duration: 3.0 s
DEBUG: Found audio stream at index 0 (default: True)
DEBUG: Created MediaStream for test.m4a, audio stream 0
INFO: Normalizing file test.m4a (1 of 1)
DEBUG: Running normalization for test.m4a
DEBUG: Parsing normalization info for test.m4a
INFO: Running first pass loudnorm filter for stream 0
DEBUG: Running command: /usr/local/bin/ffmpeg -hide_banner -y -i test.m4a -map 0:0 -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: Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test.m4a':
Metadata:
major_brand     : M4A
minor_version   : 512
compatible_brands: M4A isomiso2
encoder         : Lavf62.3.100
Duration: 00:00:03.00, start: 0.000000, bitrate: 68 kb/s
Stream #0:0[0x1](und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 64 kb/s (default)
Metadata:
handler_name    : SoundHandler
Stream mapping:
Stream #0:0 (aac) -> loudnorm:default
loudnorm:default -> Stream #0:0 (pcm_s16le)
Stream #0:0 -> #0:1 (aac (native) -> pcm_s16le (native))
Press [q] to stop, [?] for help
Output #0, null, to '/dev/null':
Metadata:
major_brand     : M4A
minor_version   : 512
compatible_brands: M4A isomiso2
encoder         : Lavf62.12.100
Stream #0:0: Audio: pcm_s16le, 192000 Hz, mono, s16, 3072 kb/s
Metadata:
encoder         : Lavc62.28.100 pcm_s16le
Stream #0:1(und): Audio: pcm_s16le, 44100 Hz, mono, s16, 705 kb/s (default)
Metadata:
encoder         : Lavc62.28.100 pcm_s16le
handler_name    : SoundHandler
[Parsed_loudnorm_0 @ 0x77853c0020c0]
{
"input_i" : "-22.53",
"input_tp" : "-17.38",
"input_lra" : "0.40",
"input_thresh" : "-35.36",
"output_i" : "-19.91",
"output_tp" : "-14.76",
"output_lra" : "0.00",
"output_thresh" : "-32.59",
"normalization_type" : "dynamic",
"target_offset" : "-3.09"
}
[out#0/null @ 0x61aa50a1df40] video:0KiB audio:1392KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: unknown
DEBUG: Loudnorm first pass command output: Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test.m4a':
Metadata:
major_brand     : M4A
minor_version   : 512
compatible_brands: M4A isomiso2
encoder         : Lavf62.3.100
Duration: 00:00:03.00, start: 0.000000, bitrate: 68 kb/s
Stream #0:0[0x1](und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 64 kb/s (default)
Metadata:
handler_name    : SoundHandler
Stream mapping:
Stream #0:0 (aac) -> loudnorm:default
loudnorm:default -> Stream #0:0 (pcm_s16le)
Stream #0:0 -> #0:1 (aac (native) -> pcm_s16le (native))
Press [q] to stop, [?] for help
Output #0, null, to '/dev/null':
Metadata:
major_brand     : M4A
minor_version   : 512
compatible_brands: M4A isomiso2
encoder         : Lavf62.12.100
Stream #0:0: Audio: pcm_s16le, 192000 Hz, mono, s16, 3072 kb/s
Metadata:
encoder         : Lavc62.28.100 pcm_s16le
Stream #0:1(und): Audio: pcm_s16le, 44100 Hz, mono, s16, 705 kb/s (default)
Metadata:
encoder         : Lavc62.28.100 pcm_s16le
handler_name    : SoundHandler
[Parsed_loudnorm_0 @ 0x77853c0020c0]
{
"input_i" : "-22.53",
"input_tp" : "-17.38",
"input_lra" : "0.40",
"input_thresh" : "-35.36",
"output_i" : "-19.91",
"output_tp" : "-14.76",
"output_lra" : "0.00",
"output_thresh" : "-32.59",
"normalization_type" : "dynamic",
"target_offset" : "-3.09"
}
[out#0/null @ 0x61aa50a1df40] video:0KiB audio:1392KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: unknown
DEBUG: Parsing loudnorm stats from output
DEBUG: Loudnorm stats for stream 0 parsed: {
"input_i" : "-22.53",
"input_tp" : "-17.38",
"input_lra" : "0.40",
"input_thresh" : "-35.36",
"output_i" : "-19.91",
"output_tp" : "-14.76",
"output_lra" : "0.00",
"output_thresh" : "-32.59",
"normalization_type" : "dynamic",
"target_offset" : "-3.09"
}
INFO: Running second pass for test.m4a
DEBUG: Running command: /usr/local/bin/ffmpeg -hide_banner -y -i test.m4a -filter_complex '[0:0]loudnorm=i=-23.0:lra=7.0:tp=-2.0:offset=-3.09:measured_i=-22.53:measured_lra=0.4:measured_tp=-17.38:measured_thresh=-35.36:linear=true:print_format=json[norm0]' -map_metadata 0 -map_metadata:s:a:0 0:s:a:0 -map_chapters 0 -map '[norm0]' -c:a:0 aac -c:s copy /tmp/tmp9rkalhs8/out.m4a
DEBUG: ffmpeg output: Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test.m4a':
Metadata:
major_brand     : M4A
minor_version   : 512
compatible_brands: M4A isomiso2
encoder         : Lavf62.3.100
Duration: 00:00:03.00, start: 0.000000, bitrate: 68 kb/s
Stream #0:0[0x1](und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 64 kb/s (default)
Metadata:
handler_name    : SoundHandler
Stream mapping:
Stream #0:0 (aac) -> loudnorm:default
loudnorm:default -> Stream #0:0 (aac)
Press [q] to stop, [?] for help
Output #0, ipod, to '/tmp/tmp9rkalhs8/out.m4a':
Metadata:
major_brand     : M4A
minor_version   : 512
compatible_brands: M4A isomiso2
encoder         : Lavf62.12.100
Stream #0:0(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 69 kb/s
Metadata:
encoder         : Lavc62.28.100 aac
handler_name    : SoundHandler
[Parsed_loudnorm_0 @ 0x74e070002640]
{
"input_i" : "-22.48",
"input_tp" : "-17.39",
"input_lra" : "0.00",
"input_thresh" : "-35.16",
"output_i" : "-22.96",
"output_tp" : "-17.86",
"output_lra" : "0.00",
"output_thresh" : "-35.64",
"normalization_type" : "linear",
"target_offset" : "-0.04"
}
[out#0/ipod @ 0x59ef87eff540] video:0KiB audio:26KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: 5.005675%
[aac @ 0x59ef87efdc00] Qavg: 102.227
DEBUG: Moving temporary file from /tmp/tmp9rkalhs8/out.m4a to normalized/test.m4a
DEBUG: Parsing loudnorm stats from output
DEBUG: Loudnorm stats for stream 0 parsed: {
"input_i" : "-22.48",
"input_tp" : "-17.39",
"input_lra" : "0.00",
"input_thresh" : "-35.16",
"output_i" : "-22.96",
"output_tp" : "-17.86",
"output_lra" : "0.00",
"output_thresh" : "-35.64",
"normalization_type" : "linear",
"target_offset" : "-0.04"
}
DEBUG: Setting second pass stats for stream 0 from {'input_i': -22.48, 'input_tp': -17.39, 'input_lra': 0.0, 'input_thresh': -35.16, 'output_i': -22.96, 'output_tp': -17.86, 'output_lra': 0.0, 'output_thresh': -35.64, 'normalization_type': 'linear', 'target_offset': -0.04}
DEBUG: Normalization finished
DEBUG: Stripping ReplayGain tags from normalized/test.m4a
INFO: Normalized file written to normalized/test.m4a

Environment (please complete the following information):

  • Your operating system: Linux Mint 22.3
  • Your Python version / distribution (python3 --version or python --version): Python 3.12.3
  • Your ffmpeg version (ffmpeg -version):
ffmpeg version 8.1 Copyright (c) 2000-2026 the FFmpeg developers
built with gcc 13 (Ubuntu 13.3.0-6ubuntu2~24.04.1)
configuration: --prefix=/usr/local --disable-static --enable-shared --enable-gpl --enable-libx264 --enable-libx265 --enable-libvpx --enable-libmp3lame --enable-libopus --enable-libaom --enable-libass --enable-libfreetype --enable-libvorbis --enable-libtheora
libavutil      60. 26.100 / 60. 26.100
libavcodec     62. 28.100 / 62. 28.100
libavformat    62. 12.100 / 62. 12.100
libavdevice    62.  3.100 / 62.  3.100
libavfilter    11. 14.100 / 11. 14.100
libswscale      9.  5.100 /  9.  5.100
libswresample   6.  3.100 /  6.  3.100

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions