Opened 16 months ago

Closed 16 months ago

Last modified 16 months ago

#10128 closed enhancement (invalid)

[Feature request] Blend mode for overlay

Reported by: 1et0ovnu6lk6 Owned by:
Priority: wish Component: ffmpeg
Version: unspecified Keywords: ffmpeg, blend mode
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Hello, it would be great if you add "Blend mode" (like in photoshop / premiere) for images that using for watermarks on videos.

Here is how it looking in photoshop:

https://photographylife.com/wp-content/uploads/2021/04/BlendMode1.png

Without blend mode (overlay):
https://i.imgur.com/SLrrVPx.png
With:
https://i.imgur.com/IjWXBvf.png

Change History (5)

comment:1 by Elon Musk, 16 months ago

Resolution: invalid
Status: newclosed

Already possible. See documentation.

in reply to:  1 ; comment:2 by 1et0ovnu6lk6, 16 months ago

Replying to Elon Musk:

Already possible. See documentation.

I looked, but I'm not professional enough on this subject, and I can't figure out the parameters for such watermark. If you have time, could you please help me make a query that would impose such a watermark? Here is my "filter_complex":

-i "!!!\WM.png" -filter_complex "[0]scale='if(gt(iw,ih),854,-2)':'if(gt(iw,ih),-2,854)'[scaled];[scaled][1]overlay=x=(W-w)/2:y=H-h-100" -c:a aac -b:a 128k -c:v libx264 -preset veryfast -crf 23 -maxrate 5M -bufsize 10M "done.mp4"

in reply to:  2 comment:3 by 1et0ovnu6lk6, 16 months ago

Replying to 1et0ovnu6lk6:

Replying to Elon Musk:

Already possible. See documentation.

I looked, but I'm not professional enough on this subject, and I can't figure out the parameters for such watermark. If you have time, could you please help me make a query that would impose such a watermark? Here is my "filter_complex":

-i "!!!\WM.png" -filter_complex "[0]scale='if(gt(iw,ih),854,-2)':'if(gt(iw,ih),-2,854)'[scaled];[scaled][1]overlay=x=(W-w)/2:y=H-h-100" -c:a aac -b:a 128k -c:v libx264 -preset veryfast -crf 23 -maxrate 5M -bufsize 10M "done.mp4"

I think it's not possible for image watermarks which are smaller than those of the video. When I using this:

-filter_complex "[0:v] format=rgba [bg]; [1:v] format=rgba [fg]; [bg][fg] blend=all_mode='multiply':all_opacity=1, format=rgba"

I got this:

[Parsed_blend_2 @ 0000026231f60f80] First input link top parameters (size 480x848) do not match the corresponding second input link bottom parameters (size 200x83)

comment:4 by 1et0ovnu6lk6, 16 months ago

I googled hard but there is no way to use blend mode on watermark image smaller than video. It's been asked 8 years ago and still no answer:
https://ffmpeg-user.ffmpeg.narkive.com/gZ23YYCA/how-to-blend-logo-and-video-with-transparent-effect

And even if I resize watermark to video size I got green screen:
https://i.imgur.com/iselDMT.jpg

Last edited 16 months ago by 1et0ovnu6lk6 (previous) (diff)

comment:5 by Elon Musk, 16 months ago

Learn how to use ffmpeg properly first or ask someone else to teach you.

The stream video size can be properly padded with alpha to needed video size and correct pixel format used when blending with picked blending mode.

Note: See TracTickets for help on using tickets.