better-ffmpeg-progress 2.5.1__tar.gz → 2.5.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: better-ffmpeg-progress
3
- Version: 2.5.1
3
+ Version: 2.5.2
4
4
  Summary: Run FFmpeg & see percentage progress + ETA.
5
5
  Home-page: https://github.com/CrypticSignal/better-ffmpeg-progress
6
6
  Author: GitHub.com/CrypticSignal
@@ -167,3 +167,6 @@ The `run` method takes the following **optional** arguments:
167
167
 
168
168
  [11/11/2024]
169
169
  - [v2.5.1] Print the correct log file.
170
+
171
+ [12/11/2024]
172
+ - [v2.5.2] Drain any remaining FFmpeg stderr after the process ends.
@@ -148,4 +148,7 @@ The `run` method takes the following **optional** arguments:
148
148
  - [v2.5.0] Add an option to print FFmpeg stderr on a new line if better progress information cannot be shown.
149
149
 
150
150
  [11/11/2024]
151
- - [v2.5.1] Print the correct log file.
151
+ - [v2.5.1] Print the correct log file.
152
+
153
+ [12/11/2024]
154
+ - [v2.5.2] Drain any remaining FFmpeg stderr after the process ends.
@@ -228,14 +228,15 @@ class FfmpegProcess:
228
228
  try:
229
229
  stderr = stderr_queue.get_nowait()
230
230
 
231
- if self._duration_secs is None:
232
- print(
233
- stderr,
234
- end="\n" if self._print_stderr_new_line else "\r",
235
- flush=True,
236
- )
237
-
238
- self._ffmpeg_stderr.append(stderr)
231
+ if stderr:
232
+ self._ffmpeg_stderr.append(stderr)
233
+
234
+ if self._duration_secs is None:
235
+ print(
236
+ stderr,
237
+ end="\n" if self._print_stderr_new_line else "\r",
238
+ flush=True,
239
+ )
239
240
  except Empty:
240
241
  pass
241
242
 
@@ -245,6 +246,23 @@ class FfmpegProcess:
245
246
  f"{"\n" if self._duration_secs is None else ""}[KeyboardInterrupt] FFmpeg process(es) killed."
246
247
  )
247
248
 
249
+ # After the process ends, drain any remaining stderr
250
+ while True:
251
+ try:
252
+ stderr = stderr_queue.get_nowait()
253
+
254
+ if stderr:
255
+ self._ffmpeg_stderr.append(stderr)
256
+
257
+ if self._duration_secs is None:
258
+ print(
259
+ stderr,
260
+ end="\n" if self._print_stderr_new_line else "\r",
261
+ flush=True,
262
+ )
263
+ except Empty:
264
+ break
265
+
248
266
  return process.returncode
249
267
 
250
268
  def run(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: better-ffmpeg-progress
3
- Version: 2.5.1
3
+ Version: 2.5.2
4
4
  Summary: Run FFmpeg & see percentage progress + ETA.
5
5
  Home-page: https://github.com/CrypticSignal/better-ffmpeg-progress
6
6
  Author: GitHub.com/CrypticSignal
@@ -167,3 +167,6 @@ The `run` method takes the following **optional** arguments:
167
167
 
168
168
  [11/11/2024]
169
169
  - [v2.5.1] Print the correct log file.
170
+
171
+ [12/11/2024]
172
+ - [v2.5.2] Drain any remaining FFmpeg stderr after the process ends.
@@ -5,7 +5,7 @@ with open("README.md", "r", encoding="utf-8") as f:
5
5
 
6
6
  setuptools.setup(
7
7
  name="better-ffmpeg-progress",
8
- version="2.5.1",
8
+ version="2.5.2",
9
9
  author="GitHub.com/CrypticSignal",
10
10
  author_email="theaudiophile@outlook.com",
11
11
  description="Run FFmpeg & see percentage progress + ETA.",