Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I managed to encode a video using ffmpeg and to overlay each frame with the frame number using the drawtext filter.

My problem was that using the "text=%{n}" option resulted in the first frame being 0, which is not what I need.

Then I used the code "text=%{expr\:n+1}" and the first frame is now 1 as it should be but it print out 1.000000

Does anyone know a way to remove what comes after the decimal point?

share|improve this question

2 Answers 2

Does anyone know a way to remove what comes after the decimal point?

Probably not. From FFmpeg ticket #1949: Display frame number on each frame:

Try the new expansion function %{expr\:n+1} (note the double escaping), it prints a double value, no formatting control is provided.

You may add a feature request to the FFmpeg bug tracker and it may get implemented depending on developer interest and time, but of course a patch addressing this issue would be more than welcome.

share|improve this answer
Thanks for the info. I'll submit a request and hope for the best. –  Kobi Versano Mar 17 '13 at 12:59

First, separate the video into individual frames, then use Multiple Image Resizer.NET to place the frame numbers into each and every frame. Then, reunite the images into a second video sequence.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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