Post ABXCbV8NwuTaeLlpWS by coyote@lain.sh
 (DIR) More posts by coyote@lain.sh
 (DIR) Post #ABXAKHJdsAooxfhBQm by coyote@lain.sh
       2021-09-19T22:57:04.043110Z
       
       4 likes, 4 repeats
       
       Did you know ffmpeg can convert gif to apng and apng to gif?? And video to either of them?  GIF to APNG (-plays 0 is for looping, 0 means loop and anything higher is the number of repeats)  ~ $ ffmpeg -i input.gif -plays 0 output.apng  APNG to GIF (loops automatically)  ~ $ ffmpeg -i input.apng output.gif  Video to APNG  ~ $ ffmpeg -i input.webm -plays 0 output.apng  Video to GIF (while reducing the framerate to save filesize)  ~$ ffmpeg -i input.avi -r 24 output.gif
       
 (DIR) Post #ABXAgqi8xGg96mv0Lo by crunklord420@kiwifarms.cc
       2021-09-19T23:01:08.295980Z
       
       5 likes, 1 repeats
       
       @coyote when I make TempleOS GIFs I record losslessly at 30FPS then I convert to GIF with my fancy command I stole from gyphy's blog:ffmpeg -i output.mkv -ss 1:01 -t 6 -filter_complex "[0:v] split [a][b];[a] palettegen [p];[b][p] paletteuse" gaymexplode.gif
       
 (DIR) Post #ABXCbV8NwuTaeLlpWS by coyote@lain.sh
       2021-09-19T23:22:34.724629Z
       
       0 likes, 0 repeats
       
       Just for clarification you can add -r 24 to any of these commands or reduce it to 12 or 14 for a lot lower filesizes. 24 will just be the lowest to get a nice smooth animation.  And you could resize and crop a 720 or whatever 16:9 MP4 to 120x120 png for use with pleroma with one command, in fact, depending on some things, this could be somewhat automated upon upload to pleroma. Apparently mastodon can’t see gif emoji, or emoji over 50k, so a lot of stuff is not interoperable due to gargon’s incompetence.  But anyway, here’s the command:  ~ $ ffmpeg -i input.720p.mp4 -r 14 -vf "scale=-2:120,crop=120:120:47:0" emoji.apng   If it’s not 16:9 the “47” needs to be adjusted in the crop filter.
       
 (DIR) Post #ABXCm0gxTPwbQ5x8IC by coyote@lain.sh
       2021-09-19T23:24:28.884824Z
       
       0 likes, 0 repeats
       
       @crunklord420 that's weird, what does palletegen do? Generate a 16-color pallette?
       
 (DIR) Post #ABXs5YVyTU2UoFnYBc by coyote@lain.sh
       2021-09-20T07:07:24.701312Z
       
       0 likes, 0 repeats
       
       @crunklord420 I see what it’s doing now that I’m using it. Paired it with the earlier stuff to make an all-in-one:  ~$ ffmpeg -ss 0 -to 6 -i input.file -r 24 -filter_complex "[0:v]scale=-2:120,crop=120:120:47:0[vid]; [vid] split [a][b];[a] palettegen [p];[b][p] paletteuse" output.gif  (For anyone who doesn’t know)  -ss is for start time-to is ending time (-t is runtime)-r is video rate-filter_complex “…” First scales to 120p, crops to 120x120 centered, then generates the optimal palette for the gif.