talks-reducer 0.3.1__py3-none-any.whl → 0.3.2__py3-none-any.whl

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.
talks_reducer/cli.py CHANGED
@@ -6,6 +6,7 @@ import argparse
6
6
  import os
7
7
  import sys
8
8
  import time
9
+ from importlib import import_module
9
10
  from importlib.metadata import version
10
11
  from pathlib import Path
11
12
  from typing import Dict, List, Optional, Sequence
@@ -23,19 +24,19 @@ def _build_parser() -> argparse.ArgumentParser:
23
24
  parser = argparse.ArgumentParser(
24
25
  description="Modifies a video file to play at different speeds when there is sound vs. silence.",
25
26
  )
26
-
27
+
27
28
  # Add version argument
28
29
  try:
29
30
  pkg_version = version("talks-reducer")
30
31
  except Exception:
31
32
  pkg_version = "unknown"
32
-
33
+
33
34
  parser.add_argument(
34
35
  "--version",
35
36
  action="version",
36
37
  version=f"talks-reducer {pkg_version}",
37
38
  )
38
-
39
+
39
40
  parser.add_argument(
40
41
  "input_file",
41
42
  type=str,
@@ -113,31 +114,34 @@ def gather_input_files(paths: List[str]) -> List[str]:
113
114
  return files
114
115
 
115
116
 
117
+ def _launch_gui(argv: Sequence[str]) -> bool:
118
+ """Attempt to launch the GUI with the provided arguments."""
119
+
120
+ try:
121
+ gui_module = import_module(".gui", __package__)
122
+ except ImportError:
123
+ return False
124
+
125
+ gui_main = getattr(gui_module, "main", None)
126
+ if gui_main is None:
127
+ return False
128
+
129
+ return bool(gui_main(list(argv)))
130
+
131
+
116
132
  def main(argv: Optional[Sequence[str]] = None) -> None:
117
133
  """Entry point for the command line interface.
118
134
 
119
135
  Launch the GUI when run without arguments, otherwise defer to the CLI.
120
136
  """
121
137
 
122
- # Check if running without arguments
123
138
  if argv is None:
124
139
  argv_list = sys.argv[1:]
125
140
  else:
126
141
  argv_list = list(argv)
127
142
 
128
- # Launch GUI if no arguments provided
129
143
  if not argv_list:
130
- gui_launched = False
131
-
132
- try:
133
- from .gui import main as gui_main
134
-
135
- gui_launched = gui_main([])
136
- except ImportError:
137
- # GUI dependencies not available, show help instead
138
- gui_launched = False
139
-
140
- if gui_launched:
144
+ if _launch_gui(argv_list):
141
145
  return
142
146
 
143
147
  parser = _build_parser()
@@ -145,7 +149,7 @@ def main(argv: Optional[Sequence[str]] = None) -> None:
145
149
  return
146
150
 
147
151
  parser = _build_parser()
148
- parsed_args = parser.parse_args(argv)
152
+ parsed_args = parser.parse_args(argv_list)
149
153
  start_time = time.time()
150
154
 
151
155
  files = gather_input_files(parsed_args.input_file)
talks_reducer/ffmpeg.py CHANGED
@@ -38,6 +38,7 @@ def find_ffmpeg() -> Optional[str]:
38
38
  # Try bundled ffmpeg from imageio-ffmpeg first
39
39
  try:
40
40
  import imageio_ffmpeg
41
+
41
42
  bundled_path = imageio_ffmpeg.get_ffmpeg_exe()
42
43
  if bundled_path and os.path.isfile(bundled_path):
43
44
  return bundled_path
@@ -161,11 +162,11 @@ def check_cuda_available(ffmpeg_path: Optional[str] = None) -> bool:
161
162
  try:
162
163
  ffmpeg_path = ffmpeg_path or get_ffmpeg_path()
163
164
  result = subprocess.run(
164
- [ffmpeg_path, "-encoders"],
165
- capture_output=True,
166
- text=True,
165
+ [ffmpeg_path, "-encoders"],
166
+ capture_output=True,
167
+ text=True,
167
168
  timeout=5,
168
- creationflags=creationflags
169
+ creationflags=creationflags,
169
170
  )
170
171
  except (
171
172
  subprocess.TimeoutExpired,
@@ -193,7 +194,7 @@ def run_timed_ffmpeg_command(
193
194
  process_callback: Optional[callable] = None,
194
195
  ) -> None:
195
196
  """Execute an FFmpeg command while streaming progress information.
196
-
197
+
197
198
  Args:
198
199
  process_callback: Optional callback that receives the subprocess.Popen object
199
200
  """
@@ -243,7 +244,7 @@ def run_timed_ffmpeg_command(
243
244
 
244
245
  sys.stderr.write(line)
245
246
  sys.stderr.flush()
246
-
247
+
247
248
  # Send FFmpeg output to reporter for GUI display
248
249
  progress_reporter.log(line.strip())
249
250
 
talks_reducer/gui.py CHANGED
@@ -1215,10 +1215,10 @@ class TalksReducerGUI:
1215
1215
  self.drop_hint_button.grid_remove()
1216
1216
  self.open_button.grid()
1217
1217
  self.open_button.lift() # Ensure open_button is above drop_hint_button
1218
- print("success status")
1218
+ # print("success status")
1219
1219
  else:
1220
1220
  self.open_button.grid_remove()
1221
- print("not success status")
1221
+ # print("not success status")
1222
1222
  if (
1223
1223
  self.simple_mode_var.get()
1224
1224
  and not is_processing
talks_reducer/pipeline.py CHANGED
@@ -158,7 +158,7 @@ def speed_up_video(
158
158
  )
159
159
 
160
160
  reporter.log("Extracting audio...")
161
- process_callback = getattr(reporter, 'process_callback', None)
161
+ process_callback = getattr(reporter, "process_callback", None)
162
162
  run_timed_ffmpeg_command(
163
163
  extract_command,
164
164
  reporter=reporter,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: talks-reducer
3
- Version: 0.3.1
3
+ Version: 0.3.2
4
4
  Summary: CLI for speeding up long-form talks by removing silence
5
5
  Author: Talks Reducer Maintainers
6
6
  License-Expression: MIT
@@ -32,6 +32,10 @@ project was renamed from **jumpcutter** to emphasize its focus on conference tal
32
32
  - 1h 19m, 751 MB — Talks Reducer
33
33
  - 1h 19m, 171 MB — Talks Reducer `--small`
34
34
 
35
+ ## Changelog
36
+
37
+ See [CHANGELOG.md](CHANGELOG.md).
38
+
35
39
  ## Install GUI (Windows, macOS)
36
40
  Go to the [releases page](https://github.com/popstas/talks-reducer/releases) and download the appropriate artifact:
37
41
 
@@ -50,9 +54,9 @@ pip install talks-reducer
50
54
  The `--small` preset applies a 720p video scale and 128 kbps audio bitrate, making it useful for sharing talks over constrained
51
55
  connections. Without `--small`, the script aims to preserve original quality while removing silence.
52
56
 
53
- > **Tip:** Running `talks-reducer-gui` without arguments opens the Tkinter interface. Passing regular CLI options (for example,
54
- > `talks-reducer-gui --small input.mp4`) now executes the command-line pipeline, so you can keep a single shortcut for both
55
- > workflows.
57
+ > **Tip:** The `talks-reducer` and `talks-reducer-gui` commands now behave the same way: launching them without arguments opens
58
+ > the Tkinter interface, while passing regular CLI options (for example, `talks-reducer --small input.mp4`) executes the
59
+ > command-line pipeline. You can keep a single shortcut for both workflows.
56
60
 
57
61
  When CUDA-capable hardware is available the pipeline leans on GPU encoders to keep export times low, but it still runs great on
58
62
  CPUs.
@@ -0,0 +1,16 @@
1
+ talks_reducer/__init__.py,sha256=lb50C4_o_SLERyMyVpQfgHnXf49FJOIF9j05MZ8KAvM,158
2
+ talks_reducer/__main__.py,sha256=azR_vh8HFPLaOnh-L6gUFWsL67I6iHtbeH5rQhsipGY,299
3
+ talks_reducer/audio.py,sha256=sjHMeY0H9ESG-Gn5BX0wFRBX7sXjWwsgS8u9Vb0bJ88,4396
4
+ talks_reducer/chunks.py,sha256=IpdZxRFPURSG5wP-OQ_p09CVP8wcKwIFysV29zOTSWI,2959
5
+ talks_reducer/cli.py,sha256=QmQeezgZmkEkZDfdbfQpRlZJy5rtVBm81HLM-ibh670,6567
6
+ talks_reducer/ffmpeg.py,sha256=CVrxwNcWHrzvxTzoALtx5UdNWXxxfOFYF3FES7lvaO4,11680
7
+ talks_reducer/gui.py,sha256=Oq2kXERlDEGqxgYsVSjObOPt811tGl-a6DbVPBR8YLs,53683
8
+ talks_reducer/models.py,sha256=6cZRcJf0EBZIzNd-PWrh4Wdsoa4EBj5nSdB6BnFiOXM,1106
9
+ talks_reducer/pipeline.py,sha256=yQtvoDGMGjveTo35OtY11CX25-l4EQZCOLMFVtvHFbk,8871
10
+ talks_reducer/progress.py,sha256=Mh43M6VWhjjUv9CI22xfD2EJ_7Aq3PCueqefQ9Bd5-o,4565
11
+ talks_reducer-0.3.2.dist-info/licenses/LICENSE,sha256=jN17mHNR3e84awmH3AbpWBcBDBzPxEH0rcOFoj1s7sQ,1124
12
+ talks_reducer-0.3.2.dist-info/METADATA,sha256=IhoNZ2kWejZdp0QbgUHoZbFSx2dK36sbKHSyrS7NxAE,7773
13
+ talks_reducer-0.3.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
14
+ talks_reducer-0.3.2.dist-info/entry_points.txt,sha256=LCzfSnh_7VXhvl9twoFSAj0C3sG7bayWs2LkxpH7hoI,100
15
+ talks_reducer-0.3.2.dist-info/top_level.txt,sha256=pJWGcy__LR9JIEKH3QJyFmk9XrIsiFtqvuMNxFdIzDU,14
16
+ talks_reducer-0.3.2.dist-info/RECORD,,
@@ -1,16 +0,0 @@
1
- talks_reducer/__init__.py,sha256=lb50C4_o_SLERyMyVpQfgHnXf49FJOIF9j05MZ8KAvM,158
2
- talks_reducer/__main__.py,sha256=azR_vh8HFPLaOnh-L6gUFWsL67I6iHtbeH5rQhsipGY,299
3
- talks_reducer/audio.py,sha256=sjHMeY0H9ESG-Gn5BX0wFRBX7sXjWwsgS8u9Vb0bJ88,4396
4
- talks_reducer/chunks.py,sha256=IpdZxRFPURSG5wP-OQ_p09CVP8wcKwIFysV29zOTSWI,2959
5
- talks_reducer/cli.py,sha256=ZQcay6NF32g0PF7OGLKWPY1TbIR1Hx2xaRlzOXK1lto,6508
6
- talks_reducer/ffmpeg.py,sha256=tM_T2mV_Y7U91QzWmTBEid9cjEobLpPnxsiOUfz_yDA,11697
7
- talks_reducer/gui.py,sha256=42gWHLs1LlNvNYp-mEnUmpJd-XpempOF5tWytA5fTRs,53679
8
- talks_reducer/models.py,sha256=6cZRcJf0EBZIzNd-PWrh4Wdsoa4EBj5nSdB6BnFiOXM,1106
9
- talks_reducer/pipeline.py,sha256=deGvGMF3CSVd7lcpA7dke8dlLQw3mi_FEhSkFNte7Ro,8871
10
- talks_reducer/progress.py,sha256=Mh43M6VWhjjUv9CI22xfD2EJ_7Aq3PCueqefQ9Bd5-o,4565
11
- talks_reducer-0.3.1.dist-info/licenses/LICENSE,sha256=jN17mHNR3e84awmH3AbpWBcBDBzPxEH0rcOFoj1s7sQ,1124
12
- talks_reducer-0.3.1.dist-info/METADATA,sha256=NU0eHj8kK0bC4Lz-AMjqxlAUhxKuaSgODYVr5iRkT9Y,7660
13
- talks_reducer-0.3.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
14
- talks_reducer-0.3.1.dist-info/entry_points.txt,sha256=LCzfSnh_7VXhvl9twoFSAj0C3sG7bayWs2LkxpH7hoI,100
15
- talks_reducer-0.3.1.dist-info/top_level.txt,sha256=pJWGcy__LR9JIEKH3QJyFmk9XrIsiFtqvuMNxFdIzDU,14
16
- talks_reducer-0.3.1.dist-info/RECORD,,