From b91c0c0013d3c7664e4e1d74d9bb79f2bf77ad8b Mon Sep 17 00:00:00 2001 From: wukko Date: Thu, 19 Jun 2025 17:19:39 +0600 Subject: [PATCH] api/stream/types: specify subtitle format for containers other than mp4 --- api/src/stream/types.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/api/src/stream/types.js b/api/src/stream/types.js index 1af8459f..d1b86da5 100644 --- a/api/src/stream/types.js +++ b/api/src/stream/types.js @@ -128,7 +128,8 @@ const merge = async (streamInfo, res) => { if (streamInfo.subtitles) { args.push( '-i', streamInfo.subtitles, - '-map', '2:s' + '-map', '2:s', + '-c:s', format === 'mp4' ? 'mov_text' : 'webvtt' ); }; @@ -147,10 +148,6 @@ const merge = async (streamInfo, res) => { } } - if (streamInfo.subtitles && format === "mp4") { - args.push('-c:s', 'mov_text'); - } - if (streamInfo.metadata) { args = args.concat(convertMetadataToFFmpeg(streamInfo.metadata)); }