Ask a Question
GoPro Support Hub Ask a question. Share an answer. Find a solution. Stay stoked.
Is your GoPro gear up to date? Check to see If it is on our Update page.
This is an open group. Sign in and click the "Join Group" button to become a group member and start posting.
Posts: 1
Can GPMF_parser help me map UTC <> ~frame # within video track?

What I need from this forum, is advice on how to tap into the GPMF data to produce the following array:

GPS_UTC, Approximate_Frame_Number_in_Video_track







I'm not interested in exact precision. I try to note this with a +/- wobble (presuming a base video of 30 fps) in my example. I need this so I can make a map of time/frame for semi-absolue random access to the right image for a given second. Is the GPMF_parser function going to be able to help?

Posts: 1,107
Re: Can GPMF_parser help me map UTC <> ~frame # within video track?
[ Edited ]

I think this was discussed here:

But since you don't seem to be interested in GPS locations you might need less than that. You just need the first GPS timestamp, and your framerate.
Edit, you first have to convert your timestamp into a number, I forgot mentioning that. It would take some kind of parsing function, as the format is not a 100% standard.

So, if your numeric timestamp is, for example 1546532061459 and your framerate is 30fps, you can deduce all your data, add 33,333 milliseconds for each frame:
1546532061459 1
1546532061492.3333 2
1546532061525.6667 3
1546532061559 4
1546532061592.3333 5
1546532061625.6667 6
1546532061659 7
1546532061692.3333 8
1546532061725.6667 9
1546532061759 10
1546532061792.3333 11
1546532061825.6667 12
1546532061859 13
1546532061892.3333 14
1546532061925.6667 15
1546532061959 16
1546532061992.3333 17
1546532062025.6667 18
1546532062059 19
1546532062092.3333 20
1546532062125.6667 21
1546532062159 22
1546532062192.3333 23
1546532062225.6667 24
1546532062259 25
1546532062292.3333 26
1546532062325.6667 27
1546532062359 28
1546532062392.3333 29
1546532062425.6667 30

If you can run JavaScript, for example from the Google Chrome Console (press Control+Shift+i or CMD+Shift+i on Mac, I suppose) and paste the following statement:

for (let i = 0; i<50; i++) console.log(1546532061459+(1000/30)*i,i+1)

Where the first i<50 is the number of frames you want information on, and the second 1000/30 is based on your framerate.

You can extract the timestamp of the first (and every) frame with these tools:
For example, choose CSV and do the math in excel or similar, if you want (format the TS column as a number, first).

Note that there might be an offset between the first frame and the first data value. Just now I'm not sure how much that is, you'd have to try tapping the camera and finding those taps both in the video frames and in the accelerometer CSV (create a graph from the data in excel and look for the peak), to calculate the offset.

Hope this is helpful.