Skip to content

best way to save what you love

api/stream/types/merge: encode audio to aac or opus if hls

wukkof610058b8264
diff --git a/api/src/stream/types.js b/api/src/stream/types.js
index 2a1b9677..6fbe314e 100644
--- a/api/src/stream/types.js
+++ b/api/src/stream/types.js
@@ -102,7 +102,11 @@ const merge = (streamInfo, res) => {
args = args.concat(ffmpegArgs[format]);
if (hlsExceptions.includes(streamInfo.service) && streamInfo.isHLS) {
- args.push('-bsf:a', 'aac_adtstoasc')
+ if (streamInfo.service === "youtube" && format === "webm") {
+ args.push('-c:a', 'libopus');
+ } else {
+ args.push('-c:a', 'aac', '-bsf:a', 'aac_adtstoasc');
+ }
}
if (streamInfo.metadata) {