hector-sab / hectorsabblog

1 stars 0 forks source link

Create gifs/webm/videos from images #8

Closed hector-sab closed 1 year ago

hector-sab commented 1 year ago

I want to be able to post "animated images" on my posts. One option is to use GIFs, but seems like there's a new kid in town, WebM. For making a set of images into the "easy" way we use FFMPEG. Take as an example the following list of image files:

root
|- image-001.png
|- image-002.png
|- image-003.png

To make them into a WebM video we can do

ffmpeg -framerate 1 -i image-%03d.png -c:v libvpx-vp9 test.webm

or using regex

ffmpeg -framerate 1 -pattern_type glob -i 'image-*.png' -c:v libvpx-vp9 test.webm

Note that the smaller the frame rate is, the longer it will take for an image to disappear from the screen in the video.

hector-sab commented 1 year ago

https://jonathanmh.com/p/encoding-webm-videos-with-ffmpeg-vp9-av1/

hector-sab commented 1 year ago

https://trac.ffmpeg.org/wiki/Encode/VP9

hector-sab commented 1 year ago

About codec information for the web. This seems to allow ios devices to reproduce the content... https://jakearchibald.com/2022/html-codecs-parameter-for-av1/