mirror of
https://github.com/YILS-LIN/short-video-factory.git
synced 2025-11-25 03:15:03 +08:00
完善 MAC 嵌入 ffmpeg 支持,优化构建配置
This commit is contained in:
5
.vscode/settings.json
vendored
5
.vscode/settings.json
vendored
@@ -5,5 +5,8 @@
|
||||
},
|
||||
"css.customData": [
|
||||
".vscode/unocss.json"
|
||||
]
|
||||
],
|
||||
"[jsonc]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,7 @@
|
||||
target: [
|
||||
{
|
||||
target: 'dmg',
|
||||
arch: ['universal'],
|
||||
arch: ['arm64', 'x64'],
|
||||
},
|
||||
],
|
||||
artifactName: '${name}-${version}-mac-${arch}-installer.${ext}',
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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: [],
|
||||
|
||||
Reference in New Issue
Block a user