ffmpeg-normalize 1.31.1__tar.gz → 1.31.2__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.31.1 → ffmpeg_normalize-1.31.2}/CHANGELOG.md +5 -0
  2. {ffmpeg_normalize-1.31.1 → ffmpeg_normalize-1.31.2}/PKG-INFO +6 -1
  3. {ffmpeg_normalize-1.31.1 → ffmpeg_normalize-1.31.2}/ffmpeg_normalize/__main__.py +1 -0
  4. {ffmpeg_normalize-1.31.1 → ffmpeg_normalize-1.31.2}/ffmpeg_normalize/_ffmpeg_normalize.py +3 -0
  5. {ffmpeg_normalize-1.31.1 → ffmpeg_normalize-1.31.2}/ffmpeg_normalize/_media_file.py +22 -10
  6. ffmpeg_normalize-1.31.2/ffmpeg_normalize/_version.py +1 -0
  7. {ffmpeg_normalize-1.31.1 → ffmpeg_normalize-1.31.2}/ffmpeg_normalize.egg-info/PKG-INFO +6 -1
  8. ffmpeg_normalize-1.31.1/ffmpeg_normalize/_version.py +0 -1
  9. {ffmpeg_normalize-1.31.1 → ffmpeg_normalize-1.31.2}/LICENSE +0 -0
  10. {ffmpeg_normalize-1.31.1 → ffmpeg_normalize-1.31.2}/README.md +0 -0
  11. {ffmpeg_normalize-1.31.1 → ffmpeg_normalize-1.31.2}/ffmpeg_normalize/__init__.py +0 -0
  12. {ffmpeg_normalize-1.31.1 → ffmpeg_normalize-1.31.2}/ffmpeg_normalize/_cmd_utils.py +0 -0
  13. {ffmpeg_normalize-1.31.1 → ffmpeg_normalize-1.31.2}/ffmpeg_normalize/_errors.py +0 -0
  14. {ffmpeg_normalize-1.31.1 → ffmpeg_normalize-1.31.2}/ffmpeg_normalize/_logger.py +0 -0
  15. {ffmpeg_normalize-1.31.1 → ffmpeg_normalize-1.31.2}/ffmpeg_normalize/_streams.py +0 -0
  16. {ffmpeg_normalize-1.31.1 → ffmpeg_normalize-1.31.2}/ffmpeg_normalize/py.typed +0 -0
  17. {ffmpeg_normalize-1.31.1 → ffmpeg_normalize-1.31.2}/ffmpeg_normalize.egg-info/SOURCES.txt +0 -0
  18. {ffmpeg_normalize-1.31.1 → ffmpeg_normalize-1.31.2}/ffmpeg_normalize.egg-info/dependency_links.txt +0 -0
  19. {ffmpeg_normalize-1.31.1 → ffmpeg_normalize-1.31.2}/ffmpeg_normalize.egg-info/entry_points.txt +0 -0
  20. {ffmpeg_normalize-1.31.1 → ffmpeg_normalize-1.31.2}/ffmpeg_normalize.egg-info/not-zip-safe +0 -0
  21. {ffmpeg_normalize-1.31.1 → ffmpeg_normalize-1.31.2}/ffmpeg_normalize.egg-info/requires.txt +0 -0
  22. {ffmpeg_normalize-1.31.1 → ffmpeg_normalize-1.31.2}/ffmpeg_normalize.egg-info/top_level.txt +0 -0
  23. {ffmpeg_normalize-1.31.1 → ffmpeg_normalize-1.31.2}/setup.cfg +0 -0
  24. {ffmpeg_normalize-1.31.1 → ffmpeg_normalize-1.31.2}/setup.py +0 -0
  25. {ffmpeg_normalize-1.31.1 → ffmpeg_normalize-1.31.2}/test/out.mp4 +0 -0
  26. {ffmpeg_normalize-1.31.1 → ffmpeg_normalize-1.31.2}/test/test.mp4 +0 -0
  27. {ffmpeg_normalize-1.31.1 → ffmpeg_normalize-1.31.2}/test/test.py +0 -0
  28. {ffmpeg_normalize-1.31.1 → ffmpeg_normalize-1.31.2}/test/test.wav +0 -0
@@ -1,6 +1,11 @@
1
1
  # Changelog
2
2
 
3
3
 
4
+ ## v1.31.2 (2025-03-19)
5
+
6
+ * Fix: special handling of /dev/null.
7
+
8
+
4
9
  ## v1.31.1 (2025-02-19)
5
10
 
6
11
  * Fix bitrate setting for libvorbis, fixes #277.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ffmpeg_normalize
3
- Version: 1.31.1
3
+ Version: 1.31.2
4
4
  Summary: Normalize audio via ffmpeg
5
5
  Home-page: https://github.com/slhck/ffmpeg-normalize
6
6
  Author: Werner Robitza
@@ -667,6 +667,11 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
667
667
  # Changelog
668
668
 
669
669
 
670
+ ## v1.31.2 (2025-03-19)
671
+
672
+ * Fix: special handling of /dev/null.
673
+
674
+
670
675
  ## v1.31.1 (2025-02-19)
