1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-11-23 21:54:53 +02:00

avfilter/vf_chromakey_cuda: specify alpha_mode of output

Fix assert failure with:

ffmpeg -init_hw_device cuda=gpu -filter_hw_device gpu \
	-i input.mp4 -an \
	-vf hwupload,format=cuda,chromakey_cuda=color=black,hwdownload,format=yuva420p,alphaextract \
	-f null -

Assertion frame->alpha_mode == link->alpha_mode failed at src/libavfilter/avfilter.c:1085
This commit is contained in:
Zhao Zhili
2025-09-26 21:06:24 +08:00
committed by Zhao Zhili
parent 027497891b
commit ba9c635784

View File

@@ -259,6 +259,7 @@ static av_cold int cudachromakey_config_props(AVFilterLink *outlink)
s->cu_stream = s->hwctx->stream;
outlink->sample_aspect_ratio = inlink->sample_aspect_ratio;
outlink->alpha_mode = AVALPHA_MODE_STRAIGHT;
ret = cudachromakey_load_functions(ctx);
if (ret < 0)
@@ -389,6 +390,7 @@ static int cudachromakey_filter_frame(AVFilterLink *link, AVFrame *in)
ret = av_frame_copy_props(out, in);
if (ret < 0)
goto fail;
out->alpha_mode = outlink->alpha_mode;
ret = CHECK_CU(cu->cuCtxPopCurrent(&context));
if (ret < 0)