# Extracting video frames date-time data

**URL:** <https://forum.opencv.org/t/extracting-video-frames-date-time-data/3411>\
**Category:** C++\
**Created:** [May 19, 2021, 11:22am UTC](https://forum.opencv.org/t/extracting-video-frames-date-time-data/3411 "2021-05-19T11:22:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sina\_Ranj\_kesh\_zade](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/sina_ranj_kesh_zade/32/1954_2.png) [@Sina\_Ranj\_kesh\_zade](https://forum.opencv.org/u/Sina_Ranj_kesh_zade)\
**Post date:** [May 19, 2021, 11:22am UTC](https://forum.opencv.org/t/extracting-video-frames-date-time-data/3411/1 "2021-05-19T11:22:22Z")

</div>

Hi,  
Is it possible to extract date-time of the video file frames while reading them by OpenCv in cpp?  
I mean the recording time of the frames.  
any help will be appreciated.  
Sina

---

<div class="post-metadata">

**Author:** ![berak](https://avatars.discourse-cdn.com/v4/letter/b/85f322/32.png) [@berak](https://forum.opencv.org/u/berak)\
**Post date:** [May 19, 2021, 11:27am UTC](https://forum.opencv.org/t/extracting-video-frames-date-time-data/3411/2 "2021-05-19T11:27:12Z")

</div>

> [@Sina\_Ranj\_kesh\_zade](#):
>
> I mean the recording time of the frames.

no, not possible. you _can_ get the time relative to the 1st frame, though.

if _you_ are recording that video, maybe you can save timestamps in a seperate text file (or make overlays on the images using putText())

at least, you could save the video with a timestamp in the filename, so all you need is offsets from there

---

<div class="post-metadata">

**Author:** ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)\
**Post date:** [May 19, 2021, 3:51pm UTC](https://forum.opencv.org/t/extracting-video-frames-date-time-data/3411/3 "2021-05-19T15:51:40Z")

</div>

> [@berak](#):
>
> you _can_ get the time relative to the 1st frame, though.

that’s `CAP_PROP_POS_MSEC`

or use an actual media library/API such as ffmpeg. that gives you full control over the video data, including all “presentation timestamps” (PTS) as well as any offsets or date/time information that _may_ be contained in the video file.
