A port of google's spatial media tools to JS
npm install @bubltechnology/spherical-metadata
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')
})
{
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
}
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)
})