mp4box.js icon indicating copy to clipboard operation
mp4box.js copied to clipboard

How do I extract images as base64url from video

Open AnilSonix opened this issue 3 years ago • 2 comments

Can anyone provide code snippet to extract all the images from a video using mp4box?

AnilSonix avatar Jul 25 '22 06:07 AnilSonix

how is it going now

daxiazilong avatar Dec 19 '24 03:12 daxiazilong

A way to resolve this is use EncodedVideoChunk and videoDecoder , like this

videoDecoder = new VideoDecoder({
    output: videoFrame => {
      createImageBitmap(videoFrame).then(img => {
        videoFrames.push({
          img,
          duration: videoFrame.duration,
          timestamp: videoFrame.timestamp,
        })
        videoFrame.close()
      })
    },
    error: err => {
      console.error('videoDecoder错误:', err)
    },
  })`
you now can get img from videoFrame

daxiazilong avatar Dec 19 '24 03:12 daxiazilong