slayerduck said:
bipface said:
to get ideal behaviour with GIF or APNG inputs there are some additional options i normally use, which i can tell you later if you want
Share the juice with us
ffmpeg -default_fps 60 -max_fps 60 -i "input.apng" -vsync cfr -r 60 -crf 20 -b:v 0 "output.webm"
• the "
-r 60" flag sets the output frame rate (doesn't affect playback speed)
• the "
-max_fps 60" flag affects the input decoder; very important because the
default maximum is lower than 60
• i've had a few cases where "
-default_fps 60" was the only way to get correct results; can't remember the exact reason, but can't hurt to always include it
• if you don't specify "
-vsync cfr", ffmpeg sometimes doesn't use the correct
delay on the last frame (pretty sure this is a bug)
---
if you know the exact (constant) framerate of the input you can simply use:
ffmpeg -r
60 -i "input.apng" -vsync cfr -r
60 -crf 20 -b:v 0 "output.webm"
replacing
60 with the actual framerate
---
for lossless compression you can replace "
-crf 20 -b:v 0" with "
-lossless 1"