Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

178
Visualizações
Extract frames from video angular

I'm trying to extract frames from a video on angular. I found several post here on SO, especially this post https://stackoverflow.com/a/32708998, i've tried to implement first solution but i can't get any frame i still don't know why. So i research about it again and i found this resource videotoframes he already has a type version, after some workaround i finally can extract the frames from video like this and put it to canvas.

enter image description here

But the thing is, i need to specify how many frames would i wanted from this. here's what i did

  loadImages() {
    this.loading = true;
    this.video.getFrames('/assets/ForBiggerBlazes.mp4', 375, VideoToFramesMethod.totalFrames).then((frames) => {
      console.log(frames);
      frames.forEach((frame) => {
        var canvas = document.createElement('canvas');
        canvas.width = frame.width;
        canvas.height = frame.height;
        canvas.getContext('2d').putImageData(frame, 0, 0);
        document.getElementsByTagName('div')[0].appendChild(canvas);
      });
    });
  }

number 375 is an estimate how many frame my video is, is there any way to get how many frames a video have on upload?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

The average HTML frame rate is 24 FPS, so if the video is 30 seconds, the total frame number is 30 x 24 Get the time of the video

const videoDOM=document.getElementById("video"); 
videoDom.duration

this will give u NaN, so to avoid that, we need to wait for the duration to change then call videoDom.duration


videoDom.ondurationchange = () => {
   this.vidDuration = vid.duration;
};

that way we can get an actual duration

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda