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:


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


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
  • 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 Jun 4 '18 at 16:07
  • 1
    There was a difference in frame selection logic for the first frame but I believe it was fixed recently. – Gyan Jun 4 '18 at 16:13

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.