Skip to content

BublTechnology/spherical-metadata

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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