Skip to content

Commit 49d46d8

Browse files
committed
docs: document --keep-mtime and bit-depth preservation
Update the CLI options reference and the What's New / Features sections, and regenerate the bash and zsh shell completions for the new options.
1 parent 200832e commit 49d46d8

7 files changed

Lines changed: 60 additions & 4 deletions

File tree

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,14 @@ This program normalizes media files to a certain loudness level using the EBU R1
3333

3434
## 🆕 What's New
3535

36+
- Version 1.39.0 preserves the **input bit depth** by default when encoding to formats like FLAC, so 16-bit input stays 16-bit without needing `-e "-sample_fmt s16"`. Use `--no-keep-bit-depth` to opt out. It also adds `--keep-mtime` to copy the input file's modification time to the output, which is useful for preserving when a track was added to a music library.
37+
38+
Example:
39+
40+
```bash
41+
ffmpeg-normalize input.flac -nt peak -t 0 -c:a flac --keep-mtime -o output.flac
42+
```
43+
3644
- Version 1.38.0 writes the normalized output directly to the destination without using temporary files
3745

3846
- Version 1.36.0 introduces **presets** with `--preset`! Save and reuse your favorite normalization configurations for different use cases. Comes with three built-in presets: `podcast` (AES standard), `music` (RMS-based batch normalization), and `streaming-video` (video content). Create custom presets too!

completions/ffmpeg-normalize-shtab.bash

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33

44

5-
_shtab_ffmpeg_normalize_option_strings=('-h' '--help' '--input-list' '-o' '--output' '-of' '--output-folder' '-f' '--force' '-d' '--debug' '-v' '--verbose' '-q' '--quiet' '-n' '--dry-run' '-pr' '--progress' '--version' '--preset' '--list-presets' '-nt' '--normalization-type' '-t' '--target-level' '-p' '--print-stats' '--replaygain' '--batch' '-lrt' '--loudness-range-target' '--keep-loudness-range-target' '--keep-lra-above-loudness-range-target' '-tp' '--true-peak' '--offset' '--lower-only' '--auto-lower-loudness-target' '--dual-mono' '--dynamic' '-as' '--audio-streams' '--audio-default-only' '--keep-other-audio' '-c:a' '--audio-codec' '-b:a' '--audio-bitrate' '-ar' '--sample-rate' '-ac' '--audio-channels' '-koa' '--keep-original-audio' '-prf' '--pre-filter' '-pof' '--post-filter' '-vn' '--video-disable' '-c:v' '--video-codec' '-sn' '--subtitle-disable' '-mn' '--metadata-disable' '-cn' '--chapters-disable' '-ei' '--extra-input-options' '-e' '--extra-output-options' '-ofmt' '--output-format' '-ext' '--extension')
5+
_shtab_ffmpeg_normalize_option_strings=('-h' '--help' '--input-list' '-o' '--output' '-of' '--output-folder' '--keep-mtime' '-f' '--force' '-d' '--debug' '-v' '--verbose' '-q' '--quiet' '-n' '--dry-run' '-pr' '--progress' '--version' '--preset' '--list-presets' '-nt' '--normalization-type' '-t' '--target-level' '-p' '--print-stats' '--replaygain' '--batch' '-lrt' '--loudness-range-target' '--keep-loudness-range-target' '--keep-lra-above-loudness-range-target' '-tp' '--true-peak' '--offset' '--lower-only' '--auto-lower-loudness-target' '--dual-mono' '--dynamic' '-as' '--audio-streams' '--audio-default-only' '--keep-other-audio' '-c:a' '--audio-codec' '-b:a' '--audio-bitrate' '-ar' '--sample-rate' '-ac' '--audio-channels' '-koa' '--keep-original-audio' '--keep-bit-depth' '--no-keep-bit-depth' '-prf' '--pre-filter' '-pof' '--post-filter' '-vn' '--video-disable' '-c:v' '--video-codec' '-sn' '--subtitle-disable' '-mn' '--metadata-disable' '-cn' '--chapters-disable' '-ei' '--extra-input-options' '-e' '--extra-output-options' '-ofmt' '--output-format' '-ext' '--extension')
66

77

88

