|
2 | 2 |
|
3 | 3 | ## File Input/Output |
4 | 4 |
|
5 | | -- `input`: Input media file(s) |
| 5 | +### `input` |
6 | 6 |
|
7 | | -- `-o OUTPUT [OUTPUT ...], --output OUTPUT [OUTPUT ...]`: Output file names. |
| 7 | +Input media file(s) |
8 | 8 |
|
9 | | - Will be applied per input file. |
| 9 | +### `-o OUTPUT [OUTPUT ...], --output OUTPUT [OUTPUT ...]` |
10 | 10 |
|
11 | | - If no output file name is specified for an input file, the output files |
12 | | - will be written to the default output folder with the name `<input>.<ext>`, where `<ext>` is the output extension (see `-ext` option). |
| 11 | +Output file names. |
13 | 12 |
|
14 | | - Example: `ffmpeg-normalize 1.wav 2.wav -o 1n.wav 2n.wav` |
| 13 | +Will be applied per input file. |
15 | 14 |
|
16 | | -- `-of OUTPUT_FOLDER, --output-folder OUTPUT_FOLDER`: Output folder (default: `normalized`) |
| 15 | +If no output file name is specified for an input file, the output files |
| 16 | +will be written to the default output folder with the name `<input>.<ext>`, where `<ext>` is the output extension (see `-ext` option). |
17 | 17 |
|
18 | | - This folder will be used for input files that have no explicit output name specified. |
| 18 | +Example: `ffmpeg-normalize 1.wav 2.wav -o 1n.wav 2n.wav` |
| 19 | + |
| 20 | +### `-of OUTPUT_FOLDER, --output-folder OUTPUT_FOLDER` |
| 21 | + |
| 22 | +Output folder (default: `normalized`) |
| 23 | + |
| 24 | +This folder will be used for input files that have no explicit output name specified. |
19 | 25 |
|
20 | 26 | ## General |
21 | 27 |
|
22 | | -- `-f, --force`: Force overwrite existing files |
| 28 | +### `-f, --force` |
| 29 | + |
| 30 | +Force overwrite existing files |
| 31 | + |
| 32 | +### `-d, --debug` |
| 33 | + |
| 34 | +Print debugging output |
| 35 | + |
| 36 | +### `-v, --verbose` |
| 37 | + |
| 38 | +Print verbose output |
| 39 | + |
| 40 | +### `-q, --quiet` |
| 41 | + |
| 42 | +Only print errors |
23 | 43 |
|
24 | | -- `-d, --debug`: Print debugging output |
| 44 | +### `-n, --dry-run` |
25 | 45 |
|
26 | | -- `-v, --verbose`: Print verbose output |
| 46 | +Do not run normalization, only print what would be done |
27 | 47 |
|
28 | | -- `-q, --quiet`: Only print errors |
| 48 | +### `-pr`, `--progress` |
29 | 49 |
|
30 | | -- `-n, --dry-run`: Do not run normalization, only print what would be done |
| 50 | +Show progress bar for files and streams |
31 | 51 |
|
32 | | -- `-pr`, `--progress`: Show progress bar for files and streams |
| 52 | +### `--version` |
33 | 53 |
|
34 | | -- `--version`: Print version and exit |
| 54 | +Print version and exit |
35 | 55 |
|
36 | 56 | ## Normalization |
37 | 57 |
|
38 | | -- `-nt {ebu,rms,peak}, --normalization-type {ebu,rms,peak}`: Normalization type (default: `ebu`). |
| 58 | +### `-nt {ebu,rms,peak}, --normalization-type {ebu,rms,peak}` |
39 | 59 |
|
40 | | - EBU normalization performs two passes and normalizes according to EBU R128. |
| 60 | +Normalization type (default: `ebu`). |
41 | 61 |
|
42 | | - RMS-based normalization brings the input file to the specified RMS level. |
| 62 | +EBU normalization performs two passes and normalizes according to EBU R128. |
43 | 63 |
|
44 | | - Peak normalization brings the signal to the specified peak level. |
| 64 | +RMS-based normalization brings the input file to the specified RMS level. |
45 | 65 |
|
46 | | -- `-t TARGET_LEVEL, --target-level TARGET_LEVEL`: Normalization target level in dB/LUFS (default: -23). |
| 66 | +Peak normalization brings the signal to the specified peak level. |
47 | 67 |
|
48 | | - For EBU normalization, it corresponds to Integrated Loudness Target in LUFS. The range is -70.0 - -5.0. |
| 68 | +### `-t TARGET_LEVEL, --target-level TARGET_LEVEL` |
49 | 69 |
|
50 | | - Otherwise, the range is -99 to 0. |
| 70 | +Normalization target level in dB/LUFS (default: -23). |
51 | 71 |
|
52 | | -- `-p, --print-stats`: Print loudness statistics for both passes formatted as JSON to stdout. |
| 72 | +For EBU normalization, it corresponds to Integrated Loudness Target in LUFS. The range is -70.0 - -5.0. |
53 | 73 |
|
54 | | -- `--replaygain`: Write [ReplayGain](https://en.wikipedia.org/wiki/ReplayGain) tags to the original file without normalizing. |
| 74 | +Otherwise, the range is -99 to 0. |
55 | 75 |
|
56 | | - This mode will overwrite the input file and ignore other options. |
| 76 | +### `-p, --print-stats` |
57 | 77 |
|
58 | | - Only works with EBU normalization, and only with .mp3, .mp4/.m4a, .ogg, .opus for now. |
| 78 | +Print loudness statistics for both passes formatted as JSON to stdout. |
| 79 | + |
| 80 | +### `--replaygain` |
| 81 | + |
| 82 | +Write [ReplayGain](https://en.wikipedia.org/wiki/ReplayGain) tags to the original file without normalizing. |
| 83 | + |
| 84 | +This mode will overwrite the input file and ignore other options. |
| 85 | + |
| 86 | +Only works with EBU normalization, and only with .mp3, .mp4/.m4a, .ogg, .opus for now. |
59 | 87 |
|
60 | 88 | ## EBU R128 Normalization |
61 | 89 |
|
62 | | -- `-lrt LOUDNESS_RANGE_TARGET, --loudness-range-target LOUDNESS_RANGE_TARGET`: EBU Loudness Range Target in LUFS (default: 7.0). |
| 90 | +### `-lrt LOUDNESS_RANGE_TARGET, --loudness-range-target LOUDNESS_RANGE_TARGET` |
| 91 | + |
| 92 | +EBU Loudness Range Target in LUFS (default: 7.0). |
| 93 | + |
| 94 | +Range is 1.0 - 50.0. |
| 95 | + |
| 96 | +### `--keep-loudness-range-target` |
| 97 | + |
| 98 | +Keep the input loudness range target to allow for linear normalization. |
| 99 | + |
| 100 | +### `--keep-lra-above-loudness-range-target` |
| 101 | + |
| 102 | +Keep input loudness range above loudness range target. |
63 | 103 |
|
64 | | - Range is 1.0 - 50.0. |
| 104 | +Can be used as an alternative to `--keep-loudness-range-target` to allow for linear normalization. |
65 | 105 |
|
66 | | -- `--keep-loudness-range-target`: Keep the input loudness range target to allow for linear normalization. |
| 106 | +### `-tp TRUE_PEAK, --true-peak TRUE_PEAK` |
67 | 107 |
|
68 | | -- `--keep-lra-above-loudness-range-target`: Keep input loudness range above loudness range target. |
| 108 | +EBU Maximum True Peak in dBTP (default: -2.0). |
69 | 109 |
|
70 | | - Can be used as an alternative to `--keep-loudness-range-target` to allow for linear normalization. |
| 110 | +Range is -9.0 - +0.0. |
71 | 111 |
|
72 | | -- `-tp TRUE_PEAK, --true-peak TRUE_PEAK`: EBU Maximum True Peak in dBTP (default: -2.0). |
| 112 | +### `--offset OFFSET` |
73 | 113 |
|
74 | | - Range is -9.0 - +0.0. |
| 114 | +EBU Offset Gain (default: 0.0). |
75 | 115 |
|
76 | | -- `--offset OFFSET`: EBU Offset Gain (default: 0.0). |
| 116 | +The gain is applied before the true-peak limiter in the first pass only. The offset for the second pass will be automatically determined based on the first pass statistics. |
77 | 117 |
|
78 | | - The gain is applied before the true-peak limiter in the first pass only. The offset for the second pass will be automatically determined based on the first pass statistics. |
| 118 | +Range is -99.0 - +99.0. |
79 | 119 |
|
80 | | - Range is -99.0 - +99.0. |
| 120 | +### `--lower-only` |
81 | 121 |
|
82 | | -- `--lower-only`: Whether the audio should not increase in loudness. |
| 122 | +Whether the audio should not increase in loudness. |
83 | 123 |
|
84 | | - If the measured loudness from the first pass is lower than the target loudness then normalization pass will be skipped for the measured audio source. |
| 124 | +If the measured loudness from the first pass is lower than the target loudness then normalization pass will be skipped for the measured audio source. |
85 | 125 |
|
86 | | -- `--auto-lower-loudness-target`: Automatically lower EBU Integrated Loudness Target. |
| 126 | +### `--auto-lower-loudness-target` |
87 | 127 |
|
88 | | - Automatically lower EBU Integrated Loudness Target to prevent falling back to dynamic filtering. |
| 128 | +Automatically lower EBU Integrated Loudness Target. |
89 | 129 |
|
90 | | - Makes sure target loudness is lower than measured loudness minus peak loudness (input_i - input_tp) by a small amount. |
| 130 | +Automatically lower EBU Integrated Loudness Target to prevent falling back to dynamic filtering. |
91 | 131 |
|
92 | | -- `--dual-mono`: Treat mono input files as "dual-mono". |
| 132 | +Makes sure target loudness is lower than measured loudness minus peak loudness (input_i - input_tp) by a small amount. |
93 | 133 |
|
94 | | - If a mono file is intended for playback on a stereo system, its EBU R128 measurement will be perceptually incorrect. If set, this option will compensate for this effect. Multi-channel input files are not affected by this option. |
| 134 | +### `--dual-mono` |
95 | 135 |
|
96 | | -- `--dynamic`: Force dynamic normalization mode. |
| 136 | +Treat mono input files as "dual-mono". |
97 | 137 |
|
98 | | - Instead of applying linear EBU R128 normalization, choose a dynamic normalization. This is not usually recommended. |
| 138 | +If a mono file is intended for playback on a stereo system, its EBU R128 measurement will be perceptually incorrect. If set, this option will compensate for this effect. Multi-channel input files are not affected by this option. |
99 | 139 |
|
100 | | - Dynamic mode will automatically change the sample rate to 192 kHz. Use `-ar`/`--sample-rate` to specify a different output sample rate. |
| 140 | +### `--dynamic` |
| 141 | + |
| 142 | +Force dynamic normalization mode. |
| 143 | + |
| 144 | +Instead of applying linear EBU R128 normalization, choose a dynamic normalization. This is not usually recommended. |
| 145 | + |
| 146 | +Dynamic mode will automatically change the sample rate to 192 kHz. Use `-ar`/`--sample-rate` to specify a different output sample rate. |
101 | 147 |
|
102 | 148 | ## Audio Encoding |
103 | 149 |
|
104 | | -- `-c:a AUDIO_CODEC, --audio-codec AUDIO_CODEC`: Audio codec to use for output files. |
| 150 | +### `-c:a AUDIO_CODEC, --audio-codec AUDIO_CODEC` |
| 151 | + |
| 152 | +Audio codec to use for output files. |
| 153 | + |
| 154 | +See `ffmpeg -encoders` for a list. |
| 155 | + |
| 156 | +Will use PCM audio with input stream bit depth by default. |
| 157 | + |
| 158 | +### `-b:a AUDIO_BITRATE, --audio-bitrate AUDIO_BITRATE` |
| 159 | + |
| 160 | +Audio bitrate in bits/s, or with K suffix. |
| 161 | + |
| 162 | +If not specified, will use codec default. |
| 163 | + |
| 164 | +### `-ar SAMPLE_RATE, --sample-rate SAMPLE_RATE` |
105 | 165 |
|
106 | | - See `ffmpeg -encoders` for a list. |
| 166 | +Audio sample rate to use for output files in Hz. |
107 | 167 |
|
108 | | - Will use PCM audio with input stream bit depth by default. |
| 168 | +Will use input sample rate by default, except for EBU normalization, which will change the input sample rate to 192 kHz. |
109 | 169 |
|
110 | | -- `-b:a AUDIO_BITRATE, --audio-bitrate AUDIO_BITRATE`: Audio bitrate in bits/s, or with K suffix. |
| 170 | +### `-ac`, `--audio-channels` |
111 | 171 |
|
112 | | - If not specified, will use codec default. |
| 172 | +Set the number of audio channels. If not specified, the input channel layout will be used. This is equivalent to `-ac` in ffmpeg. |
113 | 173 |
|
114 | | -- `-ar SAMPLE_RATE, --sample-rate SAMPLE_RATE`: Audio sample rate to use for output files in Hz. |
| 174 | +### `-koa, --keep-original-audio` |
115 | 175 |
|
116 | | - Will use input sample rate by default, except for EBU normalization, which will change the input sample rate to 192 kHz. |
| 176 | +Copy original, non-normalized audio streams to output file |
117 | 177 |
|
118 | | -- `-ac`, `--audio-channels`: Set the number of audio channels. If not specified, the input channel layout will be used. This is equivalent to `-ac` in ffmpeg. |
| 178 | +### `-prf PRE_FILTER, --pre-filter PRE_FILTER` |
119 | 179 |
|
120 | | -- `-koa, --keep-original-audio`: Copy original, non-normalized audio streams to output file |
| 180 | +Add an audio filter chain before applying normalization. |
121 | 181 |
|
122 | | -- `-prf PRE_FILTER, --pre-filter PRE_FILTER`: Add an audio filter chain before applying normalization. |
| 182 | +Multiple filters can be specified by comma-separating them. |
123 | 183 |
|
124 | | - Multiple filters can be specified by comma-separating them. |
| 184 | +### `-pof POST_FILTER, --post-filter POST_FILTER` |
125 | 185 |
|
126 | | -- `-pof POST_FILTER, --post-filter POST_FILTER`: Add an audio filter chain after applying normalization. |
| 186 | +Add an audio filter chain after applying normalization. |
127 | 187 |
|
128 | | - Multiple filters can be specified by comma-separating them. |
| 188 | +Multiple filters can be specified by comma-separating them. |
129 | 189 |
|
130 | | - For EBU, the filter will be applied during the second pass. |
| 190 | +For EBU, the filter will be applied during the second pass. |
131 | 191 |
|
132 | 192 | ## Other Encoding Options |
133 | 193 |
|
134 | | -- `-vn, --video-disable`: Do not write video streams to output |
| 194 | +### `-vn, --video-disable` |
135 | 195 |
|
136 | | -- `-c:v VIDEO_CODEC, --video-codec VIDEO_CODEC`: Video codec to use for output files (default: 'copy'). |
| 196 | +Do not write video streams to output |
137 | 197 |
|
138 | | - See `ffmpeg -encoders` for a list. |
| 198 | +### `-c:v VIDEO_CODEC, --video-codec VIDEO_CODEC` |
139 | 199 |
|
140 | | - Will attempt to copy video codec by default. |
| 200 | +Video codec to use for output files (default: 'copy'). |
141 | 201 |
|
142 | | -- `-sn, --subtitle-disable`: Do not write subtitle streams to output |
| 202 | +See `ffmpeg -encoders` for a list. |
143 | 203 |
|
144 | | -- `-mn, --metadata-disable`: Do not write metadata to output |
| 204 | +Will attempt to copy video codec by default. |
145 | 205 |
|
146 | | -- `-cn, --chapters-disable`: Do not write chapters to output |
| 206 | +### `-sn, --subtitle-disable` |
| 207 | + |
| 208 | +Do not write subtitle streams to output |
| 209 | + |
| 210 | +### `-mn, --metadata-disable` |
| 211 | + |
| 212 | +Do not write metadata to output |
| 213 | + |
| 214 | +### `-cn, --chapters-disable` |
| 215 | + |
| 216 | +Do not write chapters to output |
147 | 217 |
|
148 | 218 | ## Input/Output Format |
149 | 219 |
|
150 | | -- `-ei EXTRA_INPUT_OPTIONS, --extra-input-options EXTRA_INPUT_OPTIONS`: Extra input options list. |
| 220 | +### `-ei EXTRA_INPUT_OPTIONS, --extra-input-options EXTRA_INPUT_OPTIONS` |
| 221 | + |
| 222 | +Extra input options list. |
| 223 | + |
| 224 | +A list of extra ffmpeg command line arguments valid for the input, applied before ffmpeg's `-i`. |
| 225 | + |
| 226 | +You can either use a JSON-formatted list (i.e., a list of comma-separated, quoted elements within square brackets), or a simple string of space-separated arguments. |
| 227 | + |
| 228 | +If JSON is used, you need to wrap the whole argument in quotes to prevent shell expansion and to preserve literal quotes inside the string. If a simple string is used, you need to specify the argument with `-e=`. |
151 | 229 |
|
152 | | - A list of extra ffmpeg command line arguments valid for the input, applied before ffmpeg's `-i`. |
| 230 | +Examples: `-ei '[ "-f", "mpegts", "-r", "24" ]'` or `-ei="-f mpegts -r 24"` |
153 | 231 |
|
154 | | - You can either use a JSON-formatted list (i.e., a list of comma-separated, quoted elements within square brackets), or a simple string of space-separated arguments. |
| 232 | +### `-e EXTRA_OUTPUT_OPTIONS, --extra-output-options EXTRA_OUTPUT_OPTIONS` |
155 | 233 |
|
156 | | - If JSON is used, you need to wrap the whole argument in quotes to prevent shell expansion and to preserve literal quotes inside the string. If a simple string is used, you need to specify the argument with `-e=`. |
| 234 | +Extra output options list. |
157 | 235 |
|
158 | | - Examples: `-ei '[ "-f", "mpegts", "-r", "24" ]'` or `-ei="-f mpegts -r 24"` |
| 236 | +A list of extra ffmpeg command line arguments valid for the output. |
159 | 237 |
|
160 | | -- `-e EXTRA_OUTPUT_OPTIONS, --extra-output-options EXTRA_OUTPUT_OPTIONS`: Extra output options list. |
| 238 | +You can either use a JSON-formatted list (i.e., a list of comma-separated, quoted elements within square brackets), or a simple string of space-separated arguments. |
161 | 239 |
|
162 | | - A list of extra ffmpeg command line arguments valid for the output. |
| 240 | +If JSON is used, you need to wrap the whole argument in quotes to prevent shell expansion and to preserve literal quotes inside the string. If a simple string is used, you need to specify the argument with `-e=`. |
163 | 241 |
|
164 | | - You can either use a JSON-formatted list (i.e., a list of comma-separated, quoted elements within square brackets), or a simple string of space-separated arguments. |
| 242 | +Examples: `-e '[ "-vbr", "3", "-preset:v", "ultrafast" ]'` or `-e="-vbr 3 -preset:v ultrafast"` |
165 | 243 |
|
166 | | - If JSON is used, you need to wrap the whole argument in quotes to prevent shell expansion and to preserve literal quotes inside the string. If a simple string is used, you need to specify the argument with `-e=`. |
| 244 | +### `-ofmt OUTPUT_FORMAT, --output-format OUTPUT_FORMAT` |
167 | 245 |
|
168 | | - Examples: `-e '[ "-vbr", "3", "-preset:v", "ultrafast" ]'` or `-e="-vbr 3 -preset:v ultrafast"` |
| 246 | +Media format to use for output file(s). |
169 | 247 |
|
170 | | -- `-ofmt OUTPUT_FORMAT, --output-format OUTPUT_FORMAT`: Media format to use for output file(s). |
| 248 | +See `ffmpeg -formats` for a list. |
171 | 249 |
|
172 | | - See `ffmpeg -formats` for a list. |
| 250 | +If not specified, the format will be inferred by ffmpeg from the output file name. If the output file name is not explicitly specified, the extension will govern the format (see '--extension' option). |
173 | 251 |
|
174 | | - If not specified, the format will be inferred by ffmpeg from the output file name. If the output file name is not explicitly specified, the extension will govern the format (see '--extension' option). |
| 252 | +### `-ext EXTENSION, --extension EXTENSION` |
175 | 253 |
|
176 | | -- `-ext EXTENSION, --extension EXTENSION`: Output file extension to use for output files that were not explicitly specified. (Default: `mkv`) |
| 254 | +Output file extension to use for output files that were not explicitly specified. (Default: `mkv`) |
177 | 255 |
|
178 | 256 | ## Environment Variables |
179 | 257 |
|
180 | 258 | The program additionally respects environment variables: |
181 | 259 |
|
182 | | -- `TMP` / `TEMP` / `TMPDIR` |
| 260 | +### `TMP` / `TEMP` / `TMPDIR` |
183 | 261 |
|
184 | | - Sets the path to the temporary directory in which files are |
185 | | - stored before being moved to the final output directory. |
186 | | - Note: You need to use full paths. |
| 262 | +Sets the path to the temporary directory in which files are |
| 263 | +stored before being moved to the final output directory. |
| 264 | +Note: You need to use full paths. |
187 | 265 |
|
188 | | -- `FFMPEG_PATH` |
| 266 | +### `FFMPEG_PATH` |
189 | 267 |
|
190 | | - Sets the full path to an `ffmpeg` executable other than |
191 | | - the system default or you can provide a file name available on $PATH |
| 268 | +Sets the full path to an `ffmpeg` executable other than |
| 269 | +the system default or you can provide a file name available on $PATH |
0 commit comments