mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Prevent opus more than 2 channels being remux on Safari
Safari only supports stereo Opus, which requires a similar workaround as we are applying on WebOS for FLAC.
This commit is contained in:
parent
92e8821003
commit
92caea08af
1 changed files with 43 additions and 0 deletions
|
@ -1028,6 +1028,49 @@ export default function (options) {
|
||||||
profile.TranscodingProfiles.push(...flacTranscodingProfiles);
|
profile.TranscodingProfiles.push(...flacTranscodingProfiles);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (safariSupportsOpus) {
|
||||||
|
const opusConditions = [
|
||||||
|
// Safari doesn't support opus with more than 2 channels
|
||||||
|
{
|
||||||
|
Condition: 'LessThanEqual',
|
||||||
|
Property: 'AudioChannels',
|
||||||
|
Value: '2',
|
||||||
|
IsRequired: false
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
profile.CodecProfiles.push({
|
||||||
|
Type: 'VideoAudio',
|
||||||
|
Codec: 'opus',
|
||||||
|
Conditions: opusConditions
|
||||||
|
});
|
||||||
|
|
||||||
|
const opusTranscodingProfiles = [];
|
||||||
|
|
||||||
|
// Split each video transcoding profile with opus so that the containing opus is only applied to 2 channels audio
|
||||||
|
profile.TranscodingProfiles.forEach(transcodingProfile => {
|
||||||
|
if (transcodingProfile.Type !== 'Video') return;
|
||||||
|
|
||||||
|
const audioCodecs = transcodingProfile.AudioCodec.split(',');
|
||||||
|
|
||||||
|
if (!audioCodecs.includes('opus')) return;
|
||||||
|
|
||||||
|
const opusTranscodingProfile = { ...transcodingProfile };
|
||||||
|
opusTranscodingProfile.AudioCodec = 'opus';
|
||||||
|
opusTranscodingProfile.MaxAudioChannels = '2';
|
||||||
|
opusTranscodingProfile.ApplyConditions = [
|
||||||
|
...opusTranscodingProfile.ApplyConditions || [],
|
||||||
|
...opusConditions
|
||||||
|
];
|
||||||
|
|
||||||
|
opusTranscodingProfiles.push(opusTranscodingProfile);
|
||||||
|
|
||||||
|
transcodingProfile.AudioCodec = audioCodecs.filter(codec => codec != 'opus').join(',');
|
||||||
|
});
|
||||||
|
|
||||||
|
profile.TranscodingProfiles.push(...opusTranscodingProfiles);
|
||||||
|
}
|
||||||
|
|
||||||
let maxH264Level = 42;
|
let maxH264Level = 42;
|
||||||
let h264Profiles = 'high|main|baseline|constrained baseline';
|
let h264Profiles = 'high|main|baseline|constrained baseline';
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue