ffmpeg-normalize 1.28.3__tar.gz → 1.29.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. {ffmpeg-normalize-1.28.3 → ffmpeg-normalize-1.29.1}/CHANGELOG.md +10 -0
  2. {ffmpeg-normalize-1.28.3/ffmpeg_normalize.egg-info → ffmpeg-normalize-1.29.1}/PKG-INFO +13 -1
  3. {ffmpeg-normalize-1.28.3 → ffmpeg-normalize-1.29.1}/README.md +2 -0
  4. {ffmpeg-normalize-1.28.3 → ffmpeg-normalize-1.29.1}/ffmpeg_normalize/__main__.py +15 -1
  5. {ffmpeg-normalize-1.28.3 → ffmpeg-normalize-1.29.1}/ffmpeg_normalize/_ffmpeg_normalize.py +3 -0
  6. {ffmpeg-normalize-1.28.3 → ffmpeg-normalize-1.29.1}/ffmpeg_normalize/_media_file.py +2 -0
  7. ffmpeg-normalize-1.29.1/ffmpeg_normalize/_version.py +1 -0
  8. {ffmpeg-normalize-1.28.3 → ffmpeg-normalize-1.29.1/ffmpeg_normalize.egg-info}/PKG-INFO +13 -1
  9. {ffmpeg-normalize-1.28.3 → ffmpeg-normalize-1.29.1}/test/test.py +15 -0
  10. ffmpeg-normalize-1.28.3/ffmpeg_normalize/_version.py +0 -1
  11. {ffmpeg-normalize-1.28.3 → ffmpeg-normalize-1.29.1}/LICENSE +0 -0
  12. {ffmpeg-normalize-1.28.3 → ffmpeg-normalize-1.29.1}/ffmpeg_normalize/__init__.py +0 -0
  13. {ffmpeg-normalize-1.28.3 → ffmpeg-normalize-1.29.1}/ffmpeg_normalize/_cmd_utils.py +0 -0
  14. {ffmpeg-normalize-1.28.3 → ffmpeg-normalize-1.29.1}/ffmpeg_normalize/_errors.py +0 -0
  15. {ffmpeg-normalize-1.28.3 → ffmpeg-normalize-1.29.1}/ffmpeg_normalize/_logger.py +0 -0
  16. {ffmpeg-normalize-1.28.3 → ffmpeg-normalize-1.29.1}/ffmpeg_normalize/_streams.py +0 -0
  17. {ffmpeg-normalize-1.28.3 → ffmpeg-normalize-1.29.1}/ffmpeg_normalize/py.typed +0 -0
  18. {ffmpeg-normalize-1.28.3 → ffmpeg-normalize-1.29.1}/ffmpeg_normalize.egg-info/SOURCES.txt +0 -0
  19. {ffmpeg-normalize-1.28.3 → ffmpeg-normalize-1.29.1}/ffmpeg_normalize.egg-info/dependency_links.txt +0 -0
  20. {ffmpeg-normalize-1.28.3 → ffmpeg-normalize-1.29.1}/ffmpeg_normalize.egg-info/entry_points.txt +0 -0
  21. {ffmpeg-normalize-1.28.3 → ffmpeg-normalize-1.29.1}/ffmpeg_normalize.egg-info/not-zip-safe +0 -0
  22. {ffmpeg-normalize-1.28.3 → ffmpeg-normalize-1.29.1}/ffmpeg_normalize.egg-info/requires.txt +0 -0
  23. {ffmpeg-normalize-1.28.3 → ffmpeg-normalize-1.29.1}/ffmpeg_normalize.egg-info/top_level.txt +0 -0
  24. {ffmpeg-normalize-1.28.3 → ffmpeg-normalize-1.29.1}/setup.cfg +0 -0
  25. {ffmpeg-normalize-1.28.3 → ffmpeg-normalize-1.29.1}/setup.py +0 -0
  26. {ffmpeg-normalize-1.28.3 → ffmpeg-normalize-1.29.1}/test/out.mp4 +0 -0
  27. {ffmpeg-normalize-1.28.3 → ffmpeg-normalize-1.29.1}/test/test.mp4 +0 -0
  28. {ffmpeg-normalize-1.28.3 → ffmpeg-normalize-1.29.1}/test/test.wav +0 -0
@@ -1,6 +1,16 @@
1
1
  # Changelog
