&pl_alpha_overlay expects straight alpha, but the alpha output may be premultiplied as a result of the target alpha mode (or in the absence of an alpha channel). Fix it by requesting independent alpha explicitly when blending.
Unified · Split
| @@ -908,6 +908,9 @@ static int output_frame(AVFilterContext *ctx, int64_t pts) · 907 unmodified lines | |||
| 908 | opts->params.skip_caching_single_frame = high_fps; | 908 | opts->params.skip_caching_single_frame = high_fps; |
| 909 | update_crops(ctx, in, &target, out->pts * av_q2d(outlink->time_base)); | 909 | update_crops(ctx, in, &target, out->pts * av_q2d(outlink->time_base)); |
| 910 | pl_render_image_mix(in->renderer, &in->mix, &target, &opts->params); | 910 | pl_render_image_mix(in->renderer, &in->mix, &target, &opts->params); |
| 911 | |||
| 912 | /* Force straight output and set correct blend mode */ | ||
| 913 | target.repr.alpha = PL_ALPHA_INDEPENDENT; | ||
| 911 | opts->params.blend_params = &pl_alpha_overlay; | 914 | opts->params.blend_params = &pl_alpha_overlay; |
| 912 | #if PL_API_VER >= 346 | 915 | #if PL_API_VER >= 346 |
| 913 | opts->params.background = opts->params.border = PL_CLEAR_SKIP; | 916 | opts->params.background = opts->params.border = PL_CLEAR_SKIP; |