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

232
Vistas
FFMPEG - How to set overlay video's size to input size

Ok, I'm using FFMPEG wasm in a NextJS project, but I think general FFMPEG solutions will work since FFMPEG wasm will parse normal FFMPEG commands.
What I'm trying to do is to add an overlay video on top of the input video, I also change the overlay video's opacity so that I can see the main video below. I already have that working, with this line of code:
-i input.mkv -i overlay.mov -filter_complex [1:v]format=argb,geq=r=\'r(X,Y)\':a=\'0.5*alpha(X,Y)\'[zork];[0:v][zork]overlay -pix_fmt yuv420p -preset ultrafast -c:a copy output.mkv.

The problem is that the input.mkv size might change as well as the overlay.mov, and I want to set the overlay.mov size to be the same as the input.mkv (so the solutions preferrebly can't use fixed values as well). I've seen other questions about that in stackoverflow, but since I'm already using the command to change the overlay's opacity I can't make it work with the command to also change the overlay's size, I don't have experience with FFMPEG whatsoever, so even though I've seen how to change overlay's opacity, and how to change overlay's size, I can't figure out how to combine those commands into a single one that do both.

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

0

First scale using scale2ref, then change opacity.

-i input.mkv -i overlay.mov -filter_complex [1:v][0:v]scale2ref[zork][video]; [zork]format=argb,lutrgb=a=val*0.5[zork];[video][zork]overlay -pix_fmt yuv420p -preset ultrafast -c:a copy output.mkv

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