
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
gopro-telemetry
Advanced tools
Reads telemetry from the GPMF track in GoPro cameras (Hero5 and later) and converts it to multiple formats
Parses telemetry from the GPMF track in GoPro cameras (Hero5 and later).
Created for Telemetry Overlay and the Telemetry Extractor for GoPro.
Here's a gallery with cool uses of the GoPro telemetry.
Accepts an object with binary data and timing data. Returns a promise that resolves to a JavaScript object (or optionally to other file formats) with a key for each device that was found. See samples/example.js for a basic implementation.
You must extract the raw GMPF data from the video file first. You can do so with gpmf-extract.
gopro-telemetry expects, as the mandatory first parameter, an object with the following properties:
An options object and a callback function are additional optional parameters. If a callback is provided, it will receive the extracted data, and the promise will not resolve the result.
Install:
$ npm i gopro-telemetry
Use as promise:
const goproTelemetry = require('gopro-telemetry');
const telemetry = await goproTelemetry(input, options); //Get your input with gpmf-extract
Use with callback:
const goproTelemetry = require('gopro-telemetry');
function callback(data) {
// Do something with the data
}
const telemetry = await goproTelemetry(input, options, callback);
The options must be an object. The following keys are supported.
All options default to null/false. Using filters to retrieve the desired results reduces the processing time.
Example:
const telemetry = await goproTelemetry(
{ rawData, timing },
{ stream: ['ACCL'], repeatSticky: true }
);
This slightly more comprehensive example includes the data extraction step with gpmf-extract.
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 => {
goproTelemetry(extracted, {}, telemetry => {
fs.writeFileSync('output_path.json', JSON.stringify(telemetry));
console.log('Telemetry saved as JSON');
});
})
.catch(error => console.error(error));
timing object structure:
{ frameDuration: 0.03336666666666667,
videoDuration: 480,
start: 2017-04-17T19:27:57.000Z,//Date object
samples:
[ { cts: 0, duration: 1001 },//Starting point and duration in milliseconds
{ cts: 1001, duration: 1001 },
{ cts: 2002, duration: 1001 },
{ cts: 3003, duration: 1001 },
{ cts: 4004, duration: 1001 } ] }
The output with the default options looks like this:
{ deviceId : {
data about the device : values,
streams : {
stream_key : {
data about the samples : values,
samples : [
{
cts : time from start,
date : time and date,
value : sample
sticky : {
name : value
}
},
{
cts : time from start,
date : time and date,
value : sample
}
]
}
}
}
}
Sticky values apply to all successive samples. You can export them to the outer object of all samples with the repeatSticky option.
Depending on the camera, model, settings and accessories, these are some of the available data:
This project is possible thanks to the gpmf-parser documentation, open sourced by GoPro.
These are the available preset formats:
GoPros split very long videos in multiple files. In order to generate a single metadata output you can provide the data as an array of objects with data and timing information. Note that usually the last 1-2 seconds of a video file do not include metadata. In some cases this might create a noticeable gap.
const telemetry = await goproTelemetry([
{ rawData: file1Data, timing: file1Timing },
{ rawData: file2Data, timing: file2Timing }
]);
The first step in the parsing process is usually the most resource-intensive. To avoid repeating it if you want to apply different options to the same input, you can retrieve the parsed data by using the raw option and pass it to in the successive calls as parsedData instead of rawData.
const parsedData = await goproTelemetry({ rawData, timing }, { raw: true });
const telemetry = await goproTelemetry({ parsedData, timing });
The 'raw' data option is sensitive to the options: device, stream, deviceList, streamList, tolerant, debug and indirectly to some presets. Meaning this approach should not be used if any of these options is going to change between calls.
Altitude data in old cameras was not recorded as mean-sea-level. The library tries to correct for this automatically, or if requested through the options. For altitude correction to work the optional peer dependency egm96-universal must be installed.
Additionally to the GPMF track, the mp4 header contains a GPMF atom embedded within the 'udta' atom. It contains, for example, manual and atomated highlight tags and video settings. Its structure is slightly different to the common GPMF track, so some different (and opinionated) interpretation is applied when the mp4header option is used.
If you liked this you might like some of my app prototyping.
Please make your changes to the dev branch, so that automated tests can be run before merging to master. Also, if possible, provide tests for new functionality.
FAQs
Reads telemetry from the GPMF track in GoPro cameras (Hero5 and later) and converts it to multiple formats
The npm package gopro-telemetry receives a total of 378 weekly downloads. As such, gopro-telemetry popularity was classified as not popular.
We found that gopro-telemetry demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.