Convert to JPEG and force 5fps in right-behind-you
All checks were successful
Build and Publish / build_and_publish (push) Successful in 5m2s
All checks were successful
Build and Publish / build_and_publish (push) Successful in 5m2s
This commit is contained in:
parent
a195869217
commit
9a44a39933
1 changed files with 7 additions and 2 deletions
|
@ -247,7 +247,10 @@ class FFMeta(commands.Cog):
|
|||
if not image.content_type.startswith("image"):
|
||||
return await ctx.respond("That's not an image!")
|
||||
with tempfile.NamedTemporaryFile(suffix=Path(image.filename).suffix) as temp:
|
||||
await image.save(temp.name)
|
||||
img_tmp = io.BytesIO(await image.read())
|
||||
dst: io.BytesIO = await asyncio.to_thread(self.jpegify_image, img_tmp, 50, "jpeg")
|
||||
temp.write(dst.getvalue())
|
||||
temp.flush()
|
||||
process = await asyncio.create_subprocess_exec(
|
||||
"ffmpeg",
|
||||
"-hide_banner",
|
||||
|
@ -271,7 +274,7 @@ class FFMeta(commands.Cog):
|
|||
"-pix_fmt",
|
||||
"yuv420p",
|
||||
"-vf",
|
||||
"fade=in:0:d=22,pad='iw+mod(iw\\,2)':'ih+mod(ih\\,2)'",
|
||||
"fade=in:0:d=22,pad='iw+mod(iw\\,2)':'ih+mod(ih\\,2)',fps=5",
|
||||
"-tune",
|
||||
"stillimage",
|
||||
"-preset",
|
||||
|
@ -284,6 +287,8 @@ class FFMeta(commands.Cog):
|
|||
"-y",
|
||||
"-f",
|
||||
"mp4",
|
||||
f"-r",
|
||||
"5",
|
||||
"pipe:1",
|
||||
stdout=asyncio.subprocess.PIPE,
|
||||
stderr=sys.stderr
|
||||
|
|
Loading…
Reference in a new issue