yta-video-opengl 0.0.25__py3-none-any.whl → 0.0.26__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/effects.py +2 -0
- yta_video_opengl/nodes/audio/__init__.py +12 -102
- yta_video_opengl/nodes/video/opengl/__init__.py +3 -3
- yta_video_opengl/nodes/video/opengl/experimental.py +6 -6
- {yta_video_opengl-0.0.25.dist-info → yta_video_opengl-0.0.26.dist-info}/METADATA +1 -1
- yta_video_opengl-0.0.26.dist-info/RECORD +13 -0
- yta_video_opengl-0.0.25.dist-info/RECORD +0 -13
- {yta_video_opengl-0.0.25.dist-info → yta_video_opengl-0.0.26.dist-info}/LICENSE +0 -0
- {yta_video_opengl-0.0.25.dist-info → yta_video_opengl-0.0.26.dist-info}/WHEEL +0 -0
yta_video_opengl/effects.py
CHANGED
@@ -32,9 +32,9 @@ class _AudioNode:
|
|
32
32
|
@abstractmethod
|
33
33
|
def process(
|
34
34
|
self,
|
35
|
-
input:
|
35
|
+
input: np.ndarray,
|
36
36
|
t: float
|
37
|
-
) ->
|
37
|
+
) -> np.ndarray:
|
38
38
|
"""
|
39
39
|
Process the provided audio 'input' that
|
40
40
|
is played on the given 't' time moment.
|
@@ -59,20 +59,13 @@ class VolumeNode(_AudioNode):
|
|
59
59
|
|
60
60
|
def process(
|
61
61
|
self,
|
62
|
-
input:
|
62
|
+
input: np.ndarray,
|
63
63
|
t: float
|
64
|
-
) ->
|
64
|
+
) -> np.ndarray:
|
65
65
|
"""
|
66
66
|
Process the provided audio 'input' that
|
67
67
|
is played on the given 't' time moment.
|
68
68
|
"""
|
69
|
-
# if PythonValidator.is_instance_of(input, 'AudioFrame'):
|
70
|
-
# input = input.to_ndarray().astype(np.float32)
|
71
|
-
|
72
|
-
# TODO: I think we should receive only
|
73
|
-
# numpy arrays and the AudioFrame should
|
74
|
-
# be handled outside, but I'm not sure
|
75
|
-
|
76
69
|
factor = self.factor_fn(t, 0)
|
77
70
|
|
78
71
|
samples = input
|
@@ -86,15 +79,6 @@ class VolumeNode(_AudioNode):
|
|
86
79
|
# samples.astype(np.float32)
|
87
80
|
# )
|
88
81
|
|
89
|
-
# new_frame = AudioFrame.from_ndarray(
|
90
|
-
# samples,
|
91
|
-
# format = input.format.name,
|
92
|
-
# layout = input.layout.name
|
93
|
-
# )
|
94
|
-
# new_frame.sample_rate = input.sample_rate
|
95
|
-
# new_frame.pts = input.pts
|
96
|
-
# new_frame.time_base = input.time_base
|
97
|
-
|
98
82
|
return samples
|
99
83
|
|
100
84
|
class ChorusNode(_AudioNode):
|
@@ -121,17 +105,13 @@ class ChorusNode(_AudioNode):
|
|
121
105
|
|
122
106
|
def process(
|
123
107
|
self,
|
124
|
-
input: Union[
|
108
|
+
input: Union[np.ndarray],
|
125
109
|
t: float
|
126
|
-
) ->
|
110
|
+
) -> np.ndarray:
|
127
111
|
"""
|
128
112
|
Process the provided audio 'input' that
|
129
113
|
is played on the given 't' time moment.
|
130
114
|
"""
|
131
|
-
# TODO: I think we should receive only
|
132
|
-
# numpy arrays and the AudioFrame should
|
133
|
-
# be handled outside, but I'm not sure
|
134
|
-
|
135
115
|
n_samples = input.shape[0]
|
136
116
|
t = np.arange(n_samples) / self.rate
|
137
117
|
|
@@ -143,81 +123,11 @@ class ChorusNode(_AudioNode):
|
|
143
123
|
|
144
124
|
for i in range(n_samples):
|
145
125
|
d = delay[i]
|
146
|
-
if i - d >= 0:
|
147
|
-
output[i] = 0.7 * input[i] + 0.7 * input[i - d]
|
148
|
-
else:
|
149
|
-
output[i] = input[i]
|
150
126
|
|
151
|
-
|
127
|
+
output[i]= (
|
128
|
+
0.7 * input[i] + 0.7 * input[i - d]
|
129
|
+
if (i - d) >= 0 else
|
130
|
+
input[i]
|
131
|
+
)
|
152
132
|
|
153
|
-
|
154
|
-
"""
|
155
|
-
Here you have an example. The 'private'
|
156
|
-
node class is the modifier, that we don't
|
157
|
-
want to expose, and the 'public' class is
|
158
|
-
the one that inherits from TimedNode and
|
159
|
-
wraps the 'private' class to build the
|
160
|
-
functionality.
|
161
|
-
"""
|
162
|
-
# class VolumeAudioNode(TimedNode):
|
163
|
-
# """
|
164
|
-
# TimedNode to set the audio volume of a video
|
165
|
-
# in a specific frame.
|
166
|
-
# """
|
167
|
-
|
168
|
-
# def __init__(
|
169
|
-
# self,
|
170
|
-
# factor_fn,
|
171
|
-
# start: float = 0.0,
|
172
|
-
# end: Union[float, None] = None
|
173
|
-
# ):
|
174
|
-
# super().__init__(
|
175
|
-
# node = _SetVolumeAudioNode(factor_fn),
|
176
|
-
# start = start,
|
177
|
-
# end = end
|
178
|
-
# )
|
179
|
-
|
180
|
-
# class _SetVolumeAudioNode(AudioNode):
|
181
|
-
# """
|
182
|
-
# Audio node to change the volume of an
|
183
|
-
# audio frame.
|
184
|
-
# """
|
185
|
-
|
186
|
-
# def __init__(
|
187
|
-
# self,
|
188
|
-
# factor_fn
|
189
|
-
# ):
|
190
|
-
# """
|
191
|
-
# factor_fn: function (t, index) -> factor volumen
|
192
|
-
# """
|
193
|
-
# self.factor_fn = factor_fn
|
194
|
-
|
195
|
-
# def process(
|
196
|
-
# self,
|
197
|
-
# frame: av.AudioFrame,
|
198
|
-
# t: float,
|
199
|
-
# ) -> av.AudioFrame:
|
200
|
-
# # TODO: Why index (?) Maybe 'total_frames'
|
201
|
-
# factor = self.factor_fn(t, 0)
|
202
|
-
|
203
|
-
# samples = frame.to_ndarray().astype(np.float32)
|
204
|
-
# samples *= factor
|
205
|
-
|
206
|
-
# # Determine dtype according to format
|
207
|
-
# samples = (
|
208
|
-
# samples.astype(np.int16)
|
209
|
-
# # 'fltp', 's16', 's16p'
|
210
|
-
# if 's16' in frame.format.name else
|
211
|
-
# samples.astype(np.float32)
|
212
|
-
# )
|
213
|
-
|
214
|
-
# new_frame = av.AudioFrame.from_ndarray(
|
215
|
-
# samples,
|
216
|
-
# format = frame.format.name,
|
217
|
-
# layout = frame.layout.name
|
218
|
-
# )
|
219
|
-
# new_frame.sample_rate = frame.sample_rate
|
220
|
-
# new_frame.pts = frame.pts
|
221
|
-
# new_frame.time_base = frame.time_base
|
222
|
-
|
223
|
-
# return new_frame
|
133
|
+
return output
|
@@ -199,7 +199,7 @@ class OpenglNodeBase(_VideoNode):
|
|
199
199
|
|
200
200
|
def process(
|
201
201
|
self,
|
202
|
-
input: Union[moderngl.Texture,
|
202
|
+
input: Union[moderngl.Texture, np.ndarray]
|
203
203
|
) -> moderngl.Texture:
|
204
204
|
"""
|
205
205
|
Apply the shader to the 'input', that
|
@@ -209,7 +209,7 @@ class OpenglNodeBase(_VideoNode):
|
|
209
209
|
We use and return textures to maintain
|
210
210
|
the process in GPU and optimize it.
|
211
211
|
"""
|
212
|
-
if PythonValidator.is_instance_of(input,
|
212
|
+
if PythonValidator.is_instance_of(input, np.ndarray):
|
213
213
|
# TODO: What about the numpy format (?)
|
214
214
|
input = frame_to_texture(input, self.context)
|
215
215
|
|
@@ -293,7 +293,7 @@ class WavingNode(OpenglNodeBase):
|
|
293
293
|
# processed by the code
|
294
294
|
def process(
|
295
295
|
self,
|
296
|
-
input: Union[moderngl.Texture, '
|
296
|
+
input: Union[moderngl.Texture, 'np.ndarray'],
|
297
297
|
t: float = 0.0,
|
298
298
|
) -> moderngl.Texture:
|
299
299
|
"""
|
@@ -65,7 +65,7 @@ class BreathingFrame(OpenglNodeBase):
|
|
65
65
|
|
66
66
|
def process(
|
67
67
|
self,
|
68
|
-
input: Union[moderngl.Texture, '
|
68
|
+
input: Union[moderngl.Texture, 'np.ndarray'],
|
69
69
|
t: float = 0.0,
|
70
70
|
) -> moderngl.Texture:
|
71
71
|
"""
|
@@ -165,7 +165,7 @@ class HandheldFrame(OpenglNodeBase):
|
|
165
165
|
|
166
166
|
def process(
|
167
167
|
self,
|
168
|
-
input: Union[moderngl.Texture,
|
168
|
+
input: Union[moderngl.Texture, np.ndarray],
|
169
169
|
t: float = 0.0,
|
170
170
|
) -> moderngl.Texture:
|
171
171
|
"""
|
@@ -351,7 +351,7 @@ class OrbitingFrame(OpenglNodeBase):
|
|
351
351
|
|
352
352
|
def process(
|
353
353
|
self,
|
354
|
-
input: Union[moderngl.Texture,
|
354
|
+
input: Union[moderngl.Texture, np.ndarray],
|
355
355
|
t: float = 0.0,
|
356
356
|
) -> moderngl.Texture:
|
357
357
|
"""
|
@@ -446,7 +446,7 @@ class RotatingInCenterFrame(OpenglNodeBase):
|
|
446
446
|
|
447
447
|
def process(
|
448
448
|
self,
|
449
|
-
input: Union[moderngl.Texture,
|
449
|
+
input: Union[moderngl.Texture, np.ndarray],
|
450
450
|
t: float = 0.0,
|
451
451
|
) -> moderngl.Texture:
|
452
452
|
"""
|
@@ -636,7 +636,7 @@ class StrangeTvFrame(OpenglNodeBase):
|
|
636
636
|
|
637
637
|
def process(
|
638
638
|
self,
|
639
|
-
input: Union[moderngl.Texture,
|
639
|
+
input: Union[moderngl.Texture, np.ndarray],
|
640
640
|
t: float = 0.0,
|
641
641
|
) -> moderngl.Texture:
|
642
642
|
"""
|
@@ -744,7 +744,7 @@ class GlitchRgbFrame(OpenglNodeBase):
|
|
744
744
|
|
745
745
|
def process(
|
746
746
|
self,
|
747
|
-
input: Union[moderngl.Texture,
|
747
|
+
input: Union[moderngl.Texture, np.ndarray],
|
748
748
|
t: float = 0.0,
|
749
749
|
) -> moderngl.Texture:
|
750
750
|
"""
|
@@ -0,0 +1,13 @@
|
|
1
|
+
yta_video_opengl/__init__.py,sha256=ycAx_XYMVDfkuObSvtW6irQ0Wo-fgxEz3fjIRMe8PpY,205
|
2
|
+
yta_video_opengl/effects.py,sha256=BqXN3dKw63MB-1eTpQm3TjoPYogX3TkVMBt__AqBa_4,10599
|
3
|
+
yta_video_opengl/nodes/__init__.py,sha256=mDqQBfOjDKqPqp_CNY38ROM_5lhyzQ9AgT0pRswpYUY,4464
|
4
|
+
yta_video_opengl/nodes/audio/__init__.py,sha256=LnGes6u1K0pa4CXP0LrHftLwv0zi-JYvHmYEkJqw_J8,3302
|
5
|
+
yta_video_opengl/nodes/video/__init__.py,sha256=I6F4JRNFKsj1jjy-nXoD9hj7rA47DtAIhAk6-m6vgjY,948
|
6
|
+
yta_video_opengl/nodes/video/opengl/__init__.py,sha256=nqe803cLoxE0NVMadYU8fgdEXrocDjoD-NEZvs1lERw,8542
|
7
|
+
yta_video_opengl/nodes/video/opengl/experimental.py,sha256=9MPudKhl_mDjOyVj89GGLJUVW2esc0PK15EsRpijtzI,22064
|
8
|
+
yta_video_opengl/tests.py,sha256=OPD1Caxt-VYHOtgjIhSfG8pqu8YMREgNsEUBZ22kd3o,24256
|
9
|
+
yta_video_opengl/utils.py,sha256=w6jYnZcBYPNAsTolkAlA6dxph0u_8-mcUzKvADlIlW8,3098
|
10
|
+
yta_video_opengl-0.0.26.dist-info/LICENSE,sha256=6kbiFSfobTZ7beWiKnHpN902HgBx-Jzgcme0SvKqhKY,1091
|
11
|
+
yta_video_opengl-0.0.26.dist-info/METADATA,sha256=d5l55MFB2wrIC4roMkkGyY0I8_LqyRw54WPQeQoL258,589
|
12
|
+
yta_video_opengl-0.0.26.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
|
13
|
+
yta_video_opengl-0.0.26.dist-info/RECORD,,
|
@@ -1,13 +0,0 @@
|
|
1
|
-
yta_video_opengl/__init__.py,sha256=ycAx_XYMVDfkuObSvtW6irQ0Wo-fgxEz3fjIRMe8PpY,205
|
2
|
-
yta_video_opengl/effects.py,sha256=ySXlkUzFIAbnM8_j3ckqao4s0lvUib1e07e_p9HTjOs,10489
|
3
|
-
yta_video_opengl/nodes/__init__.py,sha256=mDqQBfOjDKqPqp_CNY38ROM_5lhyzQ9AgT0pRswpYUY,4464
|
4
|
-
yta_video_opengl/nodes/audio/__init__.py,sha256=7YQgWjX4sYy26mI03W1BEQZ7COKHSKZzcelPKvD7oJI,6097
|
5
|
-
yta_video_opengl/nodes/video/__init__.py,sha256=I6F4JRNFKsj1jjy-nXoD9hj7rA47DtAIhAk6-m6vgjY,948
|
6
|
-
yta_video_opengl/nodes/video/opengl/__init__.py,sha256=bVPdS_wpz4HNurmLRDEHUmNZU7Qz8LptKfJ9yN_2PJM,8587
|
7
|
-
yta_video_opengl/nodes/video/opengl/experimental.py,sha256=XuriXcOuJU5P0FruKffudCpMuO-ht8weJud88Qn8GKk,22158
|
8
|
-
yta_video_opengl/tests.py,sha256=OPD1Caxt-VYHOtgjIhSfG8pqu8YMREgNsEUBZ22kd3o,24256
|
9
|
-
yta_video_opengl/utils.py,sha256=w6jYnZcBYPNAsTolkAlA6dxph0u_8-mcUzKvADlIlW8,3098
|
10
|
-
yta_video_opengl-0.0.25.dist-info/LICENSE,sha256=6kbiFSfobTZ7beWiKnHpN902HgBx-Jzgcme0SvKqhKY,1091
|
11
|
-
yta_video_opengl-0.0.25.dist-info/METADATA,sha256=B-rc8f1xDeLaJLsfFmQ6UOcerV3l5k3p-LtzCY4Dmss,589
|
12
|
-
yta_video_opengl-0.0.25.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
|
13
|
-
yta_video_opengl-0.0.25.dist-info/RECORD,,
|
File without changes
|
File without changes
|