Last active
May 15, 2019 17:21
-
-
Save dhardy92/7726c4ffb02a93c68ca11f18fa7744dd to your computer and use it in GitHub Desktop.
Create a SRT subtitle file with extrapolated speed from Garin activity
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.activityDetailMetrics[0].metrics[3] as $startime | | |
.activityDetailMetrics[] | | |
[ (((.metrics[3] - $startime) / 1000) | strftime("%H:%M:%S")), ((.metrics[10]//0)*3.6)] | | |
@tsv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BEGIN{ | |
speed=0;last="00:00:00"; | |
} | |
{ | |
printf ("%d\n%s,000 --> %s,000\n%02d km/h\n\n",NR,last,$1,speed); | |
last=$1; | |
speed=$2 | |
} | |
END{ | |
printf ("%d\n%s,000 --> %s,000\n%02d km/h\n\n",NR,last,"30:00:00",speed); | |
} | |
#Max time is 30min here |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Download from https://connect.garmin.com/modern/proxy/activity-service/activity//details? where is ID of Your activity. Store in activity.json then run :
jq -r -f GarminSpeed.jq < activity.json | awk -f speedsrt.awk
This can then be used to create video of your ride with encrusted Speed as text.
Here is an extract of the result :