Created
April 13, 2022 17:13
-
-
Save himynamesdave/7ca476b33b821d9b3c8e11cbac9a0307 to your computer and use it in GitHub Desktop.
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
const gpmfExtract = require('gpmf-extract'); | |
const goproTelemetry = require(`gopro-telemetry`); | |
const fs = require('fs'); | |
const file = fs.readFileSync('GS018422.mp4'); | |
// ENTIRE JSON | |
gpmfExtract(file) | |
.then(extracted => { | |
goproTelemetry(extracted, { | |
}, telemetry => { | |
fs.writeFileSync('GS018422.json', JSON.stringify(telemetry)); | |
console.log('Telemetry saved as JSON'); | |
}); | |
}) | |
.catch(error => console.error(error)); | |
// FILTERED RESULTS AS GPX | |
gpmfExtract(file) | |
.then(extracted => { | |
goproTelemetry(extracted, { | |
stream: 'GPS5', | |
GPS5Fix: 3, | |
GPS5Precision: 500, | |
WrongSpeed: 50, | |
preset: 'gpx' | |
}, telemetry => { | |
fs.writeFileSync('GS018422-filtered.gpx', JSON.stringify(telemetry)); | |
console.log('Telemetry saved as GPX'); | |
}); | |
}) | |
.catch(error => console.error(error)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment