I am using ffmpeg to get some jpg from my video at a specific rate (one screenshot every 5 seconds) with this command :
ffmpeg -i source -f image2 -r 1/5 %d.jpg
This works and give me sequential filenames :
1.jpg
2.jpg
3.jpg
4.jpg
What if I need to know at which time those screenshots have been taken ? Something like a timestamp :
00:00:00.0000.jpg
00:00:05.0000.jpg
00:00:10.0000.jpg
00:00:15.0000.jpg
or the number of seconds :
0.jpg
5.jpg
10.jpg
15.jpg
I tried again with the new -frame_pts option :
ffmpeg -i source -f image2 -r 1/5 -frame_pts 1 %d.jpg
I got similar sequential filenames, but now they are starting from zero :
0.jpg
1.jpg
2.jpg
3.jpg
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…