I need to convert several videos to animated webp format, but I found no software to handle it. There are some online tools, but they are either paid or work with restrictions like low resolution and fps.
I need to convert several videos to animated webp format, but I found no software to handle it. There are some online tools, but they are either paid or work with restrictions like low resolution and fps.
Though didn't find a software with GUI that can to the converting, I tried the ffmpeg CLI method and it works for me.
In terminal.app, install ffmpeg through homebrew
brew install ffmpeg
Validate the installation:
which ffmpeg
Expect to see terminal returns the directory path of ffmpeg such as /usr/local/bin/ffmpeg
Example command which would convert an mp4 file to a lossless loop playing webp file in 20FPS with resolution 800px(width) * h600px(height):
ffmpeg -i input_filename.mp4 -vcodec libwebp -filter:v fps=fps=20 -lossless 1 -loop 0 -preset default -an -vsync 0 -s 800:600 output_filename.webp
-filter:v fps=fps=20-lossless 1-loop 0. For non-loop, use -loop 1-preset default , can set as picture, photo, text, icon, drawing and none as needed. It would effect output file size. http://ffmpeg.org/ffmpeg-all.html#Options-28-s 800:600For more option details, please visit the the ffmpeg libwebp documentation
This method should applicable for majority video formats including .mov, .avi, .flv, etc. as input files as well as .gif format as output file.
Noted this on my gist: https://gist.github.com/witmin/1edf926c2886d5c8d9b264d70baf7379