npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

gpmf-extract

v0.3.2

Published

Extracts binary GoPro Metadata Format from video files

Downloads

1,381

Readme

GPMF extract

Finds the metadata track in GoPro (Hero5 and later) video files (or any other camera that implements GPMF) and extracts it for later analysis and processing.

Accepts a File and returns a Promise that resolves to an object with a rawData (Buffer in NodeJS, UInt8Array in Browser) and timing data (timing), useful for interpreting the data.

Once extracted, you can process the data with gopro-telemetry.

Install:

$ npm i gpmf-extract

Use:

const gpmfExtract = require('gpmf-extract');
gpmfExtract(file).then(res => {
  console.log('Length of data received:', res.rawData.length);
  console.log('Framerate of data received:', 1 / res.timing.frameDuration);
  // Do what you want with the data
});

You can specify some options in an object as a second argument:

  • browserMode: Default: false. Change behaviour to use in browser. This is optional for debugging reasons
  • useWorker: Default: true. In browser mode, use a web worker to avoid locking the browser. This is optional as it seems to crash on some recent browsers
  • progress: Pass a function to read the processed percentage updates
  • cancellationToken: An optional object, containing a cancelled property, that allows for cancelling the extraction process. Currently only supported in browser mode. If cancelled, the extraction process will fail with the error message "Canceled by user".
const gpmfExtract = require('gpmf-extract');
const progress = percent => console.log(`${percent}% processed`);
const cancellationToken = { cancelled: false };
gpmfExtract(file, { browserMode: true, progress, cancellationToken }).then(
  res => {
    if (!res) return; //cancelled
    // Do what you want with the data
  }
);
// Some other processes
cancellationToken.cancelled = true;

About

This code was created for the GoPro Telemetry Extractor.

Here's a gallery with cool uses of the GoPro telemetry.

This project is possible thanks to the gpmf-parser documentation, open sourced by GoPro.

More creative coding

If you liked this you might like some of my app prototyping.

Contribution

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.

To-DO

  • Fix #46 Memory allocation with large files on certain browsers when using the web worker option
  • Increase browser compatibility
  • Extract highlights

Acknowledgements/credits