api/stream/types: specify subtitle format for containers other than mp4

This commit is contained in:
wukko 2025-06-19 17:19:39 +06:00
parent 259a0758f1
commit b91c0c0013
No known key found for this signature in database
GPG Key ID: 3E30B3F26C7B4AA2

View File

@ -128,7 +128,8 @@ const merge = async (streamInfo, res) => {
if (streamInfo.subtitles) { if (streamInfo.subtitles) {
args.push( args.push(
'-i', streamInfo.subtitles, '-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) { if (streamInfo.metadata) {
args = args.concat(convertMetadataToFFmpeg(streamInfo.metadata)); args = args.concat(convertMetadataToFFmpeg(streamInfo.metadata));
} }