Skip to content

feat(local): add options to use ffmpeg to generate thumbnail #8629

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Muione
Copy link
Contributor

@Muione Muione commented Jun 4, 2025

在local存储下添加了两个选项:

  • use_ffmpeg:是否使用ffmpeg生成图片和视频略缩图,启用时使用ffmpeg,否则使用imaging库生成略缩图(视频略缩图必须要安装ffmpeg)
  • thumb_pixel:生成略缩图的像素宽度(根据图片比例自动计算高度),这个选项可以自定义生成略缩图的尺寸

link: https://github.com/AlistGo/alist/issues/8628

Copy link

Walkthrough

此PR在本地存储中增加了两个选项:use_ffmpegthumb_pixeluse_ffmpeg 选项允许用户选择使用ffmpeg生成图片和视频缩略图,而不是使用imaging库。thumb_pixel 选项允许用户自定义生成缩略图的像素宽度。此更改旨在提高缩略图生成的灵活性和性能。

Changes

文件 摘要
drivers/local/driver.go 添加了 thumbPixeluseFFmpeg 字段,并在配置中初始化这些字段。
drivers/local/meta.go Addition 结构中添加了 UseFFmpegThumbPixel 字段。
drivers/local/util.go 实现了 resizeImageToBufferWithFFmpegGogenerateThumbnailWithImagingOptimized 函数,用于生成缩略图。修改了 GetSnapshot 函数以支持新选项。

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.

2 participants