fix-webm-meta
fix-webm-meta copied to clipboard
help, not work, also no duration at potplayer&chrome video tag
// "fix-webm-metainfo": "1.0.8"
// "electron": "19.0.6"
console.warn('fixWebmFile', filePath)
const fs = await import('fs-extra')
let buffer = await fs.readFile(filePath)
const fixWebm = await import('fix-webm-metainfo').then(js => js.default)
// https://stackoverflow.com/questions/61731218/conversion-of-buffer-data-to-blob-in-nodejs
let blob = new Blob([buffer], { type: 'video/webm;codecs=h264' })
buffer = null
blob = await fixWebm(blob)
buffer = Buffer.from(await blob.arrayBuffer())
blob = null
await fs.writeFile(filePath + '-fixed.webm', buffer)
console.warn('fixWebmFile end')
the -fixed.webm file also not have duration on video player. help, thanks.
the fixed.webm file can play well, but no video duration