I am working on an application where I am capturing a full HD Video from a framegrabber card and saving it to a file on disk. I am using Diretshow interfaces to capture the video stream, encode it and then using AVI Mux filter I am saving it to the disk.
Now I also want to add the timestamp(time when video was captured) to the video file, so that timestamp is visible on the top of video when user plays the video file later. And user should be able to play it any popular players(VLC, Windows media player etc.). Can anyone help me with possible methods for achieving this task.
You can write your own filter for this that inherits from CTransInPlaceFilter. Override the Transform method and in it you can write the time stamp on top of the Bitmap using GDI+.
You would have to connect this filter in the appropriate position in the graph i.e. somewhere where the media type is RGB.
EDIT:
Here’s some sample code ripped from a filter of mine for writing text on an RGB frame.
Hopefully that should get you started: