Skip to content

vd_lavc: add --hwdec-decode-images#17906

Open
guidocella wants to merge 2 commits into
mpv-player:masterfrom
guidocella:hwdec-image
Open

vd_lavc: add --hwdec-decode-images#17906
guidocella wants to merge 2 commits into
mpv-player:masterfrom
guidocella:hwdec-image

Conversation

@guidocella
Copy link
Copy Markdown
Contributor

@guidocella guidocella commented May 11, 2026

demux: move image from from sh_stream to mp_codec_params

Will be needed in the next commit to check whether a stream is an image from vd_lavc.c.

vd_lavc: add --hwdec-decode-images

Allows skipping hardware decoding for images, defaulting to no.

Requested in #14062, #17838 (comment), and needed to display tile grid heif and avif images (#17738 (comment)).

@kasper93
Copy link
Copy Markdown
Member

I think users can do it with autoprofile.

@guidocella
Copy link
Copy Markdown
Contributor Author

autoprofiles don't work, they are evaluated too late.

@llyyr
Copy link
Copy Markdown
Contributor

llyyr commented May 11, 2026

needed to display tile grid heif and avif images

In what way is this needed? mpv simply falls back to swdec if hwdec isn't possible because of a cpu filter

@kasper93
Copy link
Copy Markdown
Member

needed to display tile grid heif and avif images

In what way is this needed? mpv simply falls back to swdec if hwdec isn't possible because of a cpu filter

How does this work? Is there PR for this functionality?

@guidocella
Copy link
Copy Markdown
Contributor Author

guidocella commented May 12, 2026

In what way is this needed? mpv simply falls back to swdec if hwdec isn't possible because of a cpu filter

It just hangs with vaapi. With nvdec it fallsback for me only because I get CUDA_ERROR_OUT_OF_MEMORY. d3d11 also doesn't fallback according to #17738 (comment).

Will be needed in the next commit to check whether a stream is an image
from vd_lavc.c.
Comment thread video/decode/vd_lavc.c Outdated
Comment on lines +540 to +543
} else if (ctx->codec->image && !ctx->hwdec_opts->hwdec_decode_images) {
MP_VERBOSE(vd, "Not trying to use hardware decoding: source is an "
"image.\n");
break;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be the second condition, so we print this message instead of the codec or force_swdec one

Allows skipping hardware decoding for images, defaulting to no.

Requested in mpv-player#14062 and
mpv-player#17838 (comment).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants