Well I guess the title sums it up pretty good. I know I can do annotations but they're just strings which can't be altered or am I wrong? Is it possible to always have the time in the video recording? I'm trying this with python if this is possible I would appreciate a little hint

Clarification: I want to overlay the current time of the day (year/month/day /hours/minutes/seconds) not the runtime of the video

  • Could you edit your question to clarify whether you'd like to overlay the current time of day, or the current run-time of the video?
    – goobering
    Sep 14, 2016 at 13:32

1 Answer 1


The picamera documentation page includes a basic recipe for a timestamp overlay, which I've just tested, which puts a second-accurate timestamp (yyyy-MM-dd HH:mm:ss) at the top of the video.

import picamera
import datetime as dt

with picamera.PiCamera() as camera:
    camera.resolution = (1280, 720)
    camera.framerate = 24
    camera.annotate_background = picamera.Color('black')
    camera.annotate_text = dt.datetime.now().strftime('%Y-%m-%d %H:%M:%S')
    start = dt.datetime.now()
    while (dt.datetime.now() - start).seconds < 30:
        camera.annotate_text = dt.datetime.now().strftime('%Y-%m-%d %H:%M:%S')
  • In answer to @goobering The issue with this solution, is that each time you need to stop&start the camera, which can be problematic in the solutions where you use split_recording. For example when you create security camera, than you cannot use stop&start many time as that will cut the videos.
    – haykp
    Jan 13, 2018 at 7:34
  • do you have any idea/solution to this issue?
    – con
    Jun 3, 2018 at 19:06
  • In response to haykp, where do you see the camera starting and stopping? It is only starting once, and stopping once. It is waiting (see here) frequently, but this does not cause the recording to stop. wait_recording also accepts a splitter_port argument, to handle split recordings. Mar 5, 2019 at 6:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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