修复FFPROBE依赖
This commit is contained in:
12
server.js
12
server.js
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user