yeref 0.25.50__py3-none-any.whl → 0.25.53__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.
yeref/yeref.py CHANGED
@@ -16770,11 +16770,18 @@ async def item_to_dynamic_sticker(bot, chat_id, input_file, PACK_TYPE, PACK_KIND
16770
16770
  # clip = mp.VideoFileClip(input_file)
16771
16771
  # width, height = clip.size
16772
16772
 
16773
+ if width % 2 != 0: width -= 1
16774
+ if height % 2 != 0: height -= 1
16775
+
16773
16776
  if width != height and (width > side_sz or height > side_sz):
16774
16777
  if width > height:
16775
- pixels_str = f"{side_sz}x{int(side_sz * (height / width))}"
16778
+ h2 = int(side_sz * (height / width))
16779
+ if h2 % 2 != 0: h2 -= 1
16780
+ pixels_str = f"{side_sz}x{h2}"
16776
16781
  else:
16777
- pixels_str = f"{int(side_sz * (width / height))}x{side_sz}"
16782
+ w2 = int(side_sz * (width / height))
16783
+ if w2 % 2 != 0: w2 -= 1
16784
+ pixels_str = f"{w2}x{side_sz}"
16778
16785
  except Exception as e:
16779
16786
  logger.info(log_ % str(e))
16780
16787
  await asyncio.sleep(round(random.uniform(0, 1), 2))
@@ -16801,7 +16808,15 @@ async def item_to_dynamic_sticker(bot, chat_id, input_file, PACK_TYPE, PACK_KIND
16801
16808
  # rounded = 'split[s0][s1];[s0]pad=width=512:height=512:color=black[s2];[s1]scale=512:512:force_original_aspect_ratio=decrease[s3];[s2][s3]overlay=W-w-1:H-h-1,drawbox=0:0:iw:ih:color=black@0.0[rounded]'
16802
16809
  print(f'here 2, {i_input_data=}, {os.path.exists(input_file)=}')
16803
16810
 
16804
- ffmpeg_command = ['ffmpeg', '-i', i_input_data, '-filter_complex', rounded, '-filter_complex_threads', '2',
16811
+ if is_circle:
16812
+ ffmpeg_command = [
16813
+ 'ffmpeg', '-i', i_input_data, '-filter_complex', rounded, '-filter_complex_threads', '2',
16814
+ '-c:v', 'libvpx-vp9', '-r', str(fps),
16815
+ '-b:v', '0', '-crf', '20', '-quality', 'good', '-cpu-used', '1',
16816
+ '-s', pixels_str, '-pix_fmt', 'yuva420p', '-t', '3', '-an', '-y', file_webm
16817
+ ]
16818
+ else:
16819
+ ffmpeg_command = ['ffmpeg', '-i', i_input_data, '-filter_complex', rounded, '-filter_complex_threads', '2',
16805
16820
  '-c:v', 'libvpx-vp9', '-r', str(fps), '-b:v', bitrate, '-crf', '30', '-s', pixels_str,
16806
16821
  '-pix_fmt', 'yuva420p', '-t', '3', '-an', '-y', file_webm]
16807
16822
  print(f"{ffmpeg_command=}")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: yeref
3
- Version: 0.25.50
3
+ Version: 0.25.53
4
4
  Summary: desc-f
5
5
  Author: john smith
6
6
  Dynamic: author
@@ -0,0 +1,8 @@
1
+ yeref/__init__.py,sha256=Qpv3o6Xa78VdLcsSRmctGtpnYE9btpAkCekgGhgJyXM,49
2
+ yeref/l_.py,sha256=Pc6C6WIIV1MZ_tv7wAkIUJttn0yUC-ewqjTdrX8VDeA,1117680
3
+ yeref/tonweb.js,sha256=Jf6aFOQ1OIY4q7fINYz-m5LsI3seMus124M5SYYZmtE,443659
4
+ yeref/yeref.py,sha256=QDQxThrwzzsjF50gIOc0tjO9Q3WJVSo266YVqsFTiMI,1026717
5
+ yeref-0.25.53.dist-info/METADATA,sha256=5edEqzIxNWw_vbrfg8WXHbevMkVAzyjQm6xTZuNgH5E,119
6
+ yeref-0.25.53.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
7
+ yeref-0.25.53.dist-info/top_level.txt,sha256=yCQKchWHbfV-3OuQPYRdi2loypD-nmbDJbtt3OuKKkY,6
8
+ yeref-0.25.53.dist-info/RECORD,,
@@ -1,8 +0,0 @@
1
- yeref/__init__.py,sha256=Qpv3o6Xa78VdLcsSRmctGtpnYE9btpAkCekgGhgJyXM,49
2
- yeref/l_.py,sha256=Pc6C6WIIV1MZ_tv7wAkIUJttn0yUC-ewqjTdrX8VDeA,1117680
3
- yeref/tonweb.js,sha256=Jf6aFOQ1OIY4q7fINYz-m5LsI3seMus124M5SYYZmtE,443659
4
- yeref/yeref.py,sha256=FrUbHJBJLGfQ5ysPPkUzeIlkteFRrmUtoec_ySqomsg,1026020
5
- yeref-0.25.50.dist-info/METADATA,sha256=CtPDX_6lz5vNA3nRSiVUMRo6oYgVLiMuP9Y59pwFWpk,119
6
- yeref-0.25.50.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
7
- yeref-0.25.50.dist-info/top_level.txt,sha256=yCQKchWHbfV-3OuQPYRdi2loypD-nmbDJbtt3OuKKkY,6
8
- yeref-0.25.50.dist-info/RECORD,,