使用NPM的ffmpeg

This commit is contained in:
CN-JS-HuiBai
2026-04-03 01:40:59 +08:00
parent 7581d33112
commit 056763e51d
2 changed files with 6 additions and 0 deletions

View File

@@ -13,6 +13,7 @@
"cors": "^2.8.5",
"dotenv": "^16.4.5",
"express": "^4.19.2",
"ffmpeg-static": "^5.2.0",
"fluent-ffmpeg": "^2.1.3",
"ws": "^8.13.0"
}

View File

@@ -6,10 +6,15 @@ const path = require('path');
const http = require('http');
const WebSocket = require('ws');
const ffmpeg = require('fluent-ffmpeg');
const ffmpegStatic = require('ffmpeg-static');
const { S3Client, ListBucketsCommand, ListObjectsV2Command, GetObjectCommand } = require('@aws-sdk/client-s3');
dotenv.config();
if (ffmpegStatic) {
ffmpeg.setFfmpegPath(ffmpegStatic);
}
const app = express();
const PORT = process.env.PORT || 3000;
const HOST = process.env.HOST || process.env.LISTEN_ADDRESS || '0.0.0.0';