Extracting image from video at a given time using OpenCV

My task is to make a utility that can take a video and time in seconds. The utility should write out jpeg images from the video with the given input. E.g. let the video name be abc.mpeg and time be