This is an automated email from the git hooks/post-receive script. Git pushed a commit to branch master in repository ffmpeg.
commit 0ba9e272fa8497bed4f7397dbe342e72484e1ef7 Author: Marton Balint <[email protected]> AuthorDate: Sat Jan 17 21:27:41 2026 +0100 Commit: Marton Balint <[email protected]> CommitDate: Wed Jan 21 22:02:50 2026 +0000 fftools/ffplay: add support for rendering without alpha Signed-off-by: Marton Balint <[email protected]> --- doc/ffplay.texi | 3 ++- fftools/ffplay.c | 7 ++++++- fftools/ffplay_renderer.c | 3 +++ fftools/ffplay_renderer.h | 1 + 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/doc/ffplay.texi b/doc/ffplay.texi index 0b6b905532..61d6589587 100644 --- a/doc/ffplay.texi +++ b/doc/ffplay.texi @@ -213,7 +213,8 @@ Set the video background pattern used for transparent videos. For solid color patterns you can use the color name or color code as specified in the @ref{color syntax,,Color section in the ffmpeg-utils(1) manual,ffmpeg-utils}. You can also use the special @code{tiles} keyword for a checker board style -pattern. This is also the default. +pattern. This is also the default. The @code{none} pattern does rendering +without alpha blending effectively ignoring alpha channel. @end table diff --git a/fftools/ffplay.c b/fftools/ffplay.c index 6529986c2b..fe9aec05ab 100644 --- a/fftools/ffplay.c +++ b/fftools/ffplay.c @@ -995,6 +995,9 @@ static void draw_video_background(VideoState *is) fill_rectangle(rect->x, rect->y, rect->w, rect->h); break; } + case VIDEO_BACKGROUND_NONE: + SDL_SetTextureBlendMode(is->vid_texture, SDL_BLENDMODE_NONE); + break; } } } @@ -3266,7 +3269,9 @@ static VideoState *stream_open(const char *filename, if (startup_volume > 100) av_log(NULL, AV_LOG_WARNING, "-volume=%d > 100, setting to 100\n", startup_volume); if (video_background) { - if (strcmp(video_background, "tiles")) { + if (!strcmp(video_background, "none")) { + is->render_params.video_background_type = VIDEO_BACKGROUND_NONE; + } else if (strcmp(video_background, "tiles")) { if (av_parse_color(is->render_params.video_background_color, video_background, -1, NULL) >= 0) is->render_params.video_background_type = VIDEO_BACKGROUND_COLOR; else diff --git a/fftools/ffplay_renderer.c b/fftools/ffplay_renderer.c index 97e79f134b..335c286c65 100644 --- a/fftools/ffplay_renderer.c +++ b/fftools/ffplay_renderer.c @@ -747,6 +747,9 @@ static int display(VkRenderer *renderer, AVFrame *frame, RenderParams *params) pl_params.background_color[i] = params->video_background_color[i] / 255.0; pl_params.background_transparency = (255 - params->video_background_color[3]) / 255.0; break; + case VIDEO_BACKGROUND_NONE: + pl_frame.repr.alpha = PL_ALPHA_NONE; + break; } if (!pl_render_image(ctx->renderer, &pl_frame, &target, &pl_params)) { diff --git a/fftools/ffplay_renderer.h b/fftools/ffplay_renderer.h index 655576c602..c4893f6d5e 100644 --- a/fftools/ffplay_renderer.h +++ b/fftools/ffplay_renderer.h @@ -30,6 +30,7 @@ typedef struct VkRenderer VkRenderer; enum VideoBackgroundType { VIDEO_BACKGROUND_TILES, VIDEO_BACKGROUND_COLOR, + VIDEO_BACKGROUND_NONE, }; typedef struct RenderParams { _______________________________________________ ffmpeg-cvslog mailing list -- [email protected] To unsubscribe send an email to [email protected]
