<p>I think adding:</p>

<pre><code>-vf "drawtext=fontfile=/usr/share/fonts/dejavu/DejaVuSans-Bold.ttf: text='%{localtime\:%T}': fontcolor=white@0.8: x=7: y=700"
</code></pre>

<p>should work. See <a href="https://einar.slaskete.net/2011/09/05/adding-time-stamp-overlay-to-video-stream-using-ffmpeg/" rel="nofollow noreferrer">Adding time stamp overlay to video stream using ffmpeg</a> </p>

CC BY-SA 4.0
2019-07-11T06:42:08.397Z
I did, but does not work properly.
Paul
CC BY-SA 4.0
2019-07-11T06:43:54.457Z
I think that is why the frame format from camera is H.264 format. so, it can not rendering to H.264 directly.
Paul
CC BY-SA 4.0
2022-04-17T22:21:56.647Z
Worked for me. I just needed to adjust the coordinates.
Peter L
CC BY-SA 4.0
2023-12-26T05:44:11.873Z
The [Text Expansion section](https://ffmpeg.org/ffmpeg-all.html#Text-expansion) explains how [strftime](https://linux.die.net/man/3/strftime) is used so you can replace `%T` with any strftime format
Spencer Williams
CC BY-SA 4.0
2019-07-01T15:20:32.123Z
2019-07-02T22:20:59.317Z
2019-07-02T22:20:59.317Z
Thor Tomasarson
<p>I am using FFmpeg for live streaming with RTMP to YouTube.<br>
My ffmpeg command is like this:</p>

<pre><code>ffmpeg -ar 44100 -ac 2 -f alsa -i plughw:1,0 -f v4l2 -codec:v h264 -framerate 30 \
  -video_size 1920x1080 -itsoffset 0.5 -i /dev/video2 -copyinkf -codec:v copy -codec:a aac \
  -ab 44k -af 'highpass=200, lowpass=3000, volume=1' -g 4 -f flv \
   rtmp://a.rtmp.youtube.com/live2/8b35-vkye-476f-xxxx
</code></pre>

<p>I want to add date and time information on live stream video.
How can I do this?</p>

CC BY-SA 4.0
2019-07-01T04:52:19.653Z
My camera is H.264 camera
Paul
CC BY-SA 4.0
2019-07-01T05:07:29.077Z
Can I add time-stamp H.264 stream from camera ?
Paul
<ffmpeg><rtmp>
Adding date/time information on video for ffmpeg
Paul
# Adding date/time information on video for ffmpeg

(Asked by: username_0 on 2019-07-01)

I am using FFmpeg for live streaming with RTMP to YouTube.
My ffmpeg command is like this:
ffmpeg -ar 44100 -ac 2 -f alsa -i plughw:1,0 -f v4l2 -codec:v h264 -framerate 30 \
  -video_size 1920x1080 -itsoffset 0.5 -i /dev/video2 -copyinkf -codec:v copy -codec:a aac \
  -ab 44k -af 'highpass=200, lowpass=3000, volume=1' -g 4 -f flv \
   rtmp://a.rtmp.youtube.com/live2/8b35-vkye-476f-xxxx

I want to add date and time information on live stream video.
How can I do this?

**Tags:** ffmpeg, rtmp

> **Comments:**
> **username_0**: My camera is H.264 camera  
> **username_0**: Can I add time-stamp H.264 stream from camera ?  

---

## 1 answers

### Answer by username_1 on 2019-07-01. Score: 1

I think adding:
-vf "drawtext=fontfile=/usr/share/fonts/dejavu/DejaVuSans-Bold.ttf: text='%{localtime\:%T}': fontcolor=white@0.8: x=7: y=700"

should work. See Adding time stamp overlay to video stream using ffmpeg

> **Comments:**
> **username_0**: I did, but does not work properly.  
> **username_0**: I think that is why the frame format from camera is H.264 format. so, it can not rendering to H.264 directly.  
> **username_2**: Worked for me. I just needed to adjust the coordinates.  
> **username_3**: The [Text Expansion section](https://ffmpeg.org/ffmpeg-all.html#Text-expansion) explains how [strftime](https://linux.die.net/man/3/strftime) is used so you can replace `%T` with any strftime format  

---

