Zend certified PHP/Magento developer

How to add texts at specified timestamps (FFmpeg)

I have a video (input.mp4) file showing a series of cashier transactions. I would like to add a counter showing cumulative number of purchases.

I was able to add a running counter doing this:

ffmpeg -i input.mp4 -vf "drawtext=textfile=counter.txt:fontcolor=white:fontsize=42:shadowcolor=black:shadowx=2:shadowy=2" -c:a copy output.mp4

where counter.txt is:

Purchases: %{n}

However, n records the frame. Having manually recorded the timestamps of each transaction, I would like to (if possible) have a separate file that has the timestamp and a value for n.

Or simply pass a series of timestamp ranges and the accompanying text. Like a generalized version of this answer.

Is there a way to do this, or a better solution?