Skip to content

best way to save what you love

stream: add support for remuxing multiple m3u8 files

wukko08c7aa1ce11b
diff --git a/src/modules/processing/matchActionDecider.js b/src/modules/processing/matchActionDecider.js
index f7ed3da9..74f0f8c7 100644
--- a/src/modules/processing/matchActionDecider.js
+++ b/src/modules/processing/matchActionDecider.js
@@ -24,7 +24,7 @@ export default function(r, host, userFormat, isAudioOnly, lang, isAudioMuted, di
else if (r.isGif && toGif) action = "gif";
else if (isAudioMuted) action = "muteVideo";
else if (isAudioOnly) action = "audio";
- else if (r.isM3U8) action = "singleM3U8";
+ else if (r.isM3U8) action = "m3u8";
else action = "video";
if (action === "picker" || action === "audio") {
@@ -48,13 +48,19 @@ export default function(r, host, userFormat, isAudioOnly, lang, isAudioMuted, di
params = { type: "gif" }
break;
- case "singleM3U8":
- params = { type: "remux" }
+ case "m3u8":
+ params = {
+ type: Array.isArray(r.urls) ? "render" : "remux"
+ }
break;
case "muteVideo":
+ let muteType = "mute";
+ if (Array.isArray(r.urls) && !r.isM3U8) {
+ muteType = "bridge";
+ }
params = {
- type: Array.isArray(r.urls) ? "bridge" : "mute",
+ type: muteType,
u: Array.isArray(r.urls) ? r.urls[0] : r.urls,
mute: true
}
diff --git a/src/modules/stream/types.js b/src/modules/stream/types.js
index 000b7f7f..af4aa2e5 100644
--- a/src/modules/stream/types.js
+++ b/src/modules/stream/types.js
@@ -92,6 +92,10 @@ export function streamLiveRender(streamInfo, res) {
args = args.concat(ffmpegArgs[format]);
+ if (hlsExceptions.includes(streamInfo.service)) {
+ args.push('-bsf:a', 'aac_adtstoasc')
+ }
+
if (streamInfo.metadata) {
args = args.concat(metadataManager(streamInfo.metadata))
}