ffmpeg-normalize 1.41.0__tar.gz → 1.41.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 (17) hide show
  1. {ffmpeg_normalize-1.41.0 → ffmpeg_normalize-1.41.1}/PKG-INFO +1 -1
  2. {ffmpeg_normalize-1.41.0 → ffmpeg_normalize-1.41.1}/pyproject.toml +1 -1
  3. {ffmpeg_normalize-1.41.0 → ffmpeg_normalize-1.41.1}/src/ffmpeg_normalize/_cmd_utils.py +13 -2
  4. {ffmpeg_normalize-1.41.0 → ffmpeg_normalize-1.41.1}/LICENSE.md +0 -0
  5. {ffmpeg_normalize-1.41.0 → ffmpeg_normalize-1.41.1}/README.md +0 -0
  6. {ffmpeg_normalize-1.41.0 → ffmpeg_normalize-1.41.1}/src/ffmpeg_normalize/__init__.py +0 -0
  7. {ffmpeg_normalize-1.41.0 → ffmpeg_normalize-1.41.1}/src/ffmpeg_normalize/__main__.py +0 -0
  8. {ffmpeg_normalize-1.41.0 → ffmpeg_normalize-1.41.1}/src/ffmpeg_normalize/_errors.py +0 -0
  9. {ffmpeg_normalize-1.41.0 → ffmpeg_normalize-1.41.1}/src/ffmpeg_normalize/_ffmpeg_normalize.py +0 -0
  10. {ffmpeg_normalize-1.41.0 → ffmpeg_normalize-1.41.1}/src/ffmpeg_normalize/_logger.py +0 -0
  11. {ffmpeg_normalize-1.41.0 → ffmpeg_normalize-1.41.1}/src/ffmpeg_normalize/_media_file.py +0 -0
  12. {ffmpeg_normalize-1.41.0 → ffmpeg_normalize-1.41.1}/src/ffmpeg_normalize/_presets.py +0 -0
  13. {ffmpeg_normalize-1.41.0 → ffmpeg_normalize-1.41.1}/src/ffmpeg_normalize/_streams.py +0 -0
  14. {ffmpeg_normalize-1.41.0 → ffmpeg_normalize-1.41.1}/src/ffmpeg_normalize/data/presets/music.json +0 -0
  15. {ffmpeg_normalize-1.41.0 → ffmpeg_normalize-1.41.1}/src/ffmpeg_normalize/data/presets/podcast.json +0 -0
  16. {ffmpeg_normalize-1.41.0 → ffmpeg_normalize-1.41.1}/src/ffmpeg_normalize/data/presets/streaming-video.json +0 -0
  17. {ffmpeg_normalize-1.41.0 → ffmpeg_normalize-1.41.1}/src/ffmpeg_normalize/py.typed +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ffmpeg-normalize
3
- Version: 1.41.0
3
+ Version: 1.41.1
4
4
  Summary: Normalize audio via ffmpeg
5
5
  Keywords: ffmpeg,normalize,audio
6
6
  Author: Werner Robitza
@@ -4,7 +4,7 @@ build-backend = "uv_build"
4
4
 
5
5
  [project]
6
6
  name = "ffmpeg-normalize"
7
- version = "1.41.0"
7
+ version = "1.41.1"
8
8
  description = "Normalize audio via ffmpeg"
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -6,6 +6,7 @@ import os
6
6
  import re
7
7
  import shlex
8
8
  import subprocess
9
+ import sys
9
10
  from contextlib import contextmanager
10
11
  from shutil import which
11
12
  from typing import Any, Iterator
@@ -40,6 +41,16 @@ def _get_ffmpeg_env() -> dict[str, str] | None:
40
41
  return _ffmpeg_env_var.get()
41
42
 
42
43
 
44
+ def _get_ffmpeg_popen_kwargs() -> dict[str, Any]:
45
+ """Return common keyword arguments for ffmpeg subprocesses."""
46
+ kwargs: dict[str, Any] = {"env": _get_ffmpeg_env()}
47
+ if sys.platform == "win32":
48
+ # Hide consoles spawned by GUI applications. See https://github.com/slhck/ffmpeg-normalize/issues/319.
49
+ # Add a public context manager if callers ever need to opt out.
50
+ kwargs["creationflags"] = subprocess.CREATE_NO_WINDOW
51
+ return kwargs
52
+
53
+
43
54
  DUR_REGEX = re.compile(
44
55
  r"Duration: (?P<hour>\d{2}):(?P<min>\d{2}):(?P<sec>\d{2})\.(?P<ms>\d{2})"
45
56
  )
@@ -124,7 +135,7 @@ class CommandRunner:
124
135
  _logger.debug(f"Running command: {shlex.join(cmd)}")
125
136
  with FfmpegProgress(cmd, dry_run=self.dry) as ff:
126
137
  yield from ff.run_command_with_progress(
127
- popen_kwargs={"env": _get_ffmpeg_env()}
138
+ popen_kwargs=_get_ffmpeg_popen_kwargs()
128
139
  )
129
140
 
130
141
  self.output = ff.stderr
@@ -156,7 +167,7 @@ class CommandRunner:
156
167
  stdout=subprocess.PIPE,
157
168
  stderr=subprocess.PIPE,
158
169
  universal_newlines=False,
159
- env=_get_ffmpeg_env(),
170
+ **_get_ffmpeg_popen_kwargs(),
160
171
  )
161
172
 
162
173
  stdout_bytes, stderr_bytes = p.communicate()