Published
Edited
Aug 30, 2021
Insert cell
md`# ffmpeg -- not working yet`
Insert cell
viewof file = html`<input type=file>`
Insert cell
{
// ffmpeg currently not working :( error as below:
// after file load:
// ffmpeg-core.js:1 Uncaught ReferenceError: SharedArrayBuffer is not defined
// at ffmpeg-core.js:1
// also
// FS.readdir (from ffmpeg.ls) fails with "FS undefined"
await ffmpeg.load()
const files = ffmpeg.ls('.')
const target = file.name.split('.')[0] + '.mp3'
if (files.includes(target)) await ffmpeg.remove(target)
await ffmpeg.write(file.name, file.arrayBuffer())
//await ffmpeg.transcode(file.name, target)
await ffmpeg.run(`-i "${file.name}" "${target}"`)
return ffmpeg.ls('.')
}
Insert cell
c = require('@ffmpeg/ffmpeg@0.8.3/dist/ffmpeg.min.js')
Insert cell
ffmpeg = c.createFFmpeg({log: true})
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more