Add setting to prioritise what audio codec to transcode to (#5434)
* Add setting to prioritise what audio codec to transcode to * Add comment * rename selectPreferredTranscodeAudio to preferredTranscodeAudio * Add review changes * Add review changes * Add reviewed fixes * Add help text. * Fix elint Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Change *AudioCodecInVideo to *VideoAudioCodec and move option to video advanced * Update src/components/playbackSettings/playbackSettings.template.html Co-authored-by: Dmitry Lyzo <56478732+dmitrylyzo@users.noreply.github.com> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Dmitry Lyzo <56478732+dmitrylyzo@users.noreply.github.com>
This commit is contained in:
@@ -70,6 +70,21 @@ function getDeviceProfile(item) {
|
||||
});
|
||||
}
|
||||
|
||||
const preferredTranscodeVideoAudioCodec = appSettings.preferredTranscodeVideoAudioCodec();
|
||||
if (preferredTranscodeVideoAudioCodec) {
|
||||
profile.TranscodingProfiles.forEach((transcodingProfile) => {
|
||||
if (transcodingProfile.Type === 'Video') {
|
||||
const audioCodecs = transcodingProfile.AudioCodec.split(',');
|
||||
const index = audioCodecs.indexOf(preferredTranscodeVideoAudioCodec);
|
||||
if (index !== -1) {
|
||||
audioCodecs.splice(index, 1);
|
||||
audioCodecs.unshift(preferredTranscodeVideoAudioCodec);
|
||||
transcodingProfile.AudioCodec = audioCodecs.join(',');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
resolve(profile);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user