使用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

@@ -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';