@bubltechnology/spherical-metadata
v1.0.1
Published
A port of google's [spatial media tools](https://github.com/google/spatial-media/tree/master/spatialmedia) to JS
Downloads
4
Readme
spherical-metadata
A port of google's spatial media tools to JS
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)
})