ffmpeg:tldr:d3439
ffmpeg: Quickly extract a single frame from a video at time mm:ss and save it as a 128x128 resolution image.
$ ffmpeg -ss ${mm:ss} -i ${video-mp4} -frames 1 -s ${128x128} -f image2 ${image-png}
try on your machine
This command is using the FFmpeg tool, specifically the ffmpeg
command. Here is a breakdown of each part of the command:
-ss ${mm:ss}
: Specifies the starting point in the input video where the snapshot should be taken.${mm:ss}
should be replaced with the desired time in the formatminutes:seconds
(e.g., 01:30 for 1 minute and 30 seconds).-i ${video-mp4}
: Specifies the input video file path.${video-mp4}
should be replaced with the path to the MP4 video file from which the snapshot will be taken.-frames 1
: Specifies that only one frame (snapshot) should be captured from the video.-s ${128x128}
: Specifies the dimensions of the output image file.${128x128}
should be replaced with the desired width and height (e.g., 128x128 for a 128x128-pixel image).-f image2
: Specifies the output file format as image. This tells FFmpeg that the output file will be an image file.${image-png}
: Specifies the output image file path.${image-png}
should be replaced with the desired file path and name for the output PNG image.
Overall, this command captures a snapshot of a specific frame from a given MP4 video file at a specified time, resizes it to a specific dimension, and saves it as a PNG image file.
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.