yta-video-opengl 0.0.19__py3-none-any.whl → 0.0.21__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.
- yta_video_opengl/audio.py +219 -0
- yta_video_opengl/complete/frame_combinator.py +1 -90
- yta_video_opengl/complete/frame_generator.py +40 -0
- yta_video_opengl/complete/frame_wrapper.py +13 -0
- yta_video_opengl/complete/timeline.py +200 -116
- yta_video_opengl/complete/track/__init__.py +500 -0
- yta_video_opengl/complete/{video_on_track.py → track/media/__init__.py} +112 -47
- yta_video_opengl/complete/track/parts.py +267 -0
- yta_video_opengl/complete/track/utils.py +78 -0
- yta_video_opengl/reader/__init__.py +0 -19
- yta_video_opengl/reader/cache/__init__.py +9 -5
- yta_video_opengl/reader/cache/utils.py +1 -1
- yta_video_opengl/tests.py +29 -1
- yta_video_opengl/video.py +9 -13
- {yta_video_opengl-0.0.19.dist-info → yta_video_opengl-0.0.21.dist-info}/METADATA +1 -1
- yta_video_opengl-0.0.21.dist-info/RECORD +30 -0
- yta_video_opengl/complete/track.py +0 -562
- yta_video_opengl-0.0.19.dist-info/RECORD +0 -27
- {yta_video_opengl-0.0.19.dist-info → yta_video_opengl-0.0.21.dist-info}/LICENSE +0 -0
- {yta_video_opengl-0.0.19.dist-info → yta_video_opengl-0.0.21.dist-info}/WHEEL +0 -0
yta_video_opengl/tests.py
CHANGED
@@ -597,6 +597,34 @@ def video_modified_stored():
|
|
597
597
|
# # timeline.add_video(Video('C:/Users/dania/Downloads/Y2meta.app-10 Smooth Transitions Green Screen Template For Kinemaster, Alight Motion, Filmora, premiere pro-(1080p).mp4', 2.25, 3.0), 3)
|
598
598
|
# timeline.render(OUTPUT_PATH)
|
599
599
|
|
600
|
+
# # Testing concatenating
|
601
|
+
# timeline = Timeline()
|
602
|
+
# # When you concat like this, some of the
|
603
|
+
# # videos have frames that cannot be accessed
|
604
|
+
# # and I don't know why...
|
605
|
+
# timeline.add_video(Video('test_files/glitch_rgb_frame.mp4'))
|
606
|
+
# timeline.add_video(Video('test_files/output.mp4'))
|
607
|
+
# timeline.add_video(Video('test_files/output_render.mp4'))
|
608
|
+
# timeline.add_video(Video('test_files/strange_tv_frame.mp4'))
|
609
|
+
# timeline.add_video(Video('test_files/test_1.mp4'))
|
610
|
+
# timeline.add_video(Video('test_files/test_1_short_2.mp4'))
|
611
|
+
# timeline.add_video(Video('test_files/test_audio_1st_track_solo_v0_0_15.mp4'))
|
612
|
+
# timeline.add_video(Video('test_files/test_audio_2nd_track_solo_v0_0_15.mp4'))
|
613
|
+
# timeline.add_video(Video('test_files/test_audio_combined_tracks_v0_0_015.mp4'))
|
614
|
+
# timeline.add_video(Video('test_files/test_audio_combined_v0_0_15.mp4'))
|
615
|
+
# timeline.add_video(Video('test_files/test_blend_add_v0_0_16.mp4'))
|
616
|
+
# timeline.add_video(Video('test_files/test_blend_difference_v0_0_16.mp4'))
|
617
|
+
# timeline.add_video(Video('test_files/test_blend_multiply_v0_0_16.mp4'))
|
618
|
+
# timeline.add_video(Video('test_files/test_blend_overlay_v0_0_16.mp4'))
|
619
|
+
# timeline.add_video(Video('test_files/test_blend_screen_v0_0_16.mp4'))
|
620
|
+
# timeline.add_video(Video('test_files/test_combine_skipping_empty_using_priority_v0_0_18.mp4'))
|
621
|
+
# timeline.add_video(Video('test_files/test_ok_v0_0_13.mp4'))
|
622
|
+
|
623
|
+
# timeline.render('test_files/concatenated.mp4')
|
624
|
+
|
625
|
+
|
626
|
+
# return
|
627
|
+
|
600
628
|
# TODO: This test will add videos that
|
601
629
|
# must be played at the same time
|
602
630
|
video = Video(VIDEO_PATH, 0.25, 0.75)
|
@@ -610,7 +638,7 @@ def video_modified_stored():
|
|
610
638
|
timeline.add_video(Video(simpsons_60fps, 1.5, 2.0), 3.0, track_index = 0)
|
611
639
|
timeline.add_video(Video(VIDEO_PATH, 0.5, 1.0), 2.0, track_index = 0)
|
612
640
|
|
613
|
-
timeline.tracks[0].mute()
|
641
|
+
#timeline.tracks[0].mute()
|
614
642
|
|
615
643
|
# Track 2
|
616
644
|
timeline.add_video(Video(VIDEO_PATH, 0.5, 1.0), 2.7, track_index = 1)
|
yta_video_opengl/video.py
CHANGED
@@ -9,7 +9,8 @@ from typing import Union
|
|
9
9
|
# TODO: Where can I obtain this dynamically (?)
|
10
10
|
PIXEL_FORMAT = 'yuv420p'
|
11
11
|
|
12
|
-
# TODO: Maybe
|
12
|
+
# TODO: Maybe create a _Media(ABC) to put
|
13
|
+
# some code shared with the Audio class
|
13
14
|
class Video:
|
14
15
|
"""
|
15
16
|
Class to wrap the functionality related to
|
@@ -107,11 +108,6 @@ class Video:
|
|
107
108
|
The iterator will iterate first over the
|
108
109
|
video frames, and once finished over the
|
109
110
|
audio frames.
|
110
|
-
|
111
|
-
This method returns a tuple of 3 elements:
|
112
|
-
- `frame` as a `VideoFrame` instance
|
113
|
-
- `t` as the frame time moment
|
114
|
-
- `index` as the frame index
|
115
111
|
"""
|
116
112
|
for frame in self.reader.get_frames(self.start, self.end):
|
117
113
|
yield frame
|
@@ -155,7 +151,7 @@ class Video:
|
|
155
151
|
# methods because this Video can be subclipped
|
156
152
|
# and have a 'start' and' end' that are
|
157
153
|
# different from [0, end)
|
158
|
-
def
|
154
|
+
def _get_t(
|
159
155
|
self,
|
160
156
|
t: Union[int, float, Fraction]
|
161
157
|
) -> Fraction:
|
@@ -183,9 +179,9 @@ class Video:
|
|
183
179
|
Get the video frame with the given 't' time
|
184
180
|
moment, using the video cache system.
|
185
181
|
"""
|
186
|
-
print(f'Getting frame from {str(float(t))} that is actually {str(float(self.
|
187
|
-
return self.reader.get_frame(self.
|
188
|
-
#return self.reader.video_cache.get_frame(self.
|
182
|
+
print(f'Getting frame from {str(float(t))} that is actually {str(float(self._get_t(t)))}')
|
183
|
+
return self.reader.get_frame(self._get_t(t))
|
184
|
+
#return self.reader.video_cache.get_frame(self._get_t(t))
|
189
185
|
|
190
186
|
def get_audio_frame_from_t(
|
191
187
|
self,
|
@@ -200,7 +196,7 @@ class Video:
|
|
200
196
|
|
201
197
|
TODO: Is this actually necessary (?)
|
202
198
|
"""
|
203
|
-
return self.reader.get_audio_frame_from_t(self.
|
199
|
+
return self.reader.get_audio_frame_from_t(self._get_t(t))
|
204
200
|
|
205
201
|
def get_audio_frames_from_t(
|
206
202
|
self,
|
@@ -217,8 +213,8 @@ class Video:
|
|
217
213
|
(remember that a video frame is associated
|
218
214
|
with more than 1 audio frame).
|
219
215
|
"""
|
220
|
-
print(f'Getting audio frames from {str(float(t))} that is actually {str(float(self.
|
221
|
-
for frame in self.reader.get_audio_frames_from_t(self.
|
216
|
+
print(f'Getting audio frames from {str(float(t))} that is actually {str(float(self._get_t(t)))}')
|
217
|
+
for frame in self.reader.get_audio_frames_from_t(self._get_t(t)):
|
222
218
|
yield frame
|
223
219
|
|
224
220
|
def save_as(
|
@@ -0,0 +1,30 @@
|
|
1
|
+
yta_video_opengl/__init__.py,sha256=ycAx_XYMVDfkuObSvtW6irQ0Wo-fgxEz3fjIRMe8PpY,205
|
2
|
+
yta_video_opengl/audio.py,sha256=BWXa7nfFFabRe4e6TuGDTjMyevsV9R7BLOWEUXwpLns,6947
|
3
|
+
yta_video_opengl/classes.py,sha256=t5-Tfc7ecvHl8JlVBp_FVzZT6ole6Ly5-FeBBH7wcxo,37742
|
4
|
+
yta_video_opengl/complete/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
5
|
+
yta_video_opengl/complete/frame_combinator.py,sha256=FqWIZECYRS1V8VU8ZkVlzWvDYofE0p44zjVNlx_i2tE,6466
|
6
|
+
yta_video_opengl/complete/frame_generator.py,sha256=Rudsy3i8U8irEDQnx8yA0O72FzuqtVQt_vPNA61brN4,9030
|
7
|
+
yta_video_opengl/complete/frame_wrapper.py,sha256=As5e8Yq9yKd9arJFczzTkV7FLL-h5ub1kEUBNzxuMf8,3664
|
8
|
+
yta_video_opengl/complete/timeline.py,sha256=Sms7lJarEU3LxqYeEN7cs1zR8WYfKHaqOowiQ77-7sY,18372
|
9
|
+
yta_video_opengl/complete/track/__init__.py,sha256=a_iXuVvd_LvvQ7wETTUJTeAQi4yau7eVwHz4aBmlJKA,14527
|
10
|
+
yta_video_opengl/complete/track/media/__init__.py,sha256=raIbTh5kreFJcnrtxUE1s8Un0N614KzWDWUkS3-OglY,6368
|
11
|
+
yta_video_opengl/complete/track/parts.py,sha256=6yTLCBd4xz76VTrpZyp7Kbwo6Ok0OmbLJUNwSAoRJkc,8829
|
12
|
+
yta_video_opengl/complete/track/utils.py,sha256=nKJT0GqfSnUoATPGCAXinIM9skhtH6v9_MsBZlHYNeg,2486
|
13
|
+
yta_video_opengl/nodes/__init__.py,sha256=TZ-ZO05PZ0_ABq675E22_PngLWOe-_w5s1cLlV3NbWM,3469
|
14
|
+
yta_video_opengl/nodes/audio/__init__.py,sha256=4nKkC70k1UgLcCSPqFWm3cKdaJM0KUmQTwGWv1xFarQ,2926
|
15
|
+
yta_video_opengl/nodes/video/__init__.py,sha256=gSoaoEmjdQmyRwH18mf5z3NAhap3S0RgbeBbfBXi4jc,132
|
16
|
+
yta_video_opengl/nodes/video/opengl.py,sha256=K2pyCJEd9z4gnZqJetKyGPbtHuBzFsx74ZYyzhSqYPo,8510
|
17
|
+
yta_video_opengl/reader/__init__.py,sha256=fZVb4mwVz9Bb5pawuFXIS-LGPXOLk-9xznAGMoivqTA,19216
|
18
|
+
yta_video_opengl/reader/cache/__init__.py,sha256=ZGjHCknb7q1Mc8hiDD50m8yHAw8MSd2PY6GVVByDsq4,7126
|
19
|
+
yta_video_opengl/reader/cache/audio.py,sha256=cm_1D5f5RnmJgaidA1pnEhTPF8DE0mU2MofmwjU_b5k,6781
|
20
|
+
yta_video_opengl/reader/cache/utils.py,sha256=a3aeiQ8LJpAFvPeoGEk1cn88NZ6c4Eveka7bTP-58VY,1409
|
21
|
+
yta_video_opengl/reader/cache/video.py,sha256=3sT9cE0sdTty5AE9yFAPJrJNxCX5vWVATK8OeJInr8I,3496
|
22
|
+
yta_video_opengl/t.py,sha256=xOhT1xBEwChlXf-Tuy-WxA_08iRJWVlnL_Hyzr-9-sk,6633
|
23
|
+
yta_video_opengl/tests.py,sha256=CL2n5-2SkPrEU953cJjBg6S8ZZI0ZTYKfTigmz3mgQk,29566
|
24
|
+
yta_video_opengl/utils.py,sha256=yUi17EjNR4SVpvdDUwUaKl4mBCb1uyFCSGoIX3Zr2F0,15586
|
25
|
+
yta_video_opengl/video.py,sha256=Og_SOJwb8Dzbx8c-P75cjT9O8QgITru-4LD5wHC_JDM,8785
|
26
|
+
yta_video_opengl/writer.py,sha256=QwvjQcEkzn1WAVqVTFiI6tYIXJO67LKKUTJGO_eflFM,8893
|
27
|
+
yta_video_opengl-0.0.21.dist-info/LICENSE,sha256=6kbiFSfobTZ7beWiKnHpN902HgBx-Jzgcme0SvKqhKY,1091
|
28
|
+
yta_video_opengl-0.0.21.dist-info/METADATA,sha256=zy3PHZfA6uYaOts3lY2GS5piyyddkbGhUXNXWMCDOMc,714
|
29
|
+
yta_video_opengl-0.0.21.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
|
30
|
+
yta_video_opengl-0.0.21.dist-info/RECORD,,
|