0

I'm a pixel animator on twitter, with a problem... The website only hosts video files, and will automatically convert gifs into aggressively compressed mp4 files that are 10kb big, destroying the art.

However, twitter allows one to upload fairly high-definition video files if you provide the mp4 yourself.

It's a weird situation, but to overcome this limitation, I want to try converting my 60kb 135x150 pixel gif, into a perceptually lossless 720x720 pixel 2048kb bitrate mp4. I'm very unfamiliar with video formats, I've gleaned these stats from this twitter API doc. But size is no object, I'm happy to make the video unconscionably large for twitter.

Is there a way I can ask ffmpeg to perform this crime?

Anne Quinn
  • 103
  • 2
  • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. – Community Aug 16 '22 at 12:44
  • Upscaling from 135x150 to 720x720 is not going to be "perceptually lossless". – Rotem Aug 16 '22 at 12:59
  • @Rotem - is that an artifact of the video format, or maybe our definitions differ? In my view, upscaling in integer increments with no interpolation, is "lossless." I can perform cropping on the input gif to make it so it's 144x144 to facilitate that. – Anne Quinn Aug 16 '22 at 13:03
  • The duplicate has a lot of options, and https://superuser.com/search?q=ffmpeg+resize can show you how to resize using ffmpeg. What have you tried? Where are you stuck? – Mokubai Aug 16 '22 at 13:05
  • @Mokubai - most gif2mp4 commands I've found reduce filesize instead of sacrifice it. I suppose I should research video formats, instead of looking for ffmpeg commands specifically, maybe a better understanding will let me figure out the command I'd need. – Anne Quinn Aug 16 '22 at 13:09
  • 1
    You may be upscaling in integer increments, but the video codecs themselves do not honour pixel boundaries. The first stages of ffmpeg converting the frame resolution up *might* be lossless, but the moment the data is passed to a video encoder there will be block filtering, psychovisual approximations and a lot of processing that is far from lossless. It might seem *visually* near lossless, but modern video formats are anything but lossless. – Mokubai Aug 16 '22 at 13:10
  • 1
    @AnneQuinn check the rest of the answers in the duplicate, ffmpeg is in there as well. Pick a format, try options, tell us what does and does not work. Help us to help you. – Mokubai Aug 16 '22 at 13:11

0 Answers0