gopro-telemetry: RangeError [ERR_FS_FILE_TOO_LARGE]
Trying to get the GoPro telemetry data for a 4GB video using the sample code:
const gpmfExtract = require('gpmf-extract');
const goproTelemetry = require(`gopro-telemetry`);
const fs = require('fs');
const file = fs.readFileSync('path_to_your_file.mp4');
gpmfExtract(file)
.then(extracted => {
let telemetry = goproTelemetry(extracted);
fs.writeFileSync('output_path.json', JSON.stringify(telemetry));
console.log('Telemetry saved as JSON');
})
.catch(error => console.log(error));
Getting RangeError [ERR_FS_FILE_TOO_LARGE]: File size (4001043636) is greater than possible Buffer: 2147483647 bytes. Is there a way to extract the gpmf data without sync. reading the entire file?
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 15 (6 by maintainers)
Hi @MauriceMorrey . No, the above solutions are still recommended
@plouj that’s a pretty interesting approach. I hadn’t thought of combining both ffmpeg and gpmf-extract. Ideally there should be an all JS/Nodejs solution, though
Whoever is going with the approach of using
ffmpegto extract thegpmdsteam can also downsample the video to make it fit into the 2GB size limitation in one go as a quick and dirty solution.The following reduces HERO5 4k 60fps 60mbit video from 3.4GB down to 22MB:
and allows using
gpmfExtractto extract both the telemetry (stream0:3in the above case) and the timing data in one go.