feat(v1.4.0): 视频功能 — 目录导入+MP4徽标时长角标+单击弹窗播放+右键视频编辑(加/去水印,加/去字幕声音)+多选图片AI一键生成视频(标题+KEY+音色+画幅,分镜-朗读-字幕-拼接入库)

This commit is contained in:
jinghui committed 2026-11-18 11:59:02 +08:00
1 parent 94ac94436c
commit 5965d33aca
15 files changed
+1501 -14

No files matched your search

+21
View File
@@ -317,6 +317,27 @@ async function getImageMetadata(imagePath) {
}
}
// 视频文件:ffprobe 提取真实宽高与时长(供卡片时长角标与播放预览)
if (fileType === 'video') {
try {
const videotool = require('./videotool');
const info = await videotool.probeVideo(imagePath);
if (info.width && info.height) {
return {
width: info.width,
height: info.height,
format: path.extname(imagePath).slice(1).toLowerCase(),
size: stats.size,
created_at: stats.birthtimeMs,
modified_at: stats.mtimeMs,
duration: info.duration || 0
};
}
} catch (_) {
// ffprobe 缺失或文件损坏 → 走占位信息
}
}
// 对于非图片文件或 Sharp 失败的情况,返回基础信息
const ext = path.extname(imagePath).toLowerCase().slice(1);
return {