experiment: added threads to ffmpeg args

This commit is contained in:
wukko 2023-05-13 18:04:43 +06:00
parent df73b8c860
commit 64987c6494

View file

@ -38,6 +38,7 @@ export function streamLiveRender(streamInfo, res) {
let format = streamInfo.filename.split('.')[streamInfo.filename.split('.').length - 1], args = [ let format = streamInfo.filename.split('.')[streamInfo.filename.split('.').length - 1], args = [
'-loglevel', '-8', '-loglevel', '-8',
'-threads', `${process.env.ffmpegThreads ? process.env.ffmpegThreads : '0'}`,
'-i', streamInfo.urls[0], '-i', streamInfo.urls[0],
'-i', 'pipe:3', '-i', 'pipe:3',
'-map', '0:v', '-map', '0:v',
@ -95,6 +96,7 @@ export function streamAudioOnly(streamInfo, res) {
try { try {
let args = [ let args = [
'-loglevel', '-8', '-loglevel', '-8',
'-threads', `${process.env.ffmpegThreads ? process.env.ffmpegThreads : '0'}`,
'-i', streamInfo.urls '-i', streamInfo.urls
] ]
if (streamInfo.metadata) { if (streamInfo.metadata) {
@ -141,6 +143,7 @@ export function streamVideoOnly(streamInfo, res) {
try { try {
let format = streamInfo.filename.split('.')[streamInfo.filename.split('.').length - 1], args = [ let format = streamInfo.filename.split('.')[streamInfo.filename.split('.').length - 1], args = [
'-loglevel', '-8', '-loglevel', '-8',
'-threads', `${process.env.ffmpegThreads ? process.env.ffmpegThreads : '0'}`,
'-i', streamInfo.urls, '-i', streamInfo.urls,
'-c', 'copy' '-c', 'copy'
] ]