完善 MAC 嵌入 ffmpeg 支持,优化构建配置

This commit is contained in:
YILS
2025-10-21 21:50:15 +08:00
parent cd68ba810a
commit ff94d9679c
4 changed files with 19 additions and 9 deletions

View File

@@ -5,5 +5,8 @@
},
"css.customData": [
".vscode/unocss.json"
]
],
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}

View File

@@ -14,7 +14,7 @@
target: [
{
target: 'dmg',
arch: ['universal'],
arch: ['arm64', 'x64'],
},
],
artifactName: '${name}-${version}-mac-${arch}-installer.${ext}',

View File

@@ -8,11 +8,10 @@ import { generateUniqueFileName } from '../lib/tools'
const VITE_DEV_SERVER_URL = process.env['VITE_DEV_SERVER_URL']
const isWindows = process.platform === 'win32'
const ffmpegPath: string = isWindows
? VITE_DEV_SERVER_URL
? require('ffmpeg-static')
: (require('ffmpeg-static') as string).replace('app.asar', 'app.asar.unpacked')
: 'ffmpeg'
const ffmpegPath: string = VITE_DEV_SERVER_URL
? require('ffmpeg-static')
: (require('ffmpeg-static') as string).replace('app.asar', 'app.asar.unpacked')
// async function test() {
// try {

View File

@@ -130,11 +130,19 @@ refreshAssets()
// 获取视频分镜随机素材片段
const videoInfoList = ref<VideoInfo[]>([])
const getVideoSegments = (options: { duration: number }) => {
// 判断素材库是否满足时长要求
if (videoInfoList.value.reduce((pre, cur) => pre + cur.duration, 0) < options.duration) {
// 视频资源总时长
const videeAssetsTotalDuration = videoInfoList.value.reduce((pre, cur) => pre + cur.duration, 0)
// 判断素材库视频时长是否过短
if (videeAssetsTotalDuration < 1) {
throw new Error(t('errors.assetsDurationInsufficient'))
}
// 判断素材库是否满足TTS时长要求
// if (videeAssetsTotalDuration < options.duration) {
// throw new Error(t('errors.assetsDurationInsufficient'))
// }
// 搜集随机素材片段
const segments: Pick<RenderVideoParams, 'videoFiles' | 'timeRanges'> = {
videoFiles: [],