yta-video-frame-time 0.0.3__py3-none-any.whl → 0.0.4__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.
@@ -458,20 +458,20 @@ class T:
458
458
  ParameterValidator.validate_mandatory_positive_number('audio_fps', audio_fps, do_include_zero = False)
459
459
  ParameterValidator.validate_mandatory_bool('do_invert_order', do_invert_order)
460
460
 
461
- # TODO: This import is bringin many libraries...
462
- from yta_general_utils.math.progression import Progression
463
-
464
461
  audio_frames_per_video_frame = int(audio_fps / video_fps)
465
462
  audio_frame_duration = 1 / audio_fps
466
463
  video_frame_duration = 1 / video_fps
467
464
 
468
465
  t = T.get_frame_time_base(video_t, video_fps)
469
466
 
470
- audio_time_moments = Progression(
471
- start = t,
467
+ # This is replacing a 'Progression' from
468
+ # the 'yta_general_utils' library because
469
+ # it has many imports we don't want here...
470
+ audio_time_moments = _linspace(
471
+ start = t,
472
472
  end = t + video_frame_duration - audio_frame_duration,
473
473
  n = audio_frames_per_video_frame
474
- ).values
474
+ )
475
475
 
476
476
  return (
477
477
  audio_time_moments[::-1]
@@ -590,4 +590,29 @@ def get_number_of_frames(
590
590
  The formula is:
591
591
  - `int(duration * fps + SMALL_AMOUNT)`
592
592
  """
593
- return int(duration * fps + SMALL_AMOUNT_TO_FIX)
593
+ return int(duration * fps + SMALL_AMOUNT_TO_FIX)
594
+
595
+ def _linspace(
596
+ start: float,
597
+ end: float,
598
+ n: int,
599
+ ):
600
+ """
601
+ *For internal use only*
602
+
603
+ A simplified version of the 'Progression'
604
+ class we have in 'yta_general_utils', to
605
+ avoid importing that library that has other
606
+ dependencies I don't need here.
607
+
608
+ This method should be removed when the
609
+ Progression class is refactored and all
610
+ those dependencies are removed.
611
+ """
612
+ if n < 2:
613
+ raise Exception('The "n" parameter must be greater or equal than 2.')
614
+
615
+ return [
616
+ start + i * ((end - start) / (n - 1))
617
+ for i in range(n)
618
+ ]
@@ -1,13 +1,12 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: yta-video-frame-time
3
- Version: 0.0.3
3
+ Version: 0.0.4
4
4
  Summary: Youtube Autonomous Video Frame Time Module
5
5
  Author: danialcala94
6
6
  Author-email: danielalcalavalera@gmail.com
7
7
  Requires-Python: ==3.9
8
8
  Classifier: Programming Language :: Python :: 3
9
9
  Classifier: Programming Language :: Python :: 3.9
10
- Requires-Dist: yta_general_utils (>=0.0.1,<1.0.0)
11
10
  Requires-Dist: yta_validation (>=0.0.1,<1.0.0)
12
11
  Description-Content-Type: text/markdown
13
12
 
@@ -0,0 +1,5 @@
1
+ yta_video_frame_time/__init__.py,sha256=xgdMlHkHFw__0q9FdFFcjcFQIIeIw_xTzw6YS-9SyI4,22254
2
+ yta_video_frame_time-0.0.4.dist-info/LICENSE,sha256=6kbiFSfobTZ7beWiKnHpN902HgBx-Jzgcme0SvKqhKY,1091
3
+ yta_video_frame_time-0.0.4.dist-info/METADATA,sha256=C9Qqb5ai6V4mvvIUNwknag5c0quMy8Tmf4u-rH-vBWE,472
4
+ yta_video_frame_time-0.0.4.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
5
+ yta_video_frame_time-0.0.4.dist-info/RECORD,,
@@ -1,5 +0,0 @@
1
- yta_video_frame_time/__init__.py,sha256=Buft1Kqt49Y4ib-1DB2yduvUiJ5c4-JgaBh04Lb77XY,21619
2
- yta_video_frame_time-0.0.3.dist-info/LICENSE,sha256=6kbiFSfobTZ7beWiKnHpN902HgBx-Jzgcme0SvKqhKY,1091
3
- yta_video_frame_time-0.0.3.dist-info/METADATA,sha256=JULLJxlCJ8rkky1PTDNufgq9NY5gDL-m0urHtL2xq4o,522
4
- yta_video_frame_time-0.0.3.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
5
- yta_video_frame_time-0.0.3.dist-info/RECORD,,