# Pyrogram
# Python
# Convert Video Sticker to GIF
from os import remove, popen
import subprocess
def sprocess(a,b = "utf-8"):
p = subprocess.Popen(a, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
return str(p[0].decode(b)+p[1].decode(b))
vid = await message.reply_to_message.download()
print(sprocess("ffmpeg -y -i '"+vid+"' -map_metadata -1 s.mp4"))
durasi = popen("ffprobe -i '"+vid+"' -show_entries format=duration -v quiet -of csv='p=0'").read()
await message.reply_video(video="s.mp4")
remove("s.mp4")
remove(vid)
Credits:
https://t.me/GasTestingGroup/198590