@@ -14,6 +14,7 @@ _shtab_ffmpeg_normalize__h_nargs=0
1414
_shtab_ffmpeg_normalize___help_nargs=0
1515
_shtab_ffmpeg_normalize__o_nargs=+
1616
_shtab_ffmpeg_normalize___output_nargs=+
17+
_shtab_ffmpeg_normalize___keep_mtime_nargs=0
1718
_shtab_ffmpeg_normalize__f_nargs=0
1819
_shtab_ffmpeg_normalize___force_nargs=0
1920
_shtab_ffmpeg_normalize__d_nargs=0
@@ -42,6 +43,8 @@ _shtab_ffmpeg_normalize___audio_default_only_nargs=0
4243
_shtab_ffmpeg_normalize___keep_other_audio_nargs=0
4344
_shtab_ffmpeg_normalize__koa_nargs=0
4445
_shtab_ffmpeg_normalize___keep_original_audio_nargs=0
46+
_shtab_ffmpeg_normalize___keep_bit_depth_nargs=0
47+
_shtab_ffmpeg_normalize___no_keep_bit_depth_nargs=0
4548
_shtab_ffmpeg_normalize__vn_nargs=0
4649
_shtab_ffmpeg_normalize___video_disable_nargs=0
4750
_shtab_ffmpeg_normalize__sn_nargs=0

