sticker-convert 2.3.0__py3-none-any.whl → 2.3.1__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.
- sticker_convert/__init__.py +1 -1
- sticker_convert/converter.py +3 -3
- sticker_convert/utils/media/codec_info.py +10 -7
- {sticker_convert-2.3.0.dist-info → sticker_convert-2.3.1.dist-info}/METADATA +1 -1
- {sticker_convert-2.3.0.dist-info → sticker_convert-2.3.1.dist-info}/RECORD +9 -9
- {sticker_convert-2.3.0.dist-info → sticker_convert-2.3.1.dist-info}/LICENSE +0 -0
- {sticker_convert-2.3.0.dist-info → sticker_convert-2.3.1.dist-info}/WHEEL +0 -0
- {sticker_convert-2.3.0.dist-info → sticker_convert-2.3.1.dist-info}/entry_points.txt +0 -0
- {sticker_convert-2.3.0.dist-info → sticker_convert-2.3.1.dist-info}/top_level.txt +0 -0
sticker_convert/__init__.py
CHANGED
sticker_convert/converter.py
CHANGED
@@ -288,9 +288,9 @@ class StickerConvert:
|
|
288
288
|
yuv_array[:, :, 1:] = yuv_array[:, :, 1:].clip(16, 240).astype(yuv_array.dtype) - 128
|
289
289
|
|
290
290
|
convert = np.array([
|
291
|
-
[1.164, 0.000,
|
292
|
-
[1.164, -0.
|
293
|
-
[1.164,
|
291
|
+
[1.164, 0.000, 1.793],
|
292
|
+
[1.164, -0.213, -0.533],
|
293
|
+
[1.164, 2.112, 0.000]
|
294
294
|
])
|
295
295
|
rgb_array = np.matmul(yuv_array, convert.T).clip(0,255).astype('uint8')
|
296
296
|
rgba_array = np.concatenate((rgb_array, a), axis=2)
|
@@ -74,7 +74,7 @@ class CodecInfo:
|
|
74
74
|
context = None
|
75
75
|
if metadata.get('video_format') == 'yuv420p':
|
76
76
|
if metadata.get('codec') == 'vp8':
|
77
|
-
context = CodecContext.create('
|
77
|
+
context = CodecContext.create('libvpx', 'r')
|
78
78
|
elif metadata.get('codec') == 'vp9':
|
79
79
|
context = CodecContext.create('libvpx-vp9', 'r')
|
80
80
|
|
@@ -82,14 +82,17 @@ class CodecInfo:
|
|
82
82
|
stream = container.streams.video[0]
|
83
83
|
if not context:
|
84
84
|
context = stream.codec_context
|
85
|
-
|
86
|
-
|
87
|
-
|
85
|
+
|
86
|
+
last_frame = None
|
87
|
+
for frame_count, frame in enumerate(container.decode(stream)):
|
88
|
+
last_frame = frame
|
89
|
+
if frame_count > 10:
|
90
|
+
break
|
91
|
+
|
92
|
+
if frame_count <= 1:
|
88
93
|
fps = 1
|
89
94
|
else:
|
90
|
-
|
91
|
-
# Last frame dts is not last second of frame / whole video
|
92
|
-
fps = (len(frames) - 1) / (frames[-1].dts * frames[-1].time_base.numerator / frames[-1].time_base.denominator)
|
95
|
+
fps = frame_count / (last_frame.pts * last_frame.time_base.numerator / last_frame.time_base.denominator)
|
93
96
|
|
94
97
|
return fps
|
95
98
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: sticker-convert
|
3
|
-
Version: 2.3.
|
3
|
+
Version: 2.3.1
|
4
4
|
Summary: Convert (animated) stickers to/from WhatsApp, Telegram, Signal, Line, Kakao, iMessage. Written in Python.
|
5
5
|
Author-email: laggykiller <chaudominic2@gmail.com>
|
6
6
|
Maintainer-email: laggykiller <chaudominic2@gmail.com>
|
@@ -1,7 +1,7 @@
|
|
1
|
-
sticker_convert/__init__.py,sha256=
|
1
|
+
sticker_convert/__init__.py,sha256=fl39fVB4JgtiBbT7-wCNoXpljUvI7OAZBy3q531bmn4,66
|
2
2
|
sticker_convert/__main__.py,sha256=HHzFzRsxxhxkCL15_sE1rBAdtprT0NfVUNR591BMvl4,628
|
3
3
|
sticker_convert/cli.py,sha256=mDU18LdLD2yr1jvzuE8R9IpESd9ZiMTU1_DlcnY6WWw,16631
|
4
|
-
sticker_convert/converter.py,sha256=
|
4
|
+
sticker_convert/converter.py,sha256=nK_gcUmxR4n61BUOlEDPDXNkNF8kEJaar5NIzPYflWQ,19905
|
5
5
|
sticker_convert/gui.py,sha256=vR1tkqMSkxkMt-GD-V5i8DYSQ-HUjkwgKl1y0iveE9g,28019
|
6
6
|
sticker_convert/job.py,sha256=gwqHy7k6fmhimmYnXYWCNg3IJJpvPcMUteu7otljeiY,17640
|
7
7
|
sticker_convert/job_option.py,sha256=MdBhyp4-cIHxno4SwBX2n45lkq3dK8Epy84nxvrT_PQ,10926
|
@@ -81,12 +81,12 @@ sticker_convert/utils/files/json_manager.py,sha256=BBndjSY5kvjxurOpnDI2DRsKoLrNB
|
|
81
81
|
sticker_convert/utils/files/metadata_handler.py,sha256=KIy8j89DMBW7-gpL9jqhzz96GgBvPHsRYegHXemk_mY,8346
|
82
82
|
sticker_convert/utils/files/run_bin.py,sha256=4c8y5c_2wUfm0hbJSOGFcezpW5BVqM5_e9aliPbxvwo,1632
|
83
83
|
sticker_convert/utils/media/apple_png_normalize.py,sha256=YGrZ8pZvgfhw8dW-0gf7XcXk_R82lJTX-oTo6SsB7uY,3719
|
84
|
-
sticker_convert/utils/media/codec_info.py,sha256=
|
84
|
+
sticker_convert/utils/media/codec_info.py,sha256=vla8jbnx0w1Gp4UWj1n95qLVct8l0Th70mAEMFr0LQM,6061
|
85
85
|
sticker_convert/utils/media/decrypt_kakao.py,sha256=gMz64vIGEIPAl4FFWuUbPMHE7vExr46ZFpzMoukvwws,1918
|
86
86
|
sticker_convert/utils/media/format_verify.py,sha256=7WvvDSFDkyG1WlkXKqVbmPjKiyEedtqivZcCqSNziD8,6179
|
87
|
-
sticker_convert-2.3.
|
88
|
-
sticker_convert-2.3.
|
89
|
-
sticker_convert-2.3.
|
90
|
-
sticker_convert-2.3.
|
91
|
-
sticker_convert-2.3.
|
92
|
-
sticker_convert-2.3.
|
87
|
+
sticker_convert-2.3.1.dist-info/LICENSE,sha256=gXf5dRMhNSbfLPYYTY_5hsZ1r7UU1OaKQEAQUhuIBkM,18092
|
88
|
+
sticker_convert-2.3.1.dist-info/METADATA,sha256=tNM3JESS5RftQwEVQ4HJ0cCmwu_WBzyy2svIXDC5CEA,45184
|
89
|
+
sticker_convert-2.3.1.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
90
|
+
sticker_convert-2.3.1.dist-info/entry_points.txt,sha256=MNJ7XyC--ugxi5jS1nzjDLGnxCyLuaGdsVLnJhDHCqs,66
|
91
|
+
sticker_convert-2.3.1.dist-info/top_level.txt,sha256=r9vfnB0l1ZnH5pTH5RvkobnK3Ow9m0RsncaOMAtiAtk,16
|
92
|
+
sticker_convert-2.3.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|