I get a screenshot from a remote video file using ffmpeg with a command like ffmpeg -ss $TIME -i $URL -frames:v 1 -filter:v $FILTER file.jpg
(-ss
comes before -i
for fast seeking https://trac.ffmpeg.org/wiki/Seeking). $FILTER
is how I want to transform the screenshot, like cropping/resizing. In this case it's "crop=iw-5:ih-5, scale=100:100:force_original_aspect_ratio=increase, crop=100:100"
)
If I want to get 3 screenshots, at 3 seconds, 5 seconds, and 14 seconds, I need to run this command 3 separate times, passing 3, 5, and 14 as $TIME
. But is it possible to run the command once but have it output multiple screenshot files for the different times?
And would ffmpeg do that in a way where it would make the round-trip remote request just 1 time instead of 3? In that case it would be more efficient. If not, then maybe it's better to make the 3 requests separately since I could do it in parallel.