1

Following up on this question: ffmpeg drawtext timecode source framerate

I want to change the frame rate of a file, scale it down and burn the timecode in one operation.

ffmpeg -i in.mpg -r 24 -vf "scale=-2:360, drawtext=timecode='00\:00\:00\:00': r=24:" out.mpg

When I do this, the timecode is relative to the source frame rate, not the output. So if my input FPS is 59.94, I get this timecode sequence:

00:00:00:02
00:00:00:04
00:00:00:07
00:00:00:09

How can I tell drawtext to use destination frame numbers instead of source?

1 Answer 1

2

Use a filter to reduce the framerate beforehand

ffmpeg -i in.mpg -vf "fps=24,scale=-2:360,drawtext=timecode='00\:00\:00\:00': r=24" out.mpg
2
  • Thank you @Gyan! Your answers are fast and accurate. So now I have a followup question: if I were only changing the frame rate, would there be any difference between -r 24 and vf fps=24?
    – iter
    Commented Jun 4, 2018 at 16:07
  • 1
    There was a difference in frame selection logic for the first frame but I believe it was fixed recently.
    – Gyan
    Commented Jun 4, 2018 at 16:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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