返回 AiToEarn
index.ts
1 /*
2 * @Author: nevin
3 * @Date: 2025-02-14 16:36:05
4 * @LastEditTime: 2025-02-23 20:07:52
5 * @LastEditors: nevin
6 * @Description: ffmpeg工具
7 */
8 import ffmpeg from 'fluent-ffmpeg';
9 import ffmpegPath from '@ffmpeg-installer/ffmpeg';
10 import ffprobePath from '@ffprobe-installer/ffprobe';
11
12 ffmpeg.setFfmpegPath(ffmpegPath.path.replace('app.asar', 'app.asar.unpacked'));
13 ffmpeg.setFfprobePath(
14 ffprobePath.path.replace('app.asar', 'app.asar.unpacked'),
15 );
16 export default class FFmpeg {
17 ffmpeg: ffmpeg.FfmpegCommand;
18
19 constructor(inputPath: string) {
20 this.ffmpeg = ffmpeg(inputPath);
21 }
22 }
23
23 lines TYPESCRIPT