ffmpeg -ss 2.5 -i input_vid.mp4 -vframes 1 -f image2 output_img.jpg
上面的ffmpeg命令从位于输入视频文件2.5秒的帧中创建一个jpg图像(用作视频的缩略图)。
image2
在这里扮演什么角色?我看过几篇博文和SO答案,其中image2
或image3
作为-vframes
标志的参数放在这里,但我不明白它的用途。临时的内存文件名可能是?
我检查了ffmpeg documentation,但找不到答案。
答案 0 :(得分:1)
ffmpeg -ss 2.5 -i input_vid.mp4 -vframes 1 -f image2 output_img.jpg
# | |
# \ /
# ------
# |
# as you can see, image2 is actually part of the argument "-f image2". This
# explicitly sets the container format. Some containers can have the same
# file extension, so this is a way to disambiguate.
‘-f fmt (input/output)’ Force input or output file format. The format is normally auto detected for input files and guessed from the file extension for output files, so this option is not needed in most cases.
答案 1 :(得分:0)