2

I am trying to output a screenshot of a video at an specified time and the resulting picture should have a black square with the time that was given initially.

So far I was only able to produce a screenshot using vframes from the example at the documentation on ffmpeg page which is this below:

ffmpeg -i input.flv -ss 00:00:14.435 -vframes 1 out.png

But I would like to add a timestamp in the resulting thumbnail or capture of the video which would show that '00:00:14.435' using arial fontface and a black square as background an yellow as fontcolor. Can this be done?.

  • See here. Skip \:1466507118 – Gyan May 31 '17 at 6:15
  • I've already tried the method you mentioned but it does generate a sequence of frames and it is not the way how I intend to assess my problem hence i stressed the part of inserting the time in a black frame at the bottom of the screen capture with the specified time. – Chris Steinbeck Bell May 31 '17 at 6:40
2

Use

ffmpeg -start_at_zero -copyts -ss 00:00:14.435 -i input.mp4
    -vf "drawtext=fontfile=/path/to/Arial.ttf:
          fontsize=45:fontcolor=yellow:box=1:boxcolor=black:x=(W-tw)/2:y=H-th-10:
          text='Time\: %{pts\:hms}'"
    -vframes 1 output.png
  • Can this code be expanded to take a screenshot every X minutes from the video and paste on each one the time elapsed until that point?. I am unable to do this by my own. – Chris Steinbeck Bell Jun 9 '17 at 9:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.