mirror of
https://github.com/xuthus83/pigallery2.git
synced 2024-11-03 21:04:03 +08:00
14 lines
376 B
TypeScript
14 lines
376 B
TypeScript
|
export class FFmpegFactory {
|
||
|
public static get() {
|
||
|
const ffmpeg = require('fluent-ffmpeg');
|
||
|
try {
|
||
|
const ffmpegPath = require('@ffmpeg-installer/ffmpeg').path;
|
||
|
ffmpeg.setFfmpegPath(ffmpegPath);
|
||
|
const ffprobePath = require('@ffprobe-installer/ffprobe').path;
|
||
|
ffmpeg.setFfprobePath(ffprobePath);
|
||
|
} catch (e) {
|
||
|
}
|
||
|
return ffmpeg;
|
||
|
}
|
||
|
}
|