Closed dkrizic closed 2 months ago
But reading my own stuff, I probably need to ensure that the timestamp has the right formats, maybe the offset comes from missing/wrong seconds.
I just checked, the time is perfect:
s -la --time-style=full-iso GX010051.MP4
.rw-------@ 1.4G dkrizic 2024-03-02 12:51:29.000000000 +0100 GX010051.MP4
The time offset is 40 seconds, where the GPX signal is ahead in time. So here it shows me boing at the bend at 12:49:20
But I actually arrive at 12:50:01
Hi. Thanks for your interest in the project.
Ultimately, this is a tricky problem... tbh usually the sync of a hero 11 is not too bad, but in any case, syncing things is hard.
We have lots of time sources. Gps from the gopro, gps from the gpx source and also file metadata.
In the case of gopro files generally, I've found that file metadata is the least reliable.
I have two proposed options that are sort of easy to do
This would be easier, but gpx files are usually 1 data point per second.
I think these would allow you to do most of the things you wanted.. Cheers
James
I'd be interested in this - "Don't clip gpx files to the video length" - so I can process short video clips from a longer journey and have the journey_map show the entire gpx (with my current position marked), not just the portion of the track that the video covers. Is this currently an option, or would it be a new feature?
This would be a new feature.. its something that I think could be quite useful.
Your code is great, really well structured and easy to follow - I think I can see how to change to support so I'll send a PR with my changes (tho I doubt they'll be good enough to merge as is!)
That is very kind, although tbh a lot of it is pretty rough - but i don't get to spend much time on it.
The main problem I think at the moment is that there is no real differentiation between the start and end of the movie, and the start and end of the "gopro/gpx" data. Need to introduce something so that this difference is specific. Unfortunately this bit of the code hasn't had much love since the early days....
The time offset is 40 seconds, where the GPX signal is ahead in time. So here it shows me boing at the bend at 12:49:20
![]()
But I actually arrive at 12:50:01
As far as i understand it, It is sort of impossible for the GPX and GoPro to be out of sync by this much, for the actual GPS data. As GPS basically relies on very accurate times. Indeed the US government promises that the time will be accurate within 30ns (nanoseconds).
That having been said... if the gopro isn't locked, the time will be wrong, and the file metadata is basically always wrong. (unless you have the gopro labs "file metadata gps sync" firmaware patch) - because the gopro file metadata is updated from the internal clock, not from GPS time.
It is of course quite possible that the time processing in thei sosftware is a bit wrong - and the file access time code is not used so much, so it could be an error there.
I have an event with about 10 videos and I observed the following:
So in order to have a somewhat reliable source of when the actual video start I use that feature that I mentioned, I ask ffprobe and use the creation_time, this creation_time is always available, even in files where the GoPro never locked. The interesting part is that there always seems to be an offset of 40 seconds.
Here is the Shell script that I use for doing everything: https://github.com/dkrizic/overlay/blob/main/overlay. This shell script needs a directory as parameter. I just throw in a FIT file and all my GoPro videos from that event/journey and it processes each file and merges then all files.
In line 43 I will add 40s to the video start and take a look at the result and report.
This does make sense - the file metadata (from ffprobe) is the one that doesn't come from GPS - its from an internal clock.. so it will drift over time, unless it is regularly reset - you can do this with the app, or manually, but tbh i find this to be a massive pain.
You can add a feature to the gopro firmware - follow the instructions at: https://gopro.github.io/labs/control/gpssync/ - which will update the file metadata according to the GPS time, rather than the internal clock. I think (untested) that this will work even when the GPS time is obtained part way through the recording. I think a more-or-less accurate time can be obtained even before the GPS locks, so this might be useful.
Thank you for the link. I was assuming that every time the GoPro has GPS, that the internal clock will be synched. That is what most devices do. But I will definitively activate this feature. Even if the GPS track is not very reliable, once it has GPS it can synchronise the clock precisely.
I've raised a couple of PRs - features work for me but have only done very limited testing...
Looks good, so the PR implement the ability to have the full journey based on the GPX/FIT and to read out the timestamp directly from the MP4. Great.
BTW, after applying an offset of -40 seconds to the video file timestamp, the sync is now perfect:
I will apply the above mentioned lab feature to sync the clock via GPS so that should not be the issue anymore. But my script is now able to handle an offset as well.
Thanks again for a great bit of software, here's a video I've made with it https://youtu.be/ip7nMh13nww?si=COCs-XWXawMIYZdH
Thanks for the tip with the GoPro Labs and the possibility to sync the clock using GPS. After sync the offset is gone and it matches perfectly. Will there be a version soon that can display the whole GPX track even if only a fraction is processed in the video?
Hi, I started using your software and would like to share my experience and problems. My typical approach when cycling is that is have 3 devices with me:
I found out that the GPS of the GoPro is basically useless. It needs a long time to lock and looses signal on many occurrences where especially the Apple Watch Ultra works perfectly. While the ride I activate the cameras many times, it is not running permanently. So after the ride what I have is:
I would like to have a single concatenated video that shows the whole Journey file. I am writing some shell scripts in order to automate my steps. My current approach is:
Currently I have two problems:
The way how I timestamp the files is basically the following. ffprobe gives some longish output that contains the timestamp of creation, like this
Then I can touch the file accordingly
which gives me the correct date and time of the file:
(I am one hour away from Zulu, so the hour difference is fine).
Additionally it would make sense to have a feature that shows the journey of the full length of the GPX/FIT.