GPS Text Video Filter

Introduction

The GPS Text filter allows you to add useful GPS related data (such as speed, altitude or distance) on top of and in sync with your video. It is available since version 21.08.

Note: you need to record your GPS track with a device (phone, smartwatch, bike computer or dedicated GPS tracker) AND export your track to a .gpx or .tcx file. If you record using an action camera that has GPS (like GoPro), you need to extract the data to a separate file (there are online and offline tools for this.
Update: Shotcut 22.09 now supports .gpx extraction itself:
Properties panel ā†’ (hamburger menu) ā†’ Export GPX.

Tip: hover your mouse over filter elements for some extra explanations

Usage

  1. Add the GPS Text filter on a clip in the timeline.

  2. Click the Open file button in the filter panel to load the .gpx or .tcx file.
    ss open file crop

  3. Use the GPS offset row to sync the GPS track time to the video time (check out some hints below; if youā€™re extremely lucky they are already in sync and you can skip this step).
    ss gps offset row

  4. Edit the filter text panel with any keywords from the available list. You can also format the text to your liking just like Text: Simple filter.
    Tip: hover your mouse over the list for extra keyword arguments.
    ss text

  5. Check out the results live in the video player.

  6. If needed, change the more advanced options in the filter panel. There is also basic keyframing support for in/out and text position/size.

  7. Export

Syncing workflow details and tips

TLDR: watch out for timezones; buttons have tooltips; remember to film a clock from time to time for easy sync later (but do remember its timezone);
Also: scrollwheel to add/substract a few seconds for quick corrections.

At the very bottom of the filter panel (youā€™ll probably need to scroll to see it) there are 2 important date-time notes: the Videoā€™s and the GPSā€™s start times (Note: they will be first updated after you load a GPS file). The GPS time is always in the UTC timezone, but the Video start time is read from the fileā€™s Creation Time metadata field, which is currently very not-standardized across devices, and so, it might be in your local timezone or not, it might be set to the start or end of the video or it might just be a very random time if your device loses power and doesnā€™t sync it at startup.
The important thing to remember here is that no matter when you shot your video, this is what Shotcut sees as your fileā€™s start time (converted to UTC, so the same as GPS time) therefore this is what will be used for offseting the GPS track. You can use the #file_datetime_now# keyword to see it live in the output.

ss status text

Sync buttons

Syncing the GPS track to the video file will be the most annoying part of using this filter. To the right of the sync text areas there are a number of 4 buttons that will probably cover 95% of all use cases thus avoiding any need for doing time math. This will be frustrating at first but you will notice that there is a pattern to follow and it will be the same everytime for each device.

Note: if your device doesnā€™t support auto time sync over the internet you will most likely still need to match a few seconds (maybe even minutes) to the real time in addition to one of the helper buttons. I recommend you take a photo of a (digital) clock and check the photoā€™s properties for the time.

Iā€™ll go over the buttons from left to right, first being the clock one, and last the ā€œPauseā€ one.

ss gps offset row

Sync button 1: Timezone removal (GoPros)

Probably the most used button as I expect most shots that would work with a GPS overlay would come from an action camera and GoPro is doing this as well.
Why? If you canā€™t set the timezone in the camera clock settings, it will probably be wrongly set to UTC (well itā€™s wrong unless you live in UTC area) so the file will match the GPS track a few hours ahead or behind.
Devices? GoPros, some DSLRs/Mirrorless, most non professional grade video cameras will have this issue. This is an easy one to find as it will remain constant for all files.

Sync button 2: Video duration removal (Android)

Why? Some devices (cough android phones cough) decided itā€™s a good idea to set the videoā€™s creation time after you finish recording. So if you record a 15 minute video starting at 12:00, it will store the time as 12:15.
Devices? Android smartphones are the only ones that do this as far as I know.
Itā€™s a big pain as you canā€™t copy paste the filter to multiple clips, each clip has to be individually updated as it will most likely have a different duration.

Sync button 3: Sync beginings (tests & dashcam)

If you just want to see the filter work just press this button and it will immediately sync the 2 times no matter how far apart they are.
When? This is good for testing random files or if you donā€™t want to bother with times and just remember to start recording video and GPS at the same time.
Devices? My dashcam resets the time every time it loses power for more than a few hours. I gave up trying to set it correctly so I just start the GPS track and immediately hit start record.

Sync button 4: Sync to now

When? If you want a very precise sync that doesnā€™t need time keeping at all, this is the way: just start filming before the GPS device and make sure to record the moment the GPS device gets the first fix and starts recording. Move the playhead to that exact moment in the video, press the button and youā€™re done.
You can also make a sign or cover your camera with your palm as a mark point.
If you clap to sync audio to video this workflow will be very familiar.

Sync extra: record a precise clock

Your phone automatically syncs pretty precisely all the time. You can just record itā€™s clock (make sure you can see the seconds) at any moment and manually match the #gps_datetime_now# time to what you see in the video. This is my preferred method as Itā€™s simply the easiest and you donā€™t need to preserve file metadata (donā€™t forget about your clockā€™s timezone though).

More info

Here you can read the entire list of arguments and extra keywords. Most numeric fields accept obvious arguments (for example the speed or distance can be converted to imperial by typing ā€œmiā€, ā€œmileā€, ā€œmi/hā€ between the # ... # (example: #gps_speed mi#), time accepts standard %H:%M, temperature ā€œFā€ and ā€œKā€, etc).

Iā€™ll update some images tomorrow. Let me know if I got into too much detail or thereā€™s some other stuff I didnā€™t go over.

1 Like

Hello Shotcut community,

I work with Shotcut Version 21.03.21, language German
The GPS text video filter shown here is not listed in this version of Shotcut 03/21/21.

My question:
In which version of Shotcut can I find the GPS Text Video Filter?
Or did I ignore something?

With best regards from Germany
Ringo1

This filter has been introduced in 21.08.10 (beta version).

Hello Hudson555x, thank You!

Hi All - Iā€™m looking to experiment with this filter. I have dive logs that show depth, temperature and other logs over time. Looking at the XML file format, I think I could create a dive log that matches the structure of the .gpx or .tcx. Before spending some time on this, I wondered if there is any validation in the filter that might prevent me from using it for this unintended target?

Thanks

Hi robmason, I believe you can do what youā€™re planning but not as generic fields. There is validation in the filter, if you just add extra tags in the xml, they will be ignored (thereā€™s specific processing depending on what itā€™s reading ie: speed goes through processing so it can be converted from meters/s into km/h or mi/h etc). You can see the dropdown list for the current fields.

You can however reuse one of the standard fields we already support: depth into altitude (itā€™s a double data type so it can fit everything), temperature into heart rate (data type: short). You might need to fill in the lat/lon with random values and of course the time (mandatory).

Start with a real .gpx or .tcx file with existing fields edited in notepad to see if itā€™s working for you.

1 Like

Thanks Daniel - it sounds like it is wort trying.

Hi. Is it possible to support .fit files and more data type such as cadence or grade of the path?

It would be nice if it would be possible to define the GPS offset once and use it automatically for further GPS filters. Most of the time this remains constant e.g. during a bike ride.

Hi,

Not likely, or at least anytime soon. Just had a look and the fit file is way more complex than .gpx or .tcx and also for technical reasons it would also involve a bit of changes in the core filter that relies on GPS as a backbone.

Youā€™ll have to convert the .fit to .gpx or .tcx for now.

Grade is very high on my todo list. Cadence I might consider but Iā€™m not sure .gpx or .tcx support it. If you can find a converter that adds cadence (and/or grade) to gpx/tcx please share 2-3 sample files here (you can .zip and attach them here).

This is a good suggestion, but I need to find an intuitive way to do this. I had an idea with separate copy-paste buttons but it was too ugly and complex. Feel free to share your thoughts/design for this.

Hi @daniel47,

Here are two example files with Cadence (one of them also with calories). I have converted the .fit here: gotoes.org
Grade is unfortunately not supported in their tcx export.
tcx_samples.zip (165.3 KB)

The selection of the GPS offset could work like the naming of the motion trackers. One button assigns a name for a preset and could selected in a dropdown menu under the GPS offset fields

1 Like

@Daniel47
Hi,
Iā€™d also really appreciate the cadence and % path in the GPS text filter.
This would be very useful for road bike (especially in the mountains).
The .tcx file records cadence (not .gpx)
I believe the % path is calculated directly by the GPS computer and by the applications, from 2 altitude points (for Sigma computer, about 4 or 5 seconds).
Hereā€™s a .tcx file and a capture showing the cadence recording.
2021_07_06__08_27_Boultr_Valm.tcx.txt (1.7 MB)

1 Like

Thanks for the sample files, Iā€™ll have a look as time permits as I have a quick vacation coming up.

enjoy your vacationšŸ˜€

1 Like

GPS text filter works great on first attempt! But is it possible to display distance in unit km? E.g. with one digit (ā€œ2,3 kmā€)?

@Joachim How to change unit m to km (with 2 digits):

4 Likes

Quick update: Iā€™ve added (locally for now) cadence and temperature support. Iā€™ve also been looking on other commonly supported fields but I think these are all the more used/useful ones. Theyā€™re pretty easy to add in the future so weā€™ll see which ones becomes popular.

Iā€™ve also coded for the grade (from GPS+altitude) and overall it works fine but I need to test a bit more to fix some corner cases. Iā€™m thinking to add a minimum speed for which to calculate it because otherwise sitting [almost] still while updating altitude would give unexpectedly high %.
What do you guys think, would something like a minimum 2km/h speed be fine? I guess this would miss some valid crazy hard hiking areas where you walk very very slowly uphill? But overall the values would be closer to reality for other activities.

1 Like

The only scenario I envisage with a scenario < 2km/h would be scrambling, so technically not hiking but can be a small percentage of a hike, so the 2km/h should be fine

1 Like

@Daniel47
Thanks for adding cadence and temperature. For the grade, minimum 2km/h is perfect.
Canā€™t wait to test it on my road bike rides.

1 Like

That filter is incredible, thanks ! A nice plus would be to get the vertical speed, which is the most useful information for aerial sports (paragliding, ā€¦), and available in gpx data of apps or devices used for these sports. Hereā€™s a file, if it can help :slight_smile:
vertical speed sample.gpx.txt (206.6 KB)

1 Like