ffmpeg, offset frame_num to start_frame when using drawtext

1

I'm converting a sequence of exr images to a mov with a text overlay. I'm stamping the frame number into the mov file. The issue is my sequence starts at 1001 and using text=%{n} is that n is zero based. Can I offset this with my start_frame number? or use another expression to pass the exr's frame number to the text?

Z:\software\ffmpeg\ffmpeg.exe -start_number 1001 -gamma 2.2 -i P:/rnd/test/render/ballRender/ballRender_v01_%4d.exr -vf "drawtext=fontfile='C\:\\Windows\\Fonts\\arial.ttf': text=%{n} :fontsize=40: x=10: y=10: fontcolor=white: box=1: boxcolor=0x00000099" -r 24 -y P:/rnd/test/render/ballRender/ballRender_v01.mov

windows
cmd
ffmpeg
asked on Stack Overflow Nov 22, 2017 by stormy

1 Answer

0

Use

text='%{eif\:n+1001\:d}'

The offset has to be supplied manually, either literally or via a variable i.e.

set offset=1001

ffmpeg ... -vf "drawtext...  text='%{eif\:n+%offset%\:d}' ...
answered on Stack Overflow Nov 22, 2017 by Gyan

User contributions licensed under CC BY-SA 3.0