Display date and time in videos using OpenCV - Python Last Updated : 12 Jul, 2025 Summarize Comments Improve Suggest changes Share Like Article Like Report OpenCV-Python is a library of Python bindings designed to solve computer vision problems. It can process images and videos to identify objects, faces, or even the handwriting of a humanNote: For more information, refer to Introduction to OpenCV Display date and time in videos It sometimes becomes necessary to display date and time on videos when we are processing videos of live feed or videos which are of a large duration. Time and date will be helpful to know and analyze any anomaly detected in the video with reference to its time and date. To display date and time on videos we do the following.Code Python3 # Import libraries import numpy import cv2 import datetime # open the video vid = cv2.VideoCapture('sample.mp4') # Process until end. while(vid.isOpened()): ret, frame = vid.read() if ret: # describe the type of # font you want to display font = cv2.FONT_HERSHEY_SCRIPT_COMPLEX # Get date and time and # save it inside a variable dt = str(datetime.datetime.now()) # put the dt variable over the # video frame frame = cv2.putText(frame, dt, (10, 100), font, 1, (210, 155, 155), 4, cv2.LINE_8) # show the video cv2.imshow('frame', frame) key = cv2.waitKey(1) # define the key to # close the window if key == 'q' or key == 27: break else: break # release the vid object vid.release() # close all the opened windows. cv2.destroyAllWindows() Output Comment More infoAdvertise with us Next Article Python | Create video using multiple images using OpenCV K KaranGupta5 Follow Improve Article Tags : Python OpenCV Python-OpenCV Practice Tags : python Similar Reads Creating a Slow Motion Video Using OpenCV - Python In this article, we will try to create a slow-motion video using OpenCV( Open Source Computer Vision) library in Python. OpenCV ( is an open-source computer vision and machine learning software library. Now a video is basically a set of moving pictures moving at a rate of about 24 frames per second 4 min read Get video duration using Python - OpenCV OpenCV is one of the most popular cross-platform libraries and it is widely used in Deep Learning, image processing, video capturing, and many more. In this article, we will learn how to get the duration of a given video using python and computer vision. Prerequisites: Opencv moduledatetime module 1 min read Python | Create video using multiple images using OpenCV Creating videos from multiple images is a great way for creating time-lapse videos. In this tutorial, weâll explore how to create a video from multiple images using Python and OpenCV. Creating a video from images involves combining multiple image frames, each captured at a specific moment in time, i 5 min read Python | Play a video in reverse mode using OpenCV OpenCV (Open Source Computer Vision) is a computer vision library that contains various functions to perform operations on Images or videos. OpenCV's application areas include : 1) Facial recognition system 2) motion tracking 3) Artificial neural network 4) Deep neural network 5) video streaming etc 3 min read Reading an image in OpenCV using Python Prerequisite: Basics of OpenCVIn this article, we'll try to open an image by using OpenCV (Open Source Computer Vision) library.  Following types of files are supported in OpenCV library:Windows bitmaps - *.bmp, *.dibJPEG files - *.jpeg, *.jpgPortable Network Graphics - *.png WebP - *.webp Sun raste 6 min read Python - Process images of a video using OpenCV Processing a video means, performing operations on the video frame by frame. Frames are nothing but just the particular instance of the video in a single point of time. We may have multiple frames even in a single second. Frames can be treated as similar to an image.So, whatever operations we can pe 4 min read Like