videopython 0.33.5__tar.gz → 0.34.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 (61) hide show
  1. {videopython-0.33.5 → videopython-0.34.1}/PKG-INFO +1 -1
  2. {videopython-0.33.5 → videopython-0.34.1}/pyproject.toml +1 -1
  3. {videopython-0.33.5 → videopython-0.34.1}/src/videopython/ai/transforms.py +24 -8
  4. {videopython-0.33.5 → videopython-0.34.1}/src/videopython/base/image_text.py +400 -130
  5. {videopython-0.33.5 → videopython-0.34.1}/src/videopython/editing/__init__.py +3 -1
  6. videopython-0.34.1/src/videopython/editing/transcription_overlay.py +527 -0
  7. videopython-0.33.5/src/videopython/editing/transcription_overlay.py +0 -186
  8. {videopython-0.33.5 → videopython-0.34.1}/.gitignore +0 -0
  9. {videopython-0.33.5 → videopython-0.34.1}/LICENSE +0 -0
  10. {videopython-0.33.5 → videopython-0.34.1}/README.md +0 -0
  11. {videopython-0.33.5 → videopython-0.34.1}/src/videopython/__init__.py +0 -0
  12. {videopython-0.33.5 → videopython-0.34.1}/src/videopython/ai/__init__.py +0 -0
  13. {videopython-0.33.5 → videopython-0.34.1}/src/videopython/ai/_device.py +0 -0
  14. {videopython-0.33.5 → videopython-0.34.1}/src/videopython/ai/dubbing/__init__.py +0 -0
  15. {videopython-0.33.5 → videopython-0.34.1}/src/videopython/ai/dubbing/config.py +0 -0
  16. {videopython-0.33.5 → videopython-0.34.1}/src/videopython/ai/dubbing/dubber.py +0 -0
  17. {videopython-0.33.5 → videopython-0.34.1}/src/videopython/ai/dubbing/expressiveness.py +0 -0
  18. {videopython-0.33.5 → videopython-0.34.1}/src/videopython/ai/dubbing/loudness.py +0 -0
  19. {videopython-0.33.5 → videopython-0.34.1}/src/videopython/ai/dubbing/models.py +0 -0
  20. {videopython-0.33.5 → videopython-0.34.1}/src/videopython/ai/dubbing/pipeline.py +0 -0
  21. {videopython-0.33.5 → videopython-0.34.1}/src/videopython/ai/dubbing/quality.py +0 -0
  22. {videopython-0.33.5 → videopython-0.34.1}/src/videopython/ai/dubbing/remux.py +0 -0
  23. {videopython-0.33.5 → videopython-0.34.1}/src/videopython/ai/dubbing/timing.py +0 -0
  24. {videopython-0.33.5 → videopython-0.34.1}/src/videopython/ai/dubbing/voice_sample.py +0 -0
  25. {videopython-0.33.5 → videopython-0.34.1}/src/videopython/ai/generation/__init__.py +0 -0
  26. {videopython-0.33.5 → videopython-0.34.1}/src/videopython/ai/generation/audio.py +0 -0
  27. {videopython-0.33.5 → videopython-0.34.1}/src/videopython/ai/generation/image.py +0 -0
  28. {videopython-0.33.5 → videopython-0.34.1}/src/videopython/ai/generation/qwen3.py +0 -0
  29. {videopython-0.33.5 → videopython-0.34.1}/src/videopython/ai/generation/translation.py +0 -0
  30. {videopython-0.33.5 → videopython-0.34.1}/src/videopython/ai/generation/video.py +0 -0
  31. {videopython-0.33.5 → videopython-0.34.1}/src/videopython/ai/understanding/__init__.py +0 -0
  32. {videopython-0.33.5 → videopython-0.34.1}/src/videopython/ai/understanding/audio.py +0 -0
  33. {videopython-0.33.5 → videopython-0.34.1}/src/videopython/ai/understanding/faces.py +0 -0
  34. {videopython-0.33.5 → videopython-0.34.1}/src/videopython/ai/understanding/image.py +0 -0
  35. {videopython-0.33.5 → videopython-0.34.1}/src/videopython/ai/understanding/separation.py +0 -0
  36. {videopython-0.33.5 → videopython-0.34.1}/src/videopython/ai/understanding/temporal.py +0 -0
  37. {videopython-0.33.5 → videopython-0.34.1}/src/videopython/ai/video_analysis/__init__.py +0 -0
  38. {videopython-0.33.5 → videopython-0.34.1}/src/videopython/ai/video_analysis/analyzer.py +0 -0
  39. {videopython-0.33.5 → videopython-0.34.1}/src/videopython/ai/video_analysis/models.py +0 -0
  40. {videopython-0.33.5 → videopython-0.34.1}/src/videopython/ai/video_analysis/sampling.py +0 -0
  41. {videopython-0.33.5 → videopython-0.34.1}/src/videopython/ai/video_analysis/stages.py +0 -0
  42. {videopython-0.33.5 → videopython-0.34.1}/src/videopython/audio/__init__.py +0 -0
  43. {videopython-0.33.5 → videopython-0.34.1}/src/videopython/audio/analysis.py +0 -0
  44. {videopython-0.33.5 → videopython-0.34.1}/src/videopython/audio/audio.py +0 -0
  45. {videopython-0.33.5 → videopython-0.34.1}/src/videopython/base/__init__.py +0 -0
  46. {videopython-0.33.5 → videopython-0.34.1}/src/videopython/base/_dimensions.py +0 -0
  47. {videopython-0.33.5 → videopython-0.34.1}/src/videopython/base/_ffmpeg.py +0 -0
  48. {videopython-0.33.5 → videopython-0.34.1}/src/videopython/base/_video_io.py +0 -0
  49. {videopython-0.33.5 → videopython-0.34.1}/src/videopython/base/description.py +0 -0
  50. {videopython-0.33.5 → videopython-0.34.1}/src/videopython/base/exceptions.py +0 -0
  51. {videopython-0.33.5 → videopython-0.34.1}/src/videopython/base/fonts/DejaVuSans.ttf +0 -0
  52. {videopython-0.33.5 → videopython-0.34.1}/src/videopython/base/fonts/LICENSE_DEJAVU +0 -0
  53. {videopython-0.33.5 → videopython-0.34.1}/src/videopython/base/fonts/__init__.py +0 -0
  54. {videopython-0.33.5 → videopython-0.34.1}/src/videopython/base/transcription.py +0 -0
  55. {videopython-0.33.5 → videopython-0.34.1}/src/videopython/base/video.py +0 -0
  56. {videopython-0.33.5 → videopython-0.34.1}/src/videopython/editing/effects.py +0 -0
  57. {videopython-0.33.5 → videopython-0.34.1}/src/videopython/editing/operation.py +0 -0
  58. {videopython-0.33.5 → videopython-0.34.1}/src/videopython/editing/streaming.py +0 -0
  59. {videopython-0.33.5 → videopython-0.34.1}/src/videopython/editing/transforms.py +0 -0
  60. {videopython-0.33.5 → videopython-0.34.1}/src/videopython/editing/video_edit.py +0 -0
  61. {videopython-0.33.5 → videopython-0.34.1}/src/videopython/py.typed +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: videopython
