Skip to content

FFmpeg

mp4 to webp cli

Set webp properties and convert

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

Export an animated lossy WebP with preset mode picture:

ffmpeg -i input.mp4 -vcodec libwebp -filter:v fps=fps=20 -lossless 0  -compression_level 3 -q:v 70 -loop 1 -preset picture -an -vsync 0 -s 800:600 output.webp
Mp4 resize, reduce resolution rate, bit rate, compress audio, and using H.265
ffmpeg -i input.mp4 -vf "scale=1280:720" -b:v 1000k -b:a 128k -c:v libx265 -crf 28 output.mp4

more: mp4 to webp

Comments