Skip to content

Instantly share code, notes, and snippets.

@himynamesdave
Created April 13, 2022 17:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save himynamesdave/7ca476b33b821d9b3c8e11cbac9a0307 to your computer and use it in GitHub Desktop.
Save himynamesdave/7ca476b33b821d9b3c8e11cbac9a0307 to your computer and use it in GitHub Desktop.
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