3

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!

Kaya311
  • 545
  • 2
  • 9
  • 21
  • You have the framerate and the frame number, what else would you need to generate the timeseries? – sco1 Jun 09 '15 at 11:59
  • There may be a creation timestamp buried somewhere in the file, depending on the camera, but there's no standard for how that sort of metadata is stored, if indeed it is at all. – nkjt Jun 09 '15 at 12:47
  • @excaza I need the exact time and date the video was shot, including the second. It's like comparing two strings, one being the timestamp of a frame ("06/10/2015 08:13:57") with a timestamp from another series of data, to find a match. – Kaya311 Jun 10 '15 at 04:14
  • I understand that @nkjt, but how would you access that data in MATLAB? – Kaya311 Jun 10 '15 at 04:14
  • Since there's no standard, you'd have to figure out where that data is buried (if it is there). You mention avi, mov, mpeg... all going to be different, nothing's going to work out of the box. For examples and some (non-MATLAB) code, see: http://www.eden-foundation.org/products/code/film_date_stamp/ – nkjt Jun 11 '15 at 12:37

1 Answers1

1

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.

Andrew
  • 742
  • 8
  • 21