简体   繁体   中英

Use ffmpeg to apply blend overlay to the last PNG

I am currently overlaying a list of PNGS to generate a final PNG file with ffmpeg using the following command:

ffmpeg -i a1.png -i a2.png -i a3.png -i a4.png -i a5.png -i a6.png -y \
-filter_complex \
  [0:v][1:v]overlay=format=auto[v1];\
  [v1][2:v]overlay=format=auto[v2];\
  [v2][3:v]overlay=format=auto[v3];\
  [v3][4:v]overlay=format=auto[v4];\
  [v4][5:v]overlay=format=auto,split[s0][s1];\
  [s0]palettegen[p];\
  [s1][p]paletteuse[f1] \
-map [f1] out/assets/1.webp

Now, I would like to apply a blend=all_mode='overlay' to the last PNG (a6.png). I tried the command below but throwing an error. Any idea what i'm doing wrong?

ffmpeg -i a1.png -i a2.png -i a3.png -i a4.png -i a5.png -i a6.png -y \
-filter_complex \
  [0:v][1:v]overlay=format=auto[v1];\
  [v1][2:v]overlay=format=auto[v2];\
  [v2][3:v]overlay=format=auto[v3];\
  [v3][4:v]overlay=format=auto[v4];\
  [v4][5:v]overlay=format=auto[v5];\
  [v4][v5]blend=all_mode='overlay'[vv5];\
  [vv5]split[s0][s1];\
  [s0]palettegen[p];\
  [s1][p]paletteuse[f1] \
-map [f1] out/assets/1.webp
Error: ffmpeg exited with code 1: Stream specifier 'v4' in filtergraph description

Thank You

You're using [v4] output pad twice as an input pad. Insert another split :

  [v4]split=2[v4a][v4b];\
  [v4a][5:v]overlay=format=auto[v5];\
  [v4b][v5]blend=all_mode='overlay'[vv5];\

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM