1
I have a folder with 1000 MP4 videos and I would like to generate thumbnails for the videos.
Currently the videos are named like this:
test.mp4 test1.mp4 test2.mp4 test3.mp4
I would like the thumbnails images to be named like this:
test-thumb.jpg test1-thumb.jpg test2-thumb.jpg test3-thumb.jpg
Would you please help me with the right command to achieve that? I'm using CentOS 7.
Better:
– slhck – 2017-10-29T17:29:20.490for i in {1..1000}
– Bash has range expansion: http://wiki.bash-hackers.org/syntax/expansion/braceI'm always using ksh. – Ipor Sircer – 2017-10-29T17:39:31.753
1Why use a sequence?
for f *.mp4;do ffmpeg -i $f -vf "thumbnail" -frames:v 1 $(basename $f .mp4)-thumb.jpg; done
– xenoid – 2017-10-29T17:44:19.337In a deleted answer (since he cannot comment), the OP is asking how to capture thumbnails from a few seconds in (e.g. 10) or from the middle of the video. Perhaps you could amend your answer. – slhck – 2017-10-29T20:59:58.630
1
No need to amend. Look, I used a video filter called thumbnail. It tries to choose the most representative frame from the first 100. https://ffmpeg.org/ffmpeg-filters.html#thumbnail
– Ipor Sircer – 2017-10-29T21:22:42.0971We'd like answers to be more than just a few lines of code. If you could add a little more explanation on how to use the filter or how else to get thumbnails from a different part of the movie, that'd be better. – slhck – 2017-10-29T21:31:30.873