Skip to content

Conversation

@llyyr
Copy link
Contributor

@llyyr llyyr commented Jan 21, 2026

Set to 360 by default. Only attempt to use hardware accelerated video decoding if the video height is more than 360. This is taken from Chromium*, basically using CPU decoding should be more efficient if the video resolution is this small.

@llyyr llyyr force-pushed the add-hwdec-min-height branch from bfc9c9e to 1b538dc Compare January 21, 2026 15:33
@sfan5
Copy link
Member

sfan5 commented Jan 21, 2026

should probably be max(width, height) to account for portrait videos

@CounterPillow
Copy link
Contributor

Hot take: make it min-area. For a 16:9 video that's 360p, that'd be 230400 pixels. It's less ergonomic for users but means aspect ratio does not matter.

@llyyr llyyr force-pushed the add-hwdec-min-height branch from 1b538dc to 2c043a4 Compare January 21, 2026 16:53
Set to 360 by default. Only attempt to use hardware accelerated video
decoding if the video size in either dimension is more than 360. This is
taken from Chromium*, basically using CPU decoding should be more
efficient if the video resolution is this small.

* https://github.com/chromium/chromium/blob/a2575bd8b31fb964352efd9cab974ef72db6fe55/media/filters/decoder_selector.cc#L49-L63
@llyyr llyyr force-pushed the add-hwdec-min-height branch from 2c043a4 to a1ad6f6 Compare January 21, 2026 16:58
@llyyr
Copy link
Contributor Author

llyyr commented Jan 21, 2026

Changed this to look at size in either dimension

@kasper93
Copy link
Member

Hot take: make it min-area. For a 16:9 video that's 360p, that'd be 230400 pixels. It's less ergonomic for users but means aspect ratio does not matter.

Probably makes sense.

Set to 360 by default.

While I understand the idea, the 360p limit makes this feature really niche and overall complication and "why hwdec doesn't work for AAAxBBB questions". While I agree that technically it may be correct, the web browsers have higher stake here, because they are more likely to show some random ad or animated image, that doesn't make sense to spin hwdec. mpv is rather explicit in usage, and not like you open some small videos by accident. Also for 2h 360p movie likely the hwdec init overhead is compensated by the length of the content.

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.

4 participants