4

I'm using the command ffmpeg -i video.webm -vf fps=1 thumb%04d.jpg

to get one frame every second. However, I cannot figure out way to get the exact timestamp of an extracted frame. I need that timestamp for processing.

Can you please help?

Thanks so much, Vu

user929951
  • 41
  • 2
  • If you set `fps=1`, the timecode will be 0, 1, 2, etc., no? – slhck Aug 02 '18 at 17:39
  • No it does not correct. See https://superuser.com/questions/575854/can-ffmpeg-extract-images-from-a-video-with-timestamps. Also, we tested many times and it did not necessarily to get first frame of a second. – user929951 Aug 02 '18 at 17:57
  • Well, you could use a `"fps=1,drawtext=timecode='00\:00\:00\:00':r=1"` filter and see what is rendered in the output images. Or just as shown in the other post, use `text='%{pts\:hms}'`. – slhck Aug 02 '18 at 18:07
  • Thanks. This post is very close to what I want https://superuser.com/questions/994870/how-to-add-the-timestamp-as-a-part-of-the-generated-image-file-name-in-ffmpeg, but it seems not completely work. – user929951 Aug 02 '18 at 18:19
  • That won't work, as ffmpeg cannot dynamically set the output file name. – slhck Aug 02 '18 at 18:32
  • Does this work for you? https://superuser.com/questions/841872/how-do-i-extract-the-timestamps-associated-with-frames-ffmpeg-extracts-from-a-vi – slhck Aug 02 '18 at 18:40

0 Answers0