671
676
 
672
677
  * Fix bitrate setting for libvorbis, fixes #277.
@@ -559,6 +559,7 @@ def main() -> None:
559
559
  extra_input_options=extra_input_options,
560
560
  extra_output_options=extra_output_options,
561
561
  output_format=cli_args.output_format,
562
+ extension=cli_args.extension,
562
563
  dry_run=cli_args.dry_run,
563
564
  progress=cli_args.progress,
564
565
  )
@@ -79,6 +79,7 @@ class FFmpegNormalize:
79
79
  extra_input_options (list, optional): Extra input options. Defaults to None.
80
80
  extra_output_options (list, optional): Extra output options. Defaults to None.
81
81
  output_format (str, optional): Output format. Defaults to None.
82
+ extension (str, optional): Output file extension to use for output files that were not explicitly specified. Defaults to "mkv".
82
83
  dry_run (bool, optional): Dry run. Defaults to False.
83
84
  debug (bool, optional): Debug. Defaults to False.
84
85
  progress (bool, optional): Progress. Defaults to False.
@@ -117,6 +118,7 @@ class FFmpegNormalize:
117
118
  extra_input_options: list[str] | None = None,
118
119
  extra_output_options: list[str] | None = None,
119
120
  output_format: str | None = None,
121
+ extension: str = "mkv",
120
122
  dry_run: bool = False,
121
123
  debug: bool = False,
122
124
  progress: bool = False,
@@ -197,6 +199,7 @@ class FFmpegNormalize:
197
199
  self.post_filter = post_filter
198
200
 
199
201
  self.output_format = output_format
202
+ self.extension = extension
200
203
  self.dry_run = dry_run
201
204
  self.debug = debug
202
205
  self.progress = progress
@@ -67,7 +67,12 @@ class MediaFile:
67
67
  self.skip = False
68
68
  self.input_file = input_file
69
69
  self.output_file = output_file
70
- self.output_ext = os.path.splitext(output_file)[1][1:]
70
+ current_ext = os.path.splitext(output_file)[1][1:]
71
+ # we need to check if it's empty, e.g. /dev/null or NUL
72
+ if current_ext == "" or self.output_file == NUL:
73
+ self.output_ext = self.ffmpeg_normalize.extension
74
+ else:
75
+ self.output_ext = current_ext
71
76
  self.streams: StreamDict = {"audio": {}, "video": {}, "subtitle": {}}
72
77
 
73
78
  self.parse_streams()
@@ -424,13 +429,18 @@ class MediaFile:
424
429
  # if dry run, only show sample command
425
430
  if self.ffmpeg_normalize.dry_run:
426
431
  cmd.append(self.output_file)
432
+ _logger.warning("Dry run used, not actually running second-pass command")
427
433
  CommandRunner(dry=True).run_command(cmd)
428
434
  yield 100
429
435
  return
430
436
 
431
- temp_dir = mkdtemp()
432
- temp_file = os.path.join(temp_dir, f"out.{self.output_ext}")
433
- cmd.append(temp_file)
437
+ # special case: if output is a null device, write directly to it
438
+ if self.output_file == NUL:
439
+ cmd.append(self.output_file)
440
+ else:
441
+ temp_dir = mkdtemp()
442
+ temp_file = os.path.join(temp_dir, f"out.{self.output_ext}")
443
+ cmd.append(temp_file)
434
444
 
435
445
  cmd_runner = CommandRunner()
436
446
  try:
@@ -442,13 +452,15 @@ class MediaFile:
442
452
  )
443
453
  raise e
444
454
  else:
445
- _logger.debug(
446
- f"Moving temporary file from {temp_file} to {self.output_file}"
447
- )
448
- move(temp_file, self.output_file)
449
- rmtree(temp_dir, ignore_errors=True)
455
+ if self.output_file != NUL:
456
+ _logger.debug(
457
+ f"Moving temporary file from {temp_file} to {self.output_file}"
458
+ )
459
+ move(temp_file, self.output_file)
460
+ rmtree(temp_dir, ignore_errors=True)
450
461
  except Exception as e:
451
- rmtree(temp_dir, ignore_errors=True)
462
+ if self.output_file != NUL:
463
+ rmtree(temp_dir, ignore_errors=True)
452
464
  raise e
453
465
 
454
466
  output = cmd_runner.get_output()
@@ -0,0 +1 @@
1
+ __version__ = "1.31.2"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ffmpeg-normalize
3
- Version: 1.31.1
3
+ Version: 1.31.2
4
4
  Summary: Normalize audio via ffmpeg
5
5
  Home-page: https://github.com/slhck/ffmpeg-normalize
6
6
  Author: Werner Robitza
@@ -667,6 +667,11 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
667
667
  # Changelog
668
668
 
669
669
 
670
+ ## v1.31.2 (2025-03-19)
671
+
672
+ * Fix: special handling of /dev/null.
673
+
674
+
670
675
  ## v1.31.1 (2025-02-19)
671
676
 
672
677
  * Fix bitrate setting for libvorbis, fixes #277.
@@ -1 +0,0 @@
1
- __version__ = "1.31.1"