JuanIrache / gopro-telemetry

Reads telemetry from the GPMF track in GoPro cameras (Hero5 and later) and converts it to multiple formats
https://tailorandwayne.com/gopro-telemetry-extractor/
MIT License
315 stars 57 forks source link

Error: Error, negative length #198

Closed barney2074 closed 1 year ago

barney2074 commented 1 year ago

Hi

I used gopro-telemetry some time ago and it worked fine- but I can't quite remember what I did I've just tried it again and I get various errors

If anyone can help- I'd be grateful- I know next to nothing about javascript

On a Windows machine:

PS C:\Apps\gopro-telemetry\samples> node example.js
Error: Error, negative length
    at parseKLV (C:\Apps\gopro-telemetry\code\parseKLV.js:216:22)
    at async parseOne (C:\Apps\gopro-telemetry\index.js:31:18)
    at async process (C:\Apps\gopro-telemetry\index.js:175:20)
    at async GoProTelemetry (C:\Apps\gopro-telemetry\index.js:347:18)
    at async toJSON (C:\Apps\gopro-telemetry\samples\example.js:12:20)

On a Linux machine:

ub@z4g4:~/gopro-telemetry/samples$ node example.js
Error: Error, negative length
    at parseKLV (/home/ub/gopro-telemetry/code/parseKLV.js:216:22)
    at async parseOne (/home/ub/gopro-telemetry/index.js:31:18)
    at async process (/home/ub/gopro-telemetry/index.js:175:20)
    at async GoProTelemetry (/home/ub/gopro-telemetry/index.js:347:18)
    at async toJSON (/home/ub/gopro-telemetry/samples/example.js:12:20)

On a Window machine, following https://www.trekview.org/blog/2022/gopro-telemetry-exporter-getting-started/

PS C:\Apps\gopro-telemetry\samples> node GS018422-full-telemetry.js
[0:00:00.701] [BoxParser] Box of type '☺' has a size 1024 greater than its container size 116
C:\Apps\gopro-telemetry\samples\GS018422-full-telemetry.js:10
fs.writeFileSync('GS018422-full-telemetry.json', JSON.stringify(telemetry));
TypeError: Do not know how to serialize a BigInt
    at JSON.stringify (<anonymous>)
    at C:\Apps\gopro-telemetry\samples\GS018422-full-telemetry.js:10:55
    at GoProTelemetry (C:\Apps\gopro-telemetry\node_modules\gopro-telemetry\index.js:349:3)

Andrew

JuanIrache commented 1 year ago

It would seem you are trying to parse a corrupted file, or at least one where the data structure is not as expected