mirror of
https://github.com/YILS-LIN/short-video-factory.git
synced 2025-11-25 03:15:03 +08:00
Compare commits
9 Commits
240c0bce72
...
f86ed53ccc
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f86ed53ccc | ||
|
|
56600b3353 | ||
|
|
1cedfae6a7 | ||
|
|
b35c4420f2 | ||
|
|
3768010b60 | ||
|
|
7002e0a153 | ||
|
|
5bf62a7c71 | ||
|
|
42c94a56f8 | ||
|
|
7097a95d78 |
6
.github/workflows/build.yml
vendored
6
.github/workflows/build.yml
vendored
@@ -32,11 +32,7 @@ jobs:
|
||||
if: matrix.os == 'macos-latest'
|
||||
run: |
|
||||
export ELECTRON_BUILDER_EXTRA_ARGS="--universal"
|
||||
npm rebuild --arch=x64 -f ffmpeg-static && mv node_modules/ffmpeg-static/ffmpeg{,-x64}
|
||||
npm rebuild --arch=arm64 -f ffmpeg-static && mv node_modules/ffmpeg-static/ffmpeg{,-arm64}
|
||||
cd node_modules/ffmpeg-static
|
||||
lipo -create ffmpeg-arm64 ffmpeg-x64 -output ffmpeg
|
||||
cd ../..
|
||||
pnpm run lipo-ffmpeg
|
||||
pnpm run build
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
@@ -2,17 +2,19 @@
|
||||
All significant changes to this project will be recorded in this file.
|
||||
此项目的所有显著更改都将记录在此文件中。
|
||||
|
||||
## [v1.1.3] - 2025-10-22
|
||||
## [v1.1.10] - 2025-10-22
|
||||
### Added
|
||||
- Add MAC embedding FFmpeg support
|
||||
### Fixed
|
||||
- Resolve the error of not setting BGM folder
|
||||
- Resolve the issue of reporting errors when there are non mp3 files in the BGM folder
|
||||
- Remove the restriction that the total duration of video materials should not be shorter than that of voice
|
||||
- Optimize some details
|
||||
### 添加
|
||||
- 增加MAC嵌入FFmpeg支持
|
||||
### 修复
|
||||
- 解决不设置bgm文件夹报错
|
||||
- 解决 BGM 文件夹存在非 mp3 文件时报错问题
|
||||
- 移除视频素材总时长不的短于语音的限制
|
||||
- 优化一些细节
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "short-video-factory",
|
||||
"description": "短视频工厂,一键生成产品营销与泛内容短视频,AI批量自动剪辑",
|
||||
"version": "1.1.3",
|
||||
"version": "1.1.10",
|
||||
"author": {
|
||||
"name": "YILS",
|
||||
"developer": "YILS",
|
||||
@@ -16,7 +16,8 @@
|
||||
"preview": "vite preview",
|
||||
"format": "prettier --write .",
|
||||
"preinstall": "npx only-allow pnpm",
|
||||
"postinstall": "node scripts/post-install.js"
|
||||
"postinstall": "node scripts/post-install.js",
|
||||
"lipo-ffmpeg":"node scripts/lipo-ffmpeg.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"axios": "^1.11.0",
|
||||
|
||||
48
scripts/lipo-ffmpeg.js
Normal file
48
scripts/lipo-ffmpeg.js
Normal file
@@ -0,0 +1,48 @@
|
||||
#!/usr/bin/env node
|
||||
/**
|
||||
* 1. 设置环境变量 FFMPEG_BINARIES_URL
|
||||
* 2. 分别 rebuild x64 / arm64 两个架构
|
||||
* 3. 用 lipo 合并为通用二进制
|
||||
*/
|
||||
const { execSync } = require('child_process')
|
||||
const path = require('path')
|
||||
|
||||
// 1. 环境变量
|
||||
const FFMPEG_BINARIES_URL = process.env['npm_config_ffmpeg_binaries_url']
|
||||
|
||||
// 2. 工具函数:执行命令并带彩色输出
|
||||
function run(cmd, opts = {}) {
|
||||
console.log(`\n→ ${cmd}`)
|
||||
try {
|
||||
execSync(cmd, { stdio: 'inherit', shell: true, ...opts })
|
||||
} catch (e) {
|
||||
console.error(`❌ 命令失败: ${cmd}`)
|
||||
process.exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
// 3. 开始干活
|
||||
const archs = ['x64', 'arm64']
|
||||
const ffmpegStaticDir = path.join(__dirname, '..', 'node_modules', 'ffmpeg-static')
|
||||
|
||||
// 移除原来的二进制文件
|
||||
run('rm -f ffmpeg', { cwd: ffmpegStaticDir })
|
||||
|
||||
// 获取两种架构的二进制文件
|
||||
archs.forEach((arch) => {
|
||||
run(
|
||||
`pnpm cross-env FFMPEG_BINARIES_URL=${FFMPEG_BINARIES_URL} npm_config_arch=${arch} npm run install`,
|
||||
{
|
||||
cwd: ffmpegStaticDir,
|
||||
},
|
||||
)
|
||||
run(`mv ${ffmpegStaticDir}/ffmpeg ${ffmpegStaticDir}/ffmpeg-${arch}`)
|
||||
})
|
||||
|
||||
// 合并
|
||||
run('lipo -create ffmpeg-arm64 ffmpeg-x64 -output ffmpeg', { cwd: ffmpegStaticDir })
|
||||
|
||||
// 赋权
|
||||
run('chmod 0755 ffmpeg', { cwd: ffmpegStaticDir })
|
||||
|
||||
console.log('\n✅ 通用 ffmpeg 已生成:', path.join(ffmpegStaticDir, 'ffmpeg'))
|
||||
@@ -66,9 +66,9 @@ const handleRenderVideo = async () => {
|
||||
let randomBgm: ListFilesFromFolderRecord | undefined = undefined
|
||||
if (appStore.renderConfig.bgmPath) {
|
||||
try {
|
||||
const bgmList = await window.electron.listFilesFromFolder({
|
||||
const bgmList = (await window.electron.listFilesFromFolder({
|
||||
folderPath: appStore.renderConfig.bgmPath.replace(/\\/g, '/'),
|
||||
})
|
||||
})).filter((asset) => asset.name.endsWith('.mp3'))
|
||||
if (bgmList.length > 0) {
|
||||
randomBgm = random.choice(bgmList)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user