Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

177
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda