yta-video-opengl 0.0.12__py3-none-any.whl → 0.0.14__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/complete/timeline.py +41 -44
- yta_video_opengl/complete/track.py +40 -32
- yta_video_opengl/complete/video_on_track.py +27 -16
- yta_video_opengl/reader/__init__.py +27 -82
- yta_video_opengl/reader/cache.py +250 -245
- yta_video_opengl/t.py +233 -0
- yta_video_opengl/tests.py +4 -2
- yta_video_opengl/utils.py +108 -86
- yta_video_opengl/video.py +90 -12
- yta_video_opengl/writer.py +13 -14
- {yta_video_opengl-0.0.12.dist-info → yta_video_opengl-0.0.14.dist-info}/METADATA +2 -1
- yta_video_opengl-0.0.14.dist-info/RECORD +21 -0
- yta_video_opengl-0.0.12.dist-info/RECORD +0 -20
- {yta_video_opengl-0.0.12.dist-info → yta_video_opengl-0.0.14.dist-info}/LICENSE +0 -0
- {yta_video_opengl-0.0.12.dist-info → yta_video_opengl-0.0.14.dist-info}/WHEEL +0 -0
yta_video_opengl/writer.py
CHANGED
@@ -7,7 +7,7 @@ from av.video.stream import VideoStream
|
|
7
7
|
from av.audio.stream import AudioStream
|
8
8
|
from av.container.output import OutputContainer
|
9
9
|
from av import open as av_open
|
10
|
-
from
|
10
|
+
from quicktions import Fraction
|
11
11
|
from typing import Union
|
12
12
|
|
13
13
|
|
@@ -43,6 +43,7 @@ class VideoWriter:
|
|
43
43
|
def set_video_stream(
|
44
44
|
self,
|
45
45
|
codec_name: Union[str, None],
|
46
|
+
# TODO: Maybe force fps to 'int' (?)
|
46
47
|
fps: Union[Fraction, int, float, None],
|
47
48
|
size: Union[tuple[int, int], None] = None,
|
48
49
|
pixel_format: Union[str, None] = None,
|
@@ -52,15 +53,19 @@ class VideoWriter:
|
|
52
53
|
Set the video stream, that will overwrite any other
|
53
54
|
previous video stream set.
|
54
55
|
"""
|
56
|
+
# TODO: They say that pyav accepts fps as
|
57
|
+
# Fraction...
|
58
|
+
fps = int(fps)
|
59
|
+
|
55
60
|
self.video_stream: VideoStream = self.output.add_stream(
|
56
61
|
# TODO: Maybe 'libx264' as default 'codec_name' (?)
|
57
62
|
codec_name = codec_name,
|
58
|
-
rate =
|
63
|
+
rate = fps,
|
59
64
|
options = options
|
60
65
|
)
|
61
66
|
|
62
67
|
# We need to force this or it will not work
|
63
|
-
self.video_stream.time_base = Fraction(1,
|
68
|
+
self.video_stream.time_base = Fraction(1, fps)
|
64
69
|
|
65
70
|
if size is not None:
|
66
71
|
self.video_stream.width = size[0]
|
@@ -92,7 +97,7 @@ class VideoWriter:
|
|
92
97
|
def set_audio_stream(
|
93
98
|
self,
|
94
99
|
codec_name: Union[str, None],
|
95
|
-
fps: float = 44_100.0
|
100
|
+
fps: Union[int, float, Fraction] = 44_100.0
|
96
101
|
# TODO: Add more if needed
|
97
102
|
) -> 'VideoWriter':
|
98
103
|
"""
|
@@ -137,16 +142,6 @@ class VideoWriter:
|
|
137
142
|
|
138
143
|
return self
|
139
144
|
|
140
|
-
# This below is not working
|
141
|
-
self.audio_stream: AudioStream = self.output.add_stream_from_template(
|
142
|
-
template
|
143
|
-
)
|
144
|
-
# TODO: Is this actually needed (?)
|
145
|
-
# Force this 'rate'
|
146
|
-
self.audio_stream.time_base = Fraction(1, template.codec_context.rate)
|
147
|
-
|
148
|
-
return self
|
149
|
-
|
150
145
|
def encode_video_frame(
|
151
146
|
self,
|
152
147
|
frame: Union[VideoFrame, None] = None
|
@@ -196,6 +191,10 @@ class VideoWriter:
|
|
196
191
|
"""
|
197
192
|
ParameterValidator.validate_mandatory_instance_of('packet', packet, Packet)
|
198
193
|
|
194
|
+
# We are ignoring empty packets because they
|
195
|
+
# are used to indicate the end or things like
|
196
|
+
# that, not actual data... But maybe we are
|
197
|
+
# wrong...
|
199
198
|
if packet.size > 0:
|
200
199
|
try:
|
201
200
|
self.output.mux(packet)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: yta-video-opengl
|
3
|
-
Version: 0.0.
|
3
|
+
Version: 0.0.14
|
4
4
|
Summary: Youtube Autonomous Video OpenGL Module
|
5
5
|
Author: danialcala94
|
6
6
|
Author-email: danielalcalavalera@gmail.com
|
@@ -10,6 +10,7 @@ Classifier: Programming Language :: Python :: 3.9
|
|
10
10
|
Requires-Dist: av (>=0.0.1,<19.0.0)
|
11
11
|
Requires-Dist: moderngl (>=0.0.1,<9.0.0)
|
12
12
|
Requires-Dist: numpy (>=0.0.1,<9.0.0)
|
13
|
+
Requires-Dist: quicktions (>=0.0.1,<9.0.0)
|
13
14
|
Requires-Dist: yta_timer (>0.0.1,<1.0.0)
|
14
15
|
Requires-Dist: yta_validation (>=0.0.1,<1.0.0)
|
15
16
|
Requires-Dist: yta_video_frame_time (>=0.0.1,<1.0.0)
|
@@ -0,0 +1,21 @@
|
|
1
|
+
yta_video_opengl/__init__.py,sha256=ycAx_XYMVDfkuObSvtW6irQ0Wo-fgxEz3fjIRMe8PpY,205
|
2
|
+
yta_video_opengl/classes.py,sha256=t5-Tfc7ecvHl8JlVBp_FVzZT6ole6Ly5-FeBBH7wcxo,37742
|
3
|
+
yta_video_opengl/complete/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
4
|
+
yta_video_opengl/complete/timeline.py,sha256=tMYeAFrOY3M7DAREOYnPT_RzHoFtQnCxk68DusKmJDU,9433
|
5
|
+
yta_video_opengl/complete/track.py,sha256=qIJd3RLizutmCtqk8pkyW40xr6Vz0Aub5_CDJZ0KORY,13735
|
6
|
+
yta_video_opengl/complete/video_on_track.py,sha256=oBWlSFumP1khpWE-z3MEBihTxdnjDvdWHbtFrQCjJgE,4964
|
7
|
+
yta_video_opengl/nodes/__init__.py,sha256=TZ-ZO05PZ0_ABq675E22_PngLWOe-_w5s1cLlV3NbWM,3469
|
8
|
+
yta_video_opengl/nodes/audio/__init__.py,sha256=4nKkC70k1UgLcCSPqFWm3cKdaJM0KUmQTwGWv1xFarQ,2926
|
9
|
+
yta_video_opengl/nodes/video/__init__.py,sha256=gSoaoEmjdQmyRwH18mf5z3NAhap3S0RgbeBbfBXi4jc,132
|
10
|
+
yta_video_opengl/nodes/video/opengl.py,sha256=K2pyCJEd9z4gnZqJetKyGPbtHuBzFsx74ZYyzhSqYPo,8510
|
11
|
+
yta_video_opengl/reader/__init__.py,sha256=Go2rp9flUIBXuo5d_3eqB5CyIE9SqB8_pKsESyZXO-A,19648
|
12
|
+
yta_video_opengl/reader/cache.py,sha256=vGb1JgrTAoChw5n-F24Z2Dmgadt0Wa4PVRRDYMy63Q0,16414
|
13
|
+
yta_video_opengl/t.py,sha256=xOhT1xBEwChlXf-Tuy-WxA_08iRJWVlnL_Hyzr-9-sk,6633
|
14
|
+
yta_video_opengl/tests.py,sha256=EdTyYtTUd_mj6geWnrvnF-wZSHCKKvhYgiLclkV73O0,26576
|
15
|
+
yta_video_opengl/utils.py,sha256=yUi17EjNR4SVpvdDUwUaKl4mBCb1uyFCSGoIX3Zr2F0,15586
|
16
|
+
yta_video_opengl/video.py,sha256=3jBuBW0IRpHrl8wgSoSit2x5pdoi_Q98ZVAg8hK_59I,8638
|
17
|
+
yta_video_opengl/writer.py,sha256=QwvjQcEkzn1WAVqVTFiI6tYIXJO67LKKUTJGO_eflFM,8893
|
18
|
+
yta_video_opengl-0.0.14.dist-info/LICENSE,sha256=6kbiFSfobTZ7beWiKnHpN902HgBx-Jzgcme0SvKqhKY,1091
|
19
|
+
yta_video_opengl-0.0.14.dist-info/METADATA,sha256=gto3fNuFhgs_NWWM8dmqNiNRNk826zlK6YFMkd0EkfM,714
|
20
|
+
yta_video_opengl-0.0.14.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
|
21
|
+
yta_video_opengl-0.0.14.dist-info/RECORD,,
|
@@ -1,20 +0,0 @@
|
|
1
|
-
yta_video_opengl/__init__.py,sha256=ycAx_XYMVDfkuObSvtW6irQ0Wo-fgxEz3fjIRMe8PpY,205
|
2
|
-
yta_video_opengl/classes.py,sha256=t5-Tfc7ecvHl8JlVBp_FVzZT6ole6Ly5-FeBBH7wcxo,37742
|
3
|
-
yta_video_opengl/complete/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
4
|
-
yta_video_opengl/complete/timeline.py,sha256=mf5QH7pFHvQCfDFpZd4HhyHSinvU-RDtvRhXaKOTNuY,9096
|
5
|
-
yta_video_opengl/complete/track.py,sha256=vDGjkMxYY9y_KHFZb-kvN0K1Yt3_foiR_eTB3fIJxVY,12923
|
6
|
-
yta_video_opengl/complete/video_on_track.py,sha256=jbRXX6KMwtvshcW1ce2FRAVKlVRHYxyyY-IOzKSO8-I,4364
|
7
|
-
yta_video_opengl/nodes/__init__.py,sha256=TZ-ZO05PZ0_ABq675E22_PngLWOe-_w5s1cLlV3NbWM,3469
|
8
|
-
yta_video_opengl/nodes/audio/__init__.py,sha256=4nKkC70k1UgLcCSPqFWm3cKdaJM0KUmQTwGWv1xFarQ,2926
|
9
|
-
yta_video_opengl/nodes/video/__init__.py,sha256=gSoaoEmjdQmyRwH18mf5z3NAhap3S0RgbeBbfBXi4jc,132
|
10
|
-
yta_video_opengl/nodes/video/opengl.py,sha256=K2pyCJEd9z4gnZqJetKyGPbtHuBzFsx74ZYyzhSqYPo,8510
|
11
|
-
yta_video_opengl/reader/__init__.py,sha256=da4Jqtqi7xjbjgfzwJpXIMkILz0SKLedt8KDFqmy0Is,20848
|
12
|
-
yta_video_opengl/reader/cache.py,sha256=KOFU3BtymZeel3FIvgxrWm9siUlakfNZdJzQUbFxavg,16657
|
13
|
-
yta_video_opengl/tests.py,sha256=p2Pq4o2H0DMZkV7HNNNAlebSjrDMHKTKk0d_weiiPHQ,26221
|
14
|
-
yta_video_opengl/utils.py,sha256=znlkvL5xjQeeN37cqFHNILBgop4W1PQTfFFudyt8-60,14614
|
15
|
-
yta_video_opengl/video.py,sha256=3n7jgZab7PUSOpODoaH4iNg0sy7NMRo_OaJ4Zj8u0NM,5855
|
16
|
-
yta_video_opengl/writer.py,sha256=wcDVL6Av-16kgx1X_LCAgKboa1eGnKvXaKuGPOsky-s,8880
|
17
|
-
yta_video_opengl-0.0.12.dist-info/LICENSE,sha256=6kbiFSfobTZ7beWiKnHpN902HgBx-Jzgcme0SvKqhKY,1091
|
18
|
-
yta_video_opengl-0.0.12.dist-info/METADATA,sha256=Q-stok3ZF1NXMjfNxzSA8GBjPs6-yb4BnrPg1cxjTds,671
|
19
|
-
yta_video_opengl-0.0.12.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
|
20
|
-
yta_video_opengl-0.0.12.dist-info/RECORD,,
|
File without changes
|
File without changes
|