Search code examples
batch-filevideoffmpegvideo-processing

Getting an error 'too many inputs specified for the "scale" filter' in ffmpeg


I'm trying to add watermarks to multiple images using ffmpeg. It works good in the beginning but when I try to change the opacity of the watermark it shows the error as:

[AVFilterGraph @ 0000019b2a655340] Too many inputs specified for the "scale" filter. Error initializing complex filters. Invalid argument

The used code:

for %%a in ("*.jpg") do ffmpeg -i "%%a" -i wm.png -filter_complex "[1]lut=a=val*0.3[a];[0][a][1]scale=iw*0.50:-1[wm];[0][wm]overlay=0:0" -preset ultrafast "post\%%~na.jpg"

Solution

  • If I understand your intent correctly, change

    [1]lut=a=val*0.3[a];[0][a][1]scale=iw*0.50:-1[wm];
    

    to

    [1]lut=a=val*0.3,scale=iw*0.50:-1[wm];
    

    The watermarked can be scaled directly after the alpha change.