completions/ffmpeg-normalize-shtab.zsh

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
_shtab_ffmpeg_normalize_commands() {
77
local _commands=(
8-
8+
99
)
1010
_describe 'ffmpeg-normalize commands' _commands
1111
}
@@ -26,6 +26,11 @@ Example\: ffmpeg-normalize 1.wav 2.wav -o 1n.wav 2n.wav
2626
This folder will be used for input files that have no explicit output
2727
name specified.
2828
]:output_folder:"
29+
"--keep-mtime[Copy the input file\'s modification time to the output file.
30+
31+
Only the access and modification times are copied\; a file\'s creation
32+
time (tracked separately on some operating systems) is not affected.
33+
]"
2934
{-f,--force}"[Force overwrite existing files]"
3035
{-d,--debug}"[Print debugging output]"
3136
{-v,--verbose}"[Print verbose output]"
@@ -54,7 +59,7 @@ level.
5459
5560
Peak normalization brings the signal to the specified peak level.
5661
]:normalization_type:(ebu rms peak)"
57-
{-t,--target-level}"[Normalization target level in dB\/LUFS (default\: -23).
62+
{-t,--target-level}"[Normalization target level in dB\/LUFS (default\: -23.0).
5863
5964
For EBU normalization, it corresponds to Integrated Loudness Target
6065
in LUFS. The range is -70.0 - -5.0.
@@ -155,6 +160,18 @@ which will change the input sample rate to 192 kHz.
155160
If not specified, the input channel layout will be used.
156161
]:audio_channels:"
157162
{-koa,--keep-original-audio}"[Copy original, non-normalized audio streams to output file]"
163+
{--keep-bit-depth,--no-keep-bit-depth}"[Carry the detected input bit depth through to the output encoder
164+
(default\: enabled).
165+
166+
By default, the matching output sample format is set for the chosen
167+
encoder (e.g. FLAC), so you do not need to pass it via
168+
\`-e\`\/\`--extra-output-options\` yourself. Use \`--no-keep-bit-depth\` to let
169+
the encoder pick its own sample format instead.
170+
171+
The chosen sample format is constrained to what the encoder supports.
172+
ffmpeg has no 24-bit sample format, so 24-bit audio is carried in the
173+
32-bit \`s32\` format. Floating-point sources are left to the encoder.
174+
]:keep_bit_depth:"
158175
{-prf,--pre-filter}"[Add an audio filter chain before applying normalization.
159176
Multiple filters can be specified by comma-separating them.
160177
]:pre_filter:"
@@ -231,7 +248,7 @@ _shtab_ffmpeg_normalize() {
231248
(( CURRENT += 1 ))
232249
curcontext="${curcontext%:*:*}:_shtab_ffmpeg_normalize-$line[1]:"
233250
case $line[1] in
234-
251+
235252
esac
236253
esac
237254
}

completions/ffmpeg-normalize.bash

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ _ffmpeg_normalize()
1010
opts="--input-list \
1111
-o --output \
1212
-of --output-folder \
13+
--keep-mtime \
1314
-f --force \
1415
-d --debug \
1516
-v --verbose \
@@ -38,6 +39,7 @@ _ffmpeg_normalize()
3839
-ar --sample-rate \
3940
-ac --audio-channels \
4041
-koa --keep-original-audio \
42+
--keep-bit-depth --no-keep-bit-depth \
4143
-prf --pre-filter \
4244
-pof --post-filter \
4345
-vn --video-disable \

completions/ffmpeg-normalize.zsh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ _ffmpeg_normalize() {
1010
'--input-list[Read input list from file]:input list:_files'
1111
'(-o --output)'{-o,--output}'[Output file names]:output file:_files'
1212
'(-of --output-folder)'{-of,--output-folder}'[Output folder (default: normalized)]:directory:_files -/'
13+
'--keep-mtime[Copy the input file modification time to the output file]'
1314

1415
# General Options
1516
'(-f --force)'{-f,--force}'[Force overwrite existing files]'
@@ -46,6 +47,7 @@ _ffmpeg_normalize() {
4647
'(-ar --sample-rate)'{-ar,--sample-rate}'[Audio sample rate]:sample rate:'
4748
'(-ac --audio-channels)'{-ac,--audio-channels}'[Number of audio channels]:channels:'
4849
'(-koa --keep-original-audio)'{-koa,--keep-original-audio}'[Keep original audio streams]'
50+
'(--keep-bit-depth --no-keep-bit-depth)'{--keep-bit-depth,--no-keep-bit-depth}'[Carry the input bit depth through to the output encoder (default: on)]'
4951
'(-prf --pre-filter)'{-prf,--pre-filter}'[Pre-normalization audio filter]:filter:'
5052
'(-pof --post-filter)'{-pof,--post-filter}'[Post-normalization audio filter]:filter:'
5153

docs/index.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@ Batch processing of several input files is possible, including video files.
3131

3232
## 🆕 What's New
3333

34+
- Version 1.39.0 preserves the **input bit depth** by default when encoding to formats like FLAC, so 16-bit input stays 16-bit without needing `-e "-sample_fmt s16"`. Use `--no-keep-bit-depth` to opt out. It also adds `--keep-mtime` to copy the input file's modification time to the output, which is useful for preserving when a track was added to a music library.
35+
36+
Example:
37+
38+
```bash
39+
ffmpeg-normalize input.flac -nt peak -t 0 -c:a flac --keep-mtime -o output.flac
40+
```
41+
3442
- Version 1.38.0 writes the normalized output directly to its destination without using temporary files
3543

3644
- Version 1.36.0 introduces **presets** with `--preset`! Save and reuse your favorite normalization configurations for different use cases. Comes with three built-in presets: `podcast` (AES standard), `music` (RMS-based batch normalization), and `streaming-video` (video content). Create custom presets too!

docs/usage/cli-options.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ Output folder (default: `normalized`)
3131

3232
This folder will be used for input files that have no explicit output name specified.
3333

34+
### `--keep-mtime`
35+
36+
Copy the input file's modification time to the output file.
37+
38+
This is useful when you want to preserve the time a file was originally added to your collection (e.g. for sorting in a music library). Only the access and modification times are copied; a file's creation time (which some operating systems such as Windows track separately) is not affected.
39+
3440
## General
3541

3642
### `-f, --force`
@@ -222,6 +228,16 @@ Set the number of audio channels. If not specified, the input channel layout wil
222228

223229
Copy original, non-normalized audio streams to output file
224230

231+
### `--keep-bit-depth`, `--no-keep-bit-depth`
232+
233+
Carry the detected input bit depth through to the output encoder. This is enabled by default.
234+
235+
When you specify a non-PCM encoder (e.g. `-c:a flac`), ffmpeg would otherwise pick its own default sample format, which can promote 16-bit audio to 24-bit. With bit-depth preservation, the matching output sample format is set for you, so you no longer need to pass it via `-e`/`--extra-output-options` (e.g. `-e "-sample_fmt s16"`). Use `--no-keep-bit-depth` to let the encoder choose its own sample format instead.
236+
237+
The chosen sample format is constrained to what the encoder actually supports. Note that ffmpeg has no 24-bit sample format, so 24-bit audio is carried in the 32-bit `s32` format (and the encoder stores it accordingly). Floating-point sources are left to the encoder, and for lossy encoders that only support floating-point formats (e.g. AAC) this has no effect.
238+
239+
Example: `ffmpeg-normalize input.flac -nt peak -t 0 -c:a flac -o output.flac`
240+
225241
## Audio Stream Selection
226242

227243
### `-as AUDIO_STREAMS, --audio-streams AUDIO_STREAMS`

0 commit comments

Comments
 (0)