Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

240
Views
unable to generate .mov video thumbnail javascript

I'm trying to generate a thumbnail from a video(.mov) but it's showing this error

Error: Error 4; details: DEMUXER_ERROR_NO_SUPPORTED_STREAMS: FFmpegDemuxer: no supported streams

.mp4 and other formats are working well.

chrome version: Version 101.0.4951.67 (Official Build) (64-bit)

Code:

async generateVideoThumbnail(file) {
  console.log('generating thumbnail')
  const binaryData = []
  binaryData.push(file)
  const canvas = document.createElement('canvas')
  const context = canvas.getContext('2d')
  const video = document.createElement('video')
  video.setAttribute('src', URL.createObjectURL(new Blob(binaryData)))
  video.onloadeddata = () => {
    console.log('Yay! The readyState just increased to  ' +
        'HAVE_CURRENT_DATA or greater for the first time.');
  };
  video.loadstart = () => {
    console.error(`load start`);
  }
  video.onwaiting = () => {
    console.log('Video is waiting for more data.');
  };
  video.onprogress = () => {
    console.log("Downloading video");
  };
  video.onerror = () => {
    console.log('video error')
    console.log("Error " + video.error.code + "; details: " + video.error.message);
  }

  console.log(video)
  console.log('video load')
  video.load()
  let thumbnail = await new Promise((resolve) => {
    video.onloadedmetadata = async () => {
      console.log('on load')
      canvas.width = video.videoWidth
      canvas.height = video.videoHeight
      video.currentTime = video.duration / 2
      await video.play()
      context.drawImage(video, 0, 0)
      video.pause()
      const blob = await new Promise((resolve) => {
        return canvas.toBlob(function (blob) {
          resolve(blob)
        })
      })

     resolve(blob)
    }
})

return thumbnail

},
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I don't think Chrome is able to play mov files. You can check this in the console, by writing something like:

const video = document.createElement('video')
console.log(video.canPlayType('video/mp4'))       //expect 'maybe'
console.log(video.canPlayType('video/ogg'))       //expect 'maybe'
console.log(video.canPlayType('video/quicktime')) //expect ''

Firefox on the other hand seems to be able to play them, you might try your app there.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!