diff --git a/public/index.html b/public/index.html index 6c3c968..9b82324 100644 --- a/public/index.html +++ b/public/index.html @@ -66,6 +66,7 @@ 硬件编码器: Software + NEON NVIDIA Intel VAAPI diff --git a/server.js b/server.js index 55ded6a..ea8af31 100644 --- a/server.js +++ b/server.js @@ -94,7 +94,7 @@ const broadcastWs = (key, payload) => { const createFfmpegOptions = (encoderName) => { const options = ['-preset fast']; if (encoderName === 'libx264' || encoderName === 'libx265') { - options.push('-crf', '23'); + options.push('-crf', '23', '-threads', '0'); } else if (/_nvenc$/.test(encoderName)) { options.push('-rc:v', 'vbr_hq', '-cq', '19'); } else if (/_qsv$/.test(encoderName)) { @@ -252,9 +252,10 @@ app.post('/api/transcode', async (req, res) => { } const safeCodec = codec === 'h265' ? 'h265' : 'h264'; - const safeEncoder = ['nvidia', 'intel', 'vaapi'].includes(encoder) ? encoder : 'software'; + const safeEncoder = ['nvidia', 'intel', 'vaapi', 'neon'].includes(encoder) ? encoder : 'software'; const codecMap = { software: { h264: 'libx264', h265: 'libx265' }, + neon: { h264: 'libx264', h265: 'libx265' }, nvidia: { h264: 'h264_nvenc', h265: 'hevc_nvenc' }, intel: { h264: 'h264_qsv', h265: 'hevc_qsv' }, vaapi: { h264: 'h264_vaapi', h265: 'hevc_vaapi' }