修复FFPROBE依赖

This commit is contained in:
CN-JS-HuiBai
2026-04-03 01:52:03 +08:00
parent 056763e51d
commit 517814610d
4 changed files with 18 additions and 4 deletions

View File

@@ -7,12 +7,20 @@ const http = require('http');
const WebSocket = require('ws');
const ffmpeg = require('fluent-ffmpeg');
const ffmpegStatic = require('ffmpeg-static');
const ffprobeStatic = require('ffprobe-static');
const { S3Client, ListBucketsCommand, ListObjectsV2Command, GetObjectCommand } = require('@aws-sdk/client-s3');
dotenv.config();
if (ffmpegStatic) {
ffmpeg.setFfmpegPath(ffmpegStatic);
const configuredFfmpegPath = process.env.FFMPEG_PATH || ffmpegStatic;
const configuredFfprobePath = process.env.FFPROBE_PATH || ffprobeStatic.path;
if (configuredFfmpegPath) {
ffmpeg.setFfmpegPath(configuredFfmpegPath);
}
if (configuredFfprobePath) {
ffmpeg.setFfprobePath(configuredFfprobePath);
}
const app = express();