2
2
 
3
3
 
4
+ ## v1.29.1 (2024-10-22)
5
+
6
+ * Fix: override argparse usage.
7
+
8
+
9
+ ## v1.29.0 (2024-10-14)
10
+
11
+ * Add option to set audio channels directly.
12
+
13
+
4
14
  ## v1.28.3 (2024-08-16)
5
15
 
6
16
  * Make colorama dependency windows-only.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ffmpeg-normalize
3
- Version: 1.28.3
3
+ Version: 1.29.1
4
4
  Summary: Normalize audio via ffmpeg
5
5
  Home-page: https://github.com/slhck/ffmpeg-normalize
6
6
  Author: Werner Robitza
@@ -320,6 +320,8 @@ For more information on the options (`[options]`) available, run `ffmpeg-normali
320
320
 
321
321
  Will use input sample rate by default, except for EBU normalization, which will change the input sample rate to 192 kHz.
322
322
 
323
+ - `-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.
324
+
323
325
  - `-koa, --keep-original-audio`: Copy original, non-normalized audio streams to output file
324
326
 
325
327
  - `-prf PRE_FILTER, --pre-filter PRE_FILTER`: Add an audio filter chain before applying normalization.
@@ -592,6 +594,16 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
592
594
  # Changelog
593
595
 
594
596
 
597
+ ## v1.29.1 (2024-10-22)
598
+
599
+ * Fix: override argparse usage.
600
+
601
+
602
+ ## v1.29.0 (2024-10-14)
603
+
604
+ * Add option to set audio channels directly.
605
+
606
+
595
607
  ## v1.28.3 (2024-08-16)
596
608
 
597
609
  * Make colorama dependency windows-only.
@@ -295,6 +295,8 @@ For more information on the options (`[options]`) available, run `ffmpeg-normali
295
295
 
296
296
  Will use input sample rate by default, except for EBU normalization, which will change the input sample rate to 192 kHz.
297
297
 
298
+ - `-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.
299
+
298
300
  - `-koa, --keep-original-audio`: Copy original, non-normalized audio streams to output file
299
301
 
300
302
  - `-prf PRE_FILTER, --pre-filter PRE_FILTER`: Add an audio filter chain before applying normalization.
@@ -26,7 +26,9 @@ def create_parser() -> argparse.ArgumentParser:
26
26
  ffmpeg-normalize v{} -- command line tool for normalizing audio files
27
27
  """.format(__version__)
28
28
  ),
29
- # usage="%(prog)s INPUT [INPUT ...] [-o OUTPUT [OUTPUT ...]] [options]",
29
+ # manually overridden because argparse generates the wrong order of arguments, see:
30
+ # https://github.com/slhck/ffmpeg-normalize/issues/132#issuecomment-662516535
31
+ usage="%(prog)s INPUT [INPUT ...] [-o OUTPUT [OUTPUT ...]] [options]",
30
32
  formatter_class=argparse.RawTextHelpFormatter,
31
33
  epilog=textwrap.dedent(
32
34
  """\
