Re-orders moov atoms in mp4 containers to enable streaming. Based on qt-faststart, but works with a Buffer
interface.
BigInt
support!
Get it via npm:
npm install --save moov-faststart
or yarn:
yarn add moov-faststart
import { faststart } from 'moov-faststart'
import * as fs from 'fs'
// Get a Buffer containing unstreamable MP4...
const mp4File = fs.readFileSync('./unstreamable.mp4')
// Faststart it!
const faststartedMp4 = faststart(mp4File)
// Write out the Buffer containing the faststarted MP4. Done!
fs.writeFileSync('./streamable.mp4', faststartedMp4)