Skip to content

Commit 9a925be

Browse files
authored
Merge pull request #8 from buxuku/fix/ffmpeg
fix: Cannot find ffmpeg #6
2 parents 021a622 + 3a01ee3 commit 9a925be

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@
1212
"author": "buxuku",
1313
"license": "ISC",
1414
"dependencies": {
15+
"@ffmpeg-installer/ffmpeg": "^1.1.0",
1516
"@volcengine/openapi": "^1.14.0",
1617
"axios": "^1.6.2",
1718
"crypto": "^1.0.1",
1819
"dotenv": "^16.4.5",
1920
"fluent-ffmpeg": "^2.1.2"
2021
}
21-
}
22+
}

utils.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
import { spawn } from 'child_process';
22
import fs from 'fs';
33
import path from 'path';
4+
import ffmpegInstaller from '@ffmpeg-installer/ffmpeg';
45
import ffmpeg from 'fluent-ffmpeg';
56
import { translateConfig, videoDir, whisperModel } from './config.js';
67

8+
ffmpeg.setFfmpegPath(ffmpegInstaller.path);
9+
710
// 将字符串转成模板字符串
811
export const renderTemplate = (template, data) => {
912
const names = Object.keys(data);
@@ -89,4 +92,4 @@ export const installWhisper = async () => {
8992
console.log('正在编译 whisper.cpp');
9093
await runCommand('make', ['-C', './whisper.cpp']);
9194
}
92-
};
95+
};

0 commit comments

Comments
 (0)