Usable technology

Peter Kuhar

Adding a timecode/datecode/timestamp to a video

I’m studying some sleep videos and I needed to timelapse them. The problem was adding a timecode to the video. There doesn’t seem to be any accesible program supporting this.

A solution that come out is to create a subtitle(.srt) file displaying the current time.

0
00:00:00,000 -> 00:00:00,999
00:00:00

1
00:00:01,000 -> 00:00:01,999
00:00:01

I wrote a simple python program that generates it.

speed = 10
endtime = 60*60*24/speed

for i in range(0,endtime):
t=i
s = t % 60
m = (t/60) % 60
h = (t/60/60) % 24
print “%d” % i
print “%02d:%02d:%02d,000 -> %02d:%02d:%02d,999 ” % (h,m,s,h,m,s)
t=i*speed
s = t % 60
m = (t/60) % 60
h = (t/60/60) % 24
print “%02d:%02d:%02d” % (h,m,s)
print “”

One Response to “Adding a timecode/datecode/timestamp to a video”

  1. nastenka Says:

    thanks good work

Leave a Reply

You must be logged in to post a comment.

http://www.pkuhar.com © 2006 Peter Kuhar peter@pkuhar.com