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 \

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

  • My camera is H.264 camera
    – Paul
    Jul 1 '19 at 4:52
  • Can I add time-stamp H.264 stream from camera ?
    – Paul
    Jul 1 '19 at 5:07

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

  • I did, but does not work properly.
    – Paul
    Jul 11 '19 at 6:42
  • I think that is why the frame format from camera is H.264 format. so, it can not rendering to H.264 directly.
    – Paul
    Jul 11 '19 at 6:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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