Open 45ninjas opened 1 year ago
Potential fix 1: Limit the output dimensions of ffmpeg by scaling.
can be done with scale filter -vf "scale='min(600,iw)':-1"
added to ffmpeg command (on input maybe?).
https://stackoverflow.com/questions/66292568/ffmpeg-scale-down-videos-with-maximum-width-and-height-while-maintaining-aspect https://askubuntu.com/questions/772377/how-to-set-maximum-video-width-in-ffmpeg https://superuser.com/questions/566998/how-can-i-fit-a-video-to-a-certain-size-but-dont-upscale-it-with-ffmpeg
Potential fix 2:
Use discord's cdn to resize the image via url arguments. Prepend ?width=960&height=720
to URL potentially.
This will require us to know the image aspect ratio/dimensions beforehand (does discord api provide this in message attachments?)
https://media.discordapp.net/attachments/756463513559367720/1074202290631745647/20230212_130456.jpg?width=960&height=720
If you send a large image (phone picture) the webm you get can't be played in discord's client.
Message (SSD discord): https://discord.com/channels/756455138734112778/756463513559367720/1074202290476548156 Source Image: https://media.discordapp.net/attachments/756463513559367720/1074202290631745647/20230212_130456.jpg Resulting miitopia: https://cdn.discordapp.com/attachments/756463513559367720/1074202352908779561/miitopia.webm