1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Add specialized video transcoding profile with FLAC for webOS

webOS doesn't seem to support FLAC with more than 2 channels.
Split each video transcoding profile with FLAC so that the
containing FLAC is only applied to 2 channels audio.
This commit is contained in:
Dmitry Lyzo 2024-05-15 02:56:37 +03:00 committed by Dmitry Lyzo
parent 1342bedad0
commit fb87dfbf5e

View file

@ -899,6 +899,30 @@ export default function (options) {
Codec: 'flac',
Conditions: flacConditions
});
const flacTranscodingProfiles = [];
// Split each video transcoding profile with FLAC so that the containing FLAC is only applied to 2 channels audio
profile.TranscodingProfiles.forEach(transcodingProfile => {
if (transcodingProfile.Type !== 'Video') return;
const audioCodecs = transcodingProfile.AudioCodec.split(',');
if (!audioCodecs.includes('flac')) return;
const flacTranscodingProfile = { ...transcodingProfile };
flacTranscodingProfile.AudioCodec = 'flac';
flacTranscodingProfile.ApplyConditions = [
...flacTranscodingProfile.ApplyConditions || [],
...flacConditions
];
flacTranscodingProfiles.push(flacTranscodingProfile);
transcodingProfile.AudioCodec = audioCodecs.filter(codec => codec != 'flac').join(',');
});
profile.TranscodingProfiles.push(...flacTranscodingProfiles);
}
let maxH264Level = 42;