@bubltechnology/spherical-metadata

1.0.1 • Public • Published

spherical-metadata

A port of google's spatial media tools to JS

CircleCI js-standard-style Build Status

npm version

License

Using the library

  npm install @bubltechnology/spherical-metadata

injectMetadata

Inject spherical metadata into an MP4 file

const sphericalMetadata = require('@bubltechnology/spherical-metadata')

sphericalMetadata.injectMetadata({
  source: 'equi.MP4',
  destination: 'equi-with-metadata.MP4',
  software: 'Bubl',
  projection: 'equirectangular',
  sourceCount: 4
}).catch((err) => {
  console.log(`Error occurred while injecting metadata: ${err}`)
}).then(() => {
  console.log('Metadata injection completed')
})

Options

{
  stereo: 'top-bottom' || 'left-right',
  crop: {
    CroppedAreaImageWidthPixels: pixelValue,
    CroppedAreaImageHeightPixels: pixelValue,
    FullPanoWidthPixels: pixelValue,
    FullPanoHeightPixels: pixelValue,
    CroppedAreaLeftPixels: pixelValue,
    CroppedAreaTopPixels: pixelValue
  },
  software: String,
  projection: 'equirectangular',
  sourceCount: Number,
  source: filePath,
  destination: filePath
}

readMetadata

Read the spherical metadata currently in an MP4 file and return an options object

const sphericalMetadata = require('@bubltechnology/spherical-metadata')
sphericalMetadata.readMetadata(value).then((data) => {
  console.log(data)
})

License

Apache 2.0

Package Sidebar

Install

npm i @bubltechnology/spherical-metadata

Weekly Downloads

1

Version

1.0.1

License

Apache-2.0

Last publish

Collaborators

  • aerialx
  • bublcam
  • turbobeast