feat: add csv export support
This commit is contained in:
parent
124eb02e97
commit
407544412f
10
README.md
10
README.md
|
@ -2,6 +2,12 @@
|
||||||
|
|
||||||
A cli tool to export GoPro metadatas from video files.
|
A cli tool to export GoPro metadatas from video files.
|
||||||
|
|
||||||
|
## Install
|
||||||
|
|
||||||
|
`npm install -g gopro-telemetry-exporter`
|
||||||
|
|
||||||
|
or just prefix command `npx`
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
`gopro-telemetry-exporter --input GPX010001.MP4 --output GPX010001.gpx --GPS5Fix 3 --preset gpx --groupTimes 200`
|
`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
|
* All other options will be pass directly to [GoPro Telemetry](https://www.npmjs.com/package/gopro-telemetry), you
|
||||||
can check the list
|
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
|
## TODO
|
||||||
|
|
||||||
* Check all the presets
|
* Check all the presets
|
||||||
|
|
|
@ -29,9 +29,12 @@ async function main(options) {
|
||||||
}
|
}
|
||||||
|
|
||||||
goproTelemetry(res, _.omit(options, ['_', 'input', 'output']), telemetryData => {
|
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);
|
telemetryData = JSON.stringify(telemetryData);
|
||||||
}
|
}
|
||||||
|
|
||||||
fs.writeFileSync(options.output, telemetryData);
|
fs.writeFileSync(options.output, telemetryData);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user