How to get the time stamp of each frame of a GoPro video in MATLAB?

6.4k views Asked by At

I'm trying to do post-processing on a video from GoPro using MATLAB 2015a. I need to get the timestamp from each frame of the video so that I can use it to make comparisons with another set of data that also uses timestamps. So the two timestamps must match by the second.

I've checked the MATLAB docs, and the VideoReader class has a property called "CurrentTime", but that only gives me the time of a frame in relation to the first frame, which it sets to '0' seconds, and not to the actual time and date the video was shot.

I've also seen people asking around different forums about how to add timestamps to GoPro videos, and there are even libraries on Python that enable you to do that, so I'm assuming that GoPro videos do not have timestamps in their file information.

Shouldn't video formats have a few bits with the date and time of when the video was recorded, especially ones like MPEG, AVI and MOV? If so, how come there isn't a way to access them from MATLAB?

I appreciate any help possible. Cheers!

1

There are 1 answers

0
Andrew On BEST ANSWER

You can read this from the EXIF data stored within the image. It is the only way I have found to accurately get the time.

http://au.mathworks.com/help/matlab/ref/exifread.html

The field I use is: "EXIF DateTimeOriginal" though there are a few other EXIF date/time fields

You can get a also get near time using the Last-modified header from the GoPro's HTTP server for that image.