-
Notifications
You must be signed in to change notification settings - Fork 658
fix: respect the user's max_width setting for the built-in video previewer
#2560
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Thanks for the PR! Could you provide some benchmarks to see how this change affects performance — separately when the video size is under |
|
Sure. Video resolution 320x180, softwareBefore After Video resolution 320x180, vaapiBefore After Video resolution 1920x1080, softwareBefore After Video resolution 1920x1080, vaapiBefore After With this PR, thumbnails of videos smaller than |
a9c693e to
86f4659
Compare
|
This one won't upscale https://superuser.com/a/794924 |
|
Here is another variant: "-vf", string.format("scale='min(%d,iw)':'min(%d,ih)':force_original_aspect_ratio=decrease:flags=fast_bilinear", rt.preview.max_width , rt.preview.max_height),But the question remains, upscale or not? Both approaches have their pros and cons. Or maybe give the users a switch and let them decide. The performance difference is small. 2160p vaapi
180p vaapi
|
Feels like the right call. |
|
Thanks for the benchmarks, it's really helpful! I decided to use |
preview.max_width for video thumbnailsmax_width setting for the built-in video previewer
sxyazi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Currently, Yazi only scales thumbnails to
preview.max_height, which means that thumbnails of videos in landscape orientation are unnecessarily large.Example:
Before
File size: 131 kB

Image size: 1600x900
On the left is a preview in Yazi, and on the right is a generated thumbnail.
After
File size: 28 kB

Image size: 600x338