Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slow animated WebP image sequence (carousel) - FFmpeg By Example #129

Open
eladg opened this issue Jan 16, 2025 · 0 comments
Open

Slow animated WebP image sequence (carousel) - FFmpeg By Example #129

eladg opened this issue Jan 16, 2025 · 0 comments

Comments

@eladg
Copy link
Owner

eladg commented Jan 16, 2025

https://ffmpegbyexample.com/examples/lnigitjg/slow_animated_webp_image_sequence_carousel/

This example shows how to take a couple of images and turn them into a slowly changing animated WebP. This is useful for a "digital pictureframe" style image.

What I find interesting FFmpeg for this example is the usage of two framrate (-r) flags. If the first flag is omitted, some images in the sequence will be skipped. And the second flag determines the speed the images are cycled.


For WebP specific options and more information, see the relevant WebP documentation in the ffmpeg-codecs page.


  • -r 1 - interpret input image sequence framerate as 1 FPS. This must be equal or lower than the second -r value.

  • -i /path/to/sequence/%d.png - path to image sequence where each image is name 1.png to n.png. Note there are no leading zeros in file names.

  • -vcodec libwebp - set the video codec to generate WebP images

  • -pix_fmt yuv420p - set the pixel format (color space). YUV420 is the only supported one for lossy and RGB is the only supported one for lossless.

  • -loop 0 - loop the animated WebP

  • -r 1 - set output framerate to 1 FPS (i.e. change the image once per second)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant