fix: respect the user's max_width setting for the built-in video previewer#2560
fix: respect the user's max_width setting for the built-in video previewer#2560sxyazi merged 2 commits intosxyazi:mainfrom
max_width setting for the built-in video previewer#2560Conversation
|
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
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