Lossy encoding with higher quality ffmpeg -i "input.mp4" -ss 00:01:00 -t 5 -vcodec libwebp -loop 0 -vf "fps=15, scale=720:-1" -compression_level 6 -quality 90 "output-lossy90.webp" loop 0 means that the animated image should loop forever, set it to 1 to disable looping.Įven with the default settings we’re getting very good quality and the file size is under 1MB. vf "fps=15, scale=720:-1 sets the frame rate to 15 and we scale down the video to a width of 720 pixels and tell FFmpeg to preserve the aspect ratio by setting the height to -1. You can use -to 00:01:10 if you want to specify the end time instead of duration. We’ll specify the starting point of our webp with the -ss hh:mm:ss option and the duration with -t 10 meaning 10 seconds. Lossy encoding ffmpeg -i "input.mp4" -ss 00:01:00 -t 5 -vcodec libwebp -loop 0 -vf "fps=15, scale=720:-1" "output-lossy.webp" And type ffmpeg.exe instead of just ffmpeg. Note: If you’re using the static build you need to add the location of the FFmpeg bin/ folder to your environment path variable to be able to use it from anywhere. On Windows you can download a static build from OR you can use the Windows Subsystem for Linux (WSL) with the Linux distro of your choice, if you’re using Ubuntu on Windows version you can then just run apt-get install ffmpeg to install it. sudo apt-get install ffmpeg # Debian based distros with APT sudo pacman -S ffmpeg # Arch with pacman sudo dnf install ffmpeg # Fedora (requires RPMfusion repos)īrew install ffmpeg # macOS using homebrew. On Linux and macOS this is pretty easily done with the included package manager. In this post I’ll go through the most common use cases for creating animated images using FFmpeg. It also happens to support animated images. WebP is an image format created by google to be a modern replacement for both jpg and png. I found myself having to encode a gif from a video for a project, but considering how big these gif files get I figured there had to be a better alternative. Encoding WebP animated images with FFmpeg
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |