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

Merge pull request #5625 from FintasticMan/add_prefer_transcode_video

Add setting for preferred video codec
This commit is contained in:
Bill Thornton 2024-07-15 16:14:51 -04:00 committed by GitHub
commit e0be16b272
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 41 additions and 0 deletions

View file

@ -70,6 +70,21 @@ function getDeviceProfile(item) {
});
}
const preferredTranscodeVideoCodec = appSettings.preferredTranscodeVideoCodec();
if (preferredTranscodeVideoCodec) {
profile.TranscodingProfiles.forEach((transcodingProfile) => {
if (transcodingProfile.Type === 'Video') {
const videoCodecs = transcodingProfile.VideoCodec.split(',');
const index = videoCodecs.indexOf(preferredTranscodeVideoCodec);
if (index !== -1) {
videoCodecs.splice(index, 1);
videoCodecs.unshift(preferredTranscodeVideoCodec);
transcodingProfile.VideoCodec = videoCodecs.join(',');
}
}
});
}
const preferredTranscodeVideoAudioCodec = appSettings.preferredTranscodeVideoAudioCodec();
if (preferredTranscodeVideoAudioCodec) {
profile.TranscodingProfiles.forEach((transcodingProfile) => {