@@ -303,6 +305,17 @@ def create_parser() -> argparse.ArgumentParser:
303
305
  """
304
306
  ),
305
307
  )
308
+ group_acodec.add_argument(
309
+ "-ac",
310
+ "--audio-channels",
311
+ type=int,
312
+ help=textwrap.dedent(
313
+ """\
314
+ Set the number of audio channels.
315
+ If not specified, the input channel layout will be used.
316
+ """
317
+ ),
318
+ )
306
319
  group_acodec.add_argument(
307
320
  "-koa",
308
321
  "--keep-original-audio",
@@ -506,6 +519,7 @@ def main() -> None:
506
519
  audio_codec=cli_args.audio_codec,
507
520
  audio_bitrate=cli_args.audio_bitrate,
508
521
  sample_rate=cli_args.sample_rate,
522
+ audio_channels=cli_args.audio_channels,
509
523
  keep_original_audio=cli_args.keep_original_audio,
510
524
  pre_filter=cli_args.pre_filter,
511
525
  post_filter=cli_args.post_filter,
@@ -63,6 +63,7 @@ class FFmpegNormalize:
63
63
  audio_codec (str, optional): Audio codec. Defaults to "pcm_s16le".
64
64
  audio_bitrate (float, optional): Audio bitrate. Defaults to None.
65
65
  sample_rate (int, optional): Sample rate. Defaults to None.
66
+ audio_channels (int | None, optional): Audio channels. Defaults to None.
66
67
  keep_original_audio (bool, optional): Keep original audio. Defaults to False.
67
68
  pre_filter (str, optional): Pre filter. Defaults to None.
68
69
  post_filter (str, optional): Post filter. Defaults to None.
@@ -98,6 +99,7 @@ class FFmpegNormalize:
98
99
  audio_codec: str = "pcm_s16le",
99
100
  audio_bitrate: float | None = None,
100
101
  sample_rate: float | int | None = None,
102
+ audio_channels: int | None = None,
101
103
  keep_original_audio: bool = False,
102
104
  pre_filter: str | None = None,
103
105
  post_filter: str | None = None,
@@ -170,6 +172,7 @@ class FFmpegNormalize:
170
172
  self.dual_mono = dual_mono
171
173
  self.dynamic = dynamic
172
174
  self.sample_rate = None if sample_rate is None else int(sample_rate)
175
+ self.audio_channels = None if audio_channels is None else int(audio_channels)
173
176
 
174
177
  self.audio_codec = audio_codec
175
178
  self.audio_bitrate = audio_bitrate
@@ -355,6 +355,8 @@ class MediaFile:
355
355
  cmd.extend(["-b:a", str(self.ffmpeg_normalize.audio_bitrate)])
356
356
  if self.ffmpeg_normalize.sample_rate:
357
357
  cmd.extend(["-ar", str(self.ffmpeg_normalize.sample_rate)])
358
+ if self.ffmpeg_normalize.audio_channels:
359
+ cmd.extend(["-ac", str(self.ffmpeg_normalize.audio_channels)])
358
360
 
359
361
  # ... and subtitles
360
362
  if not self.ffmpeg_normalize.subtitle_disable:
@@ -0,0 +1 @@
1
+ __version__ = "1.29.1"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ffmpeg-normalize
3
- Version: 1.28.3
3
+ Version: 1.29.1
4
4
  Summary: Normalize audio via ffmpeg
5
5
  Home-page: https://github.com/slhck/ffmpeg-normalize
6
6
  Author: Werner Robitza
@@ -320,6 +320,8 @@ For more information on the options (`[options]`) available, run `ffmpeg-normali
320
320
 
321
321
  Will use input sample rate by default, except for EBU normalization, which will change the input sample rate to 192 kHz.
322
322
 
323
+ - `-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.
324
+
323
325
  - `-koa, --keep-original-audio`: Copy original, non-normalized audio streams to output file
324
326
 
325
327
  - `-prf PRE_FILTER, --pre-filter PRE_FILTER`: Add an audio filter chain before applying normalization.
@@ -592,6 +594,16 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
592
594
  # Changelog
593
595
 
594
596
 
597
+ ## v1.29.1 (2024-10-22)
598
+
599
+ * Fix: override argparse usage.
600
+
601
+
602
+ ## v1.29.0 (2024-10-14)
603
+
604
+ * Add option to set audio channels directly.
605
+
606
+
595
607
  ## v1.28.3 (2024-08-16)
596
608
 
597
609
  * Make colorama dependency windows-only.
@@ -460,3 +460,18 @@ class TestFFmpegNormalize:
460
460
  ["test/test.mp4", "-ext", "wav", "-vn", "-f", "q"]
461
461
  )
462
462
  assert "only supports one stream" not in stderr
463
+
464
+ def test_audio_channels(self):
465
+ ffmpeg_normalize_call(
466
+ ["test/test.mp4", "-ac", "1", "-o", "normalized/test.wav"]
467
+ )
468
+ assert os.path.isfile("normalized/test.wav")
469
+ stream_info = _get_stream_info("normalized/test.wav")[0]
470
+ assert stream_info["channels"] == 1
471
+
472
+ ffmpeg_normalize_call(
473
+ ["test/test.mp4", "-ac", "2", "-o", "normalized/test2.wav"]
474
+ )
475
+ assert os.path.isfile("normalized/test2.wav")
476
+ stream_info = _get_stream_info("normalized/test2.wav")[0]
477
+ assert stream_info["channels"] == 2
@@ -1 +0,0 @@
1
- __version__ = "1.28.3"