cv::VideoWriter.write() - timestamp of written frame

Hello everyone,

I am currently working on capturing frames from a camera and writing them to a video file. I am wondering if there is a way to obtain the timestamp of the just-written frame. It seems that the write function returns void, so I’m unsure how to retrieve the timestamp. Any suggestions or hints would be greatly appreciated.

Thank you in advance for your help.

Best regards
Christa

What camera are you using?

no you can’t obtain the timestamp of a frame you just wrote to a file. that’s a meaningless value for this operation.

I’ve tested it with the built-in USB camera on my laptop.

In my scenario, this value is essential for subsequent processing. It needs to be transferred to another process immediately after writing the frame into the file.

do you not want the time the picture was taken, instead of when it was written?

OpenCV is the wrong library for you. you need to use ffmpeg’s libraries, or something similar.