yta-video-opengl 0.0.22__py3-none-any.whl → 0.0.24__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/editor.py +333 -0
- yta_video_opengl/nodes/__init__.py +32 -28
- yta_video_opengl/nodes/audio/__init__.py +164 -55
- yta_video_opengl/nodes/video/__init__.py +27 -1
- yta_video_opengl/nodes/video/{opengl.py → opengl/__init__.py} +8 -4
- yta_video_opengl/nodes/video/opengl/experimental.py +760 -0
- yta_video_opengl/tests.py +236 -358
- yta_video_opengl/utils.py +9 -421
- {yta_video_opengl-0.0.22.dist-info → yta_video_opengl-0.0.24.dist-info}/METADATA +2 -6
- yta_video_opengl-0.0.24.dist-info/RECORD +13 -0
- yta_video_opengl/audio.py +0 -219
- yta_video_opengl/classes.py +0 -1276
- yta_video_opengl/complete/__init__.py +0 -0
- yta_video_opengl/complete/frame_combinator.py +0 -204
- yta_video_opengl/complete/frame_generator.py +0 -319
- yta_video_opengl/complete/frame_wrapper.py +0 -135
- yta_video_opengl/complete/timeline.py +0 -571
- yta_video_opengl/complete/track/__init__.py +0 -500
- yta_video_opengl/complete/track/media/__init__.py +0 -222
- yta_video_opengl/complete/track/parts.py +0 -267
- yta_video_opengl/complete/track/utils.py +0 -78
- yta_video_opengl/media.py +0 -347
- yta_video_opengl/reader/__init__.py +0 -710
- yta_video_opengl/reader/cache/__init__.py +0 -253
- yta_video_opengl/reader/cache/audio.py +0 -195
- yta_video_opengl/reader/cache/utils.py +0 -48
- yta_video_opengl/reader/cache/video.py +0 -113
- yta_video_opengl/t.py +0 -233
- yta_video_opengl/video.py +0 -277
- yta_video_opengl/writer.py +0 -278
- yta_video_opengl-0.0.22.dist-info/RECORD +0 -31
- {yta_video_opengl-0.0.22.dist-info → yta_video_opengl-0.0.24.dist-info}/LICENSE +0 -0
- {yta_video_opengl-0.0.22.dist-info → yta_video_opengl-0.0.24.dist-info}/WHEEL +0 -0
@@ -2,4 +2,30 @@
|
|
2
2
|
Working with video frames has to be done
|
3
3
|
with nodes that use OpenGL because this
|
4
4
|
way, by using the GPU, is the best way.
|
5
|
-
"""
|
5
|
+
"""
|
6
|
+
from typing import Union
|
7
|
+
from abc import ABC, abstractmethod
|
8
|
+
|
9
|
+
import moderngl
|
10
|
+
|
11
|
+
class _VideoNode(ABC):
|
12
|
+
"""
|
13
|
+
Base abstract class to represent a video
|
14
|
+
node, which is an entity that processes
|
15
|
+
video frames individually.
|
16
|
+
|
17
|
+
This class must be inherited by any video
|
18
|
+
node class.
|
19
|
+
"""
|
20
|
+
|
21
|
+
# TODO: What about the types?
|
22
|
+
# TODO: Should we expect pyav frames (?)
|
23
|
+
@abstractmethod
|
24
|
+
def process(
|
25
|
+
self,
|
26
|
+
frame: Union['VideoFrame', moderngl.Texture, 'np.ndarray'],
|
27
|
+
t: float
|
28
|
+
# TODO: Maybe we need 'fps' and 'number_of_frames'
|
29
|
+
# to calculate progressions or similar...
|
30
|
+
) -> Union['VideoFrame', moderngl.Texture, 'np.ndarray']:
|
31
|
+
pass
|
@@ -1,5 +1,5 @@
|
|
1
1
|
from yta_video_opengl.utils import frame_to_texture, get_fullscreen_quad_vao
|
2
|
-
from yta_video_opengl.nodes import
|
2
|
+
from yta_video_opengl.nodes.video import _VideoNode
|
3
3
|
from yta_validation.parameter import ParameterValidator
|
4
4
|
from yta_validation import PythonValidator
|
5
5
|
from abc import abstractmethod
|
@@ -123,7 +123,7 @@ class _Uniforms:
|
|
123
123
|
for key, value in self.uniforms.items():
|
124
124
|
print(f'"{key}": {str(value)}')
|
125
125
|
|
126
|
-
class
|
126
|
+
class OpenglNodeBase(_VideoNode):
|
127
127
|
"""
|
128
128
|
The basic class of a node to manipulate frames
|
129
129
|
as opengl textures. This node will process the
|
@@ -225,7 +225,7 @@ class OpenglNode(Node):
|
|
225
225
|
|
226
226
|
return self.output_tex
|
227
227
|
|
228
|
-
class WavingNode(
|
228
|
+
class WavingNode(OpenglNodeBase):
|
229
229
|
"""
|
230
230
|
Just an example, without the shaders code
|
231
231
|
actually, to indicate that we can use
|
@@ -306,4 +306,8 @@ class WavingNode(OpenglNode):
|
|
306
306
|
"""
|
307
307
|
self.uniforms.set('time', t)
|
308
308
|
|
309
|
-
return super().process(input)
|
309
|
+
return super().process(input)
|
310
|
+
|
311
|
+
# TODO: Add more definitive effects
|
312
|
+
|
313
|
+
|