stream: add support for remuxing multiple m3u8 files

This commit is contained in:
wukko 2024-06-23 22:13:36 +06:00
parent 33c3c398fc
commit 08c7aa1ce1
No known key found for this signature in database
GPG key ID: 3E30B3F26C7B4AA2
2 changed files with 14 additions and 4 deletions

View file

@ -24,7 +24,7 @@ export default function(r, host, userFormat, isAudioOnly, lang, isAudioMuted, di
else if (r.isGif && toGif) action = "gif"; else if (r.isGif && toGif) action = "gif";
else if (isAudioMuted) action = "muteVideo"; else if (isAudioMuted) action = "muteVideo";
else if (isAudioOnly) action = "audio"; else if (isAudioOnly) action = "audio";
else if (r.isM3U8) action = "singleM3U8"; else if (r.isM3U8) action = "m3u8";
else action = "video"; else action = "video";
if (action === "picker" || action === "audio") { if (action === "picker" || action === "audio") {
@ -48,13 +48,19 @@ export default function(r, host, userFormat, isAudioOnly, lang, isAudioMuted, di
params = { type: "gif" } params = { type: "gif" }
break; break;
case "singleM3U8": case "m3u8":
params = { type: "remux" } params = {
type: Array.isArray(r.urls) ? "render" : "remux"
}
break; break;
case "muteVideo": case "muteVideo":
let muteType = "mute";
if (Array.isArray(r.urls) && !r.isM3U8) {
muteType = "bridge";
}
params = { params = {
type: Array.isArray(r.urls) ? "bridge" : "mute", type: muteType,
u: Array.isArray(r.urls) ? r.urls[0] : r.urls, u: Array.isArray(r.urls) ? r.urls[0] : r.urls,
mute: true mute: true
} }

View file

@ -92,6 +92,10 @@ export function streamLiveRender(streamInfo, res) {
args = args.concat(ffmpegArgs[format]); args = args.concat(ffmpegArgs[format]);
if (hlsExceptions.includes(streamInfo.service)) {
args.push('-bsf:a', 'aac_adtstoasc')
}
if (streamInfo.metadata) { if (streamInfo.metadata) {
args = args.concat(metadataManager(streamInfo.metadata)) args = args.concat(metadataManager(streamInfo.metadata))
} }