diff --git a/README.md b/README.md index 2809997..631b1aa 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,12 @@ A cli tool to export GoPro metadatas from video files. +## Install + +`npm install -g gopro-telemetry-exporter` + +or just prefix command `npx` + ## Usage `gopro-telemetry-exporter --input GPX010001.MP4 --output GPX010001.gpx --GPS5Fix 3 --preset gpx --groupTimes 200` @@ -13,6 +19,10 @@ geojson, csv, mgjson, virb, and other format that can be supported by * All other options will be pass directly to [GoPro Telemetry](https://www.npmjs.com/package/gopro-telemetry), you can check the list +### Example CSV export of GPS5 stream + +`gopro-telemetry-exporter --input GPX010001.MP4 --output test.csv --GPS5Fix 3 --preset csv --groupTimes 200 --stream GPS5` + ## TODO * Check all the presets diff --git a/bin/gopro-telemetry-exporter.js b/bin/gopro-telemetry-exporter.js index 59ca401..cb7b5c3 100755 --- a/bin/gopro-telemetry-exporter.js +++ b/bin/gopro-telemetry-exporter.js @@ -29,9 +29,12 @@ async function main(options) { } goproTelemetry(res, _.omit(options, ['_', 'input', 'output']), telemetryData => { - if (!_.isString(telemetryData)) { + if (options.preset === 'csv') { + telemetryData = _.values(telemetryData)[0]; + } else if (!_.isString(telemetryData)) { telemetryData = JSON.stringify(telemetryData); } + fs.writeFileSync(options.output, telemetryData); });