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

103
Vistas
Losing audio when overlaying videos with fluent ffmpeg

I have one main video file and a dynamic number of smaller video files that need to be overlayed at specific times based on timestamps.

I was able to get the video to overlay at the correct spots but now I don't have any audio. (Note: I only need audio from the first input as the overlayed videos have no audio)

I believe it is an issue with my syntax around the inputs, but can't quite figure it out. Any help is appreciated.

Here is my code:

 const mergedVideo = ffmpeg("/tmp/orignal.mp4");
 screenShareFileNames.forEach((fileName) => mergedVideo.addInput(fileName));

 const filters = screenShareFileNames.map((fileName, index) => {
    const inputs = index === 0 ? "[0:v][1:v]" : `[tmp][${index + 1}:v]`;
    const outputs = `tmp`;
          
    return {
            filter: "overlay",
            options: { enable: `between(t,${insertPoint},${insertPoint + 5})` },
            inputs,
            outputs,
          };
  });

  mergedVideo
     .complexFilter(filters, "tmp")
     .save("/tmp/final.mp4");



about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

It appears I needed to add an outputOptions that mapped the audio from the orginal video.

 mergedVideo
          .complexFilter(filters, "tmp")
          .outputOptions(["-map 0:a"])
          .output("/tmp/final.mp4")
          .run();
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