ffmpeg -y -i input.mov -r 30 -t 2.99 -an -c:v libvpx-vp9 -pix_fmt yuva420p -vf 'scale=512:512:force_original_aspect_ratio=decrease' output.webm
Here is a breakdown of the options:
-y
- Overwrite the output file if it already exists.
-i input.mov
- Specifies the input file, in this case, animated_sticker.mov.
-r 30
- Sets the output video frame rate to 30 frames per second (fps).
-t 2.99
- Sets the duration of the output video to 2.99 seconds.
-an
- Excludes audio from the output video (no audio stream in the output).
-c:v libvpx-vp9
- Sets the video codec to VP9 (libvpx-vp9) for the output video.
-pix_fmt yuva420p
- Sets the pixel format of the output video to YUV420p with an alpha channel (transparency).
-vf 'scale=512:512:force_original_aspect_ratio=decrease'
- Applies a video filter that scales the video to a maximum size of 512x512 pixels while preserving the original aspect ratio.
-b:v 400K
- Sets the target video bitrate to 400 Kbps (Kilobits per second).
output.webm
- Specifies the output file name.