3
- Version: 0.33.5
3
+ Version: 0.34.1
4
4
  Summary: Minimal video generation and processing library.
5
5
  Project-URL: Homepage, https://videopython.com
6
6
  Project-URL: Repository, https://github.com/bartwojtowicz/videopython/
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "videopython"
3
- version = "0.33.5"
3
+ version = "0.34.1"
4
4
  description = "Minimal video generation and processing library."
5
5
  authors = [
6
6
  { name = "Bartosz Wójtowicz", email = "bartoszwojtowicz@outlook.com" },
@@ -12,7 +12,7 @@ from tqdm import tqdm
12
12
 
13
13
  from videopython.ai.understanding.faces import FaceTracker
14
14
  from videopython.base._dimensions import floor_to_even
15
- from videopython.base.video import Video
15
+ from videopython.base.video import Video, VideoMetadata
16
16
  from videopython.editing.operation import OpCategory, Operation
17
17
 
18
18
  logger = logging.getLogger(__name__)
@@ -76,6 +76,28 @@ class FaceTrackingCrop(Operation):
76
76
  # "dynamic" — placeholder until motion/look-direction framing is implemented.
77
77
  return (face_cx, face_cy - self.headroom)
78
78
 
79
+ def _resolved_output_dims(self, w: int, h: int) -> tuple[int, int]:
80
+ """Output ``(width, height)`` after the crop + resize.
81
+
82
+ Every frame is resized to this size regardless of the per-frame face
83
+ position, so it is a pure function of the input dimensions and
84
+ ``target_aspect``. Single source of truth shared by :meth:`apply` and
85
+ :meth:`predict_metadata` (mirrors ``Resize._resolve_dims`` /
86
+ ``Crop._resolve_box``), so the dry-run cannot disagree with the render.
87
+ """
88
+ target_ratio = self.target_aspect[0] / self.target_aspect[1]
89
+ if target_ratio < w / h:
90
+ out_h = floor_to_even(h)
91
+ out_w = floor_to_even(int(out_h * target_ratio))
92
+ else:
93
+ out_w = floor_to_even(w)
94
+ out_h = floor_to_even(int(out_w / target_ratio))
95
+ return out_w, out_h
96
+
97
+ def predict_metadata(self, meta: VideoMetadata) -> VideoMetadata:
98
+ out_w, out_h = self._resolved_output_dims(meta.width, meta.height)
99
+ return meta.with_dimensions(out_w, out_h)
100
+
79
101
  def _clamp_speed(self, current: tuple[float, float], target: tuple[float, float]) -> tuple[float, float]:
80
102
  if self.max_speed is None:
81
103
  return target
@@ -135,13 +157,7 @@ class FaceTrackingCrop(Operation):
135
157
  )
136
158
 
137
159
  h, w = video.frame_shape[:2]
138
- target_ratio = self.target_aspect[0] / self.target_aspect[1]
139
- if target_ratio < w / h:
140
- out_h = floor_to_even(h)
141
- out_w = floor_to_even(int(out_h * target_ratio))
142
- else:
143
- out_w = floor_to_even(w)
144
- out_h = floor_to_even(int(out_w / target_ratio))
160
+ out_w, out_h = self._resolved_output_dims(w, h)
145
161
 
146
162
  default_x = (w - out_w) // 2
147
163
  default_y = (h - out_h) // 2