Forrest logo
back to the ffmpeg tool

ffmpeg:tldr:a34ed

ffmpeg: Save a video as GIF, scaling the height to 1000px and setting framerate to 15.
$ ffmpeg -i ${video-mp4} -vf 'scale=-1:${1000}' -r ${15} ${output-gif}
try on your machine

This command is using the ffmpeg tool to convert a video file (specified by the variable video-mp4) to a GIF file (specified by the variable output-gif). Here's a breakdown of the different parts of the command:

  1. ffmpeg: This is the command-line tool for converting and manipulating multimedia files.
  2. -i ${video-mp4}: This specifies the input file (video-mp4) that you want to convert.
  3. -vf 'scale=-1:${1000}': This applies a video filter (-vf) to the input file. The filter used here is to scale (resize) the video. The option scale=-1:${1000} means that the video's width will be automatically adjusted while maintaining the aspect ratio, and the height will be set to 1000 pixels. The ${1000} represents a variable with a value of 1000.
  4. -r ${15}: This sets the frame rate (-r) of the output GIF to 15 frames per second. It uses the value of the variable 15.
  5. ${output-gif}: This specifies the output file name for the GIF file. The actual file name is stored in the variable output-gif.

Overall, this command takes a video file, resizes it to a height of 1000 pixels while adjusting the width proportionally, sets the frame rate to 15, and saves the resulting GIF file with the specified output file name.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the ffmpeg tool