<p>Timecode isn't suitable for this. It assumes real-time footage. You can use the <code>eif</code> and <code>n</code> <a href="http://ffmpeg.org/ffmpeg-filters.html#Text-expansion" rel="nofollow noreferrer">functions</a> to increment the text counter to advance by 30 mins for each frame i.e.</p>

<p><code>ffmpeg -framerate 24 -i %04d.png -vf format=yuv420p,scale=1650x1180,drawtext="fontsize=15:fontfile=/Library/Fonts/DroidSansMono.ttf:text='time\: %{eif\:n*(30/60)\:d} h %{eif\:mod(n*30\,60)\:d\:2} m':fontsize=72:fontcolor='white':x=860-text_w/2:y=960" out_24fps.mp4</code></p>

<p>(BTW, framerates for image sequences should be set on the input. Using fps filter here will cause ffmpeg to drop one frame from each second.)</p>

CC BY-SA 4.0
2019-08-16T13:13:00.263Z
2019-08-16T13:13:00.263Z
Gyan
<p>I have a set of few hundreds of photos taken every 30 minutes. I combine them into a single video. How can I put a timestamp presenting real time difference between each photo ?</p>

<p>Right now I use <code>timecode</code> filter with the following settings:</p>

<pre><code>ffmpeg -i %04d.png -vf format=yuv420p,scale=1650x1180,fps=24,drawtext="fontsize=15:fontfile=/Library/Fonts/DroidSansMono.ttf:timecode='00\:00\:00\:00':rate=24:text='time\:':fontsize=72:fontcolor='white':x=860-text_w/2:y=960" out_24fps.mp4
</code></pre>

<p>This creates timestamp showing the length of the video which takes ~7 seconds. I'd like the timestamp to show that how long it took to record the whole video rather than how long it takes to replay it (difference of 30 minutes between each photo). </p>

<p>Or perhaps is it possible to take a timestamp from each file used to combine the video?</p>

<ffmpeg>
How to add timestamp of N mins between photos on a video combined from photos?
Jakub Czaplicki
# How to add timestamp of N mins between photos on a video combined from photos?

(Asked by: username_0 on 2019-08-16)

I have a set of few hundreds of photos taken every 30 minutes. I combine them into a single video. How can I put a timestamp presenting real time difference between each photo ?
Right now I use timecode filter with the following settings:
ffmpeg -i %04d.png -vf format=yuv420p,scale=1650x1180,fps=24,drawtext="fontsize=15:fontfile=/Library/Fonts/DroidSansMono.ttf:timecode='00\:00\:00\:00':rate=24:text='time\:':fontsize=72:fontcolor='white':x=860-text_w/2:y=960" out_24fps.mp4

This creates timestamp showing the length of the video which takes ~7 seconds. I'd like the timestamp to show that how long it took to record the whole video rather than how long it takes to replay it (difference of 30 minutes between each photo). 
Or perhaps is it possible to take a timestamp from each file used to combine the video?

**Tags:** ffmpeg


---

## 1 answers

### Answer by username_1 on 2019-08-16. Score: 1 | Accepted answer

Timecode isn't suitable for this. It assumes real-time footage. You can use the `eif` and `n` [functions](http://ffmpeg.org/ffmpeg-filters.html#Text-expansion) to increment the text counter to advance by 30 mins for each frame i.e.

`ffmpeg -framerate 24 -i %04d.png -vf format=yuv420p,scale=1650x1180,drawtext="fontsize=15:fontfile=/Library/Fonts/DroidSansMono.ttf:text='time\: %{eif\:n*(30/60)\:d} h %{eif\:mod(n*30\,60)\:d\:2} m':fontsize=72:fontcolor='white':x=860-text_w/2:y=960" out_24fps.mp4`

(BTW, framerates for image sequences should be set on the input. Using fps filter here will cause ffmpeg to drop one frame from each second.)


---

