mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
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:
parent
291d3099bb
commit
32fc33894d
5 changed files with 44 additions and 0 deletions
|
@ -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);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -182,6 +182,7 @@ function loadForm(context, user, userSettings, systemInfo, apiClient) {
|
|||
context.querySelector('.chkRememberSubtitleSelections').checked = user.Configuration.RememberSubtitleSelections || false;
|
||||
context.querySelector('.chkExternalVideoPlayer').checked = appSettings.enableSystemExternalPlayers();
|
||||
context.querySelector('.chkLimitSupportedVideoResolution').checked = appSettings.limitSupportedVideoResolution();
|
||||
context.querySelector('#selectPreferredTranscodeVideoAudioCodec').value = appSettings.preferredTranscodeVideoAudioCodec();
|
||||
|
||||
setMaxBitrateIntoField(context.querySelector('.selectVideoInNetworkQuality'), true, 'Video');
|
||||
setMaxBitrateIntoField(context.querySelector('.selectVideoInternetQuality'), false, 'Video');
|
||||
|
@ -217,6 +218,7 @@ function saveUser(context, user, userSettingsInstance, apiClient) {
|
|||
appSettings.maxChromecastBitrate(context.querySelector('.selectChromecastVideoQuality').value);
|
||||
appSettings.maxVideoWidth(context.querySelector('.selectMaxVideoWidth').value);
|
||||
appSettings.limitSupportedVideoResolution(context.querySelector('.chkLimitSupportedVideoResolution').checked);
|
||||
appSettings.preferredTranscodeVideoAudioCodec(context.querySelector('#selectPreferredTranscodeVideoAudioCodec').value);
|
||||
|
||||
appSettings.enableDts(context.querySelector('.chkEnableDts').checked);
|
||||
appSettings.enableTrueHd(context.querySelector('.chkEnableTrueHd').checked);
|
||||
|
|
|
@ -179,6 +179,19 @@
|
|||
</label>
|
||||
<div class="fieldDescription checkboxFieldDescription">${EnableTrueHdHelp}</div>
|
||||
</div>
|
||||
|
||||
<div class="selectContainer">
|
||||
<select is="emby-select" id="selectPreferredTranscodeVideoAudioCodec" label="${LabelSelectPreferredTranscodeVideoAudioCodec}">
|
||||
<option value="">${Auto}</option>
|
||||
<option value="aac">AAC</option>
|
||||
<option value="ac3">AC3</option>
|
||||
<option value="alac">ALAC</option>
|
||||
<option value="dts">DTS</option>
|
||||
<option value="flac">FLAC</option>
|
||||
<option value="opus">Opus</option>
|
||||
</select>
|
||||
<div class="fieldDescription">${SelectPreferredTranscodeVideoAudioCodecHelp}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button is="emby-button" type="submit" class="raised button-submit block btnSave hide">
|
||||
|
|
|
@ -132,6 +132,18 @@ class AppSettings {
|
|||
return toBoolean(this.get('limitSupportedVideoResolution'), false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get or set preferred transcode audio codec in video playback.
|
||||
* @param {string|undefined} val - Preferred transcode audio codec or undefined.
|
||||
* @return {string} Preferred transcode audio codec.
|
||||
*/
|
||||
preferredTranscodeVideoAudioCodec(val) {
|
||||
if (val !== undefined) {
|
||||
return this.set('preferredTranscodeVideoAudioCodec', val);
|
||||
}
|
||||
return this.get('preferredTranscodeVideoAudioCodec') || '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get or set 'Enable DTS' state.
|
||||
* @param {boolean|undefined} val - Flag to enable 'Enable DTS' or undefined.
|
||||
|
|
|
@ -566,6 +566,7 @@
|
|||
"LabelAudioCodec": "Audio codec",
|
||||
"LabelAudioLanguagePreference": "Preferred audio language",
|
||||
"LabelSelectAudioNormalization": "Audio Normalization",
|
||||
"LabelSelectPreferredTranscodeVideoAudioCodec": "Preferred transcode audio codec in video playback",
|
||||
"LabelAudioSampleRate": "Audio sample rate",
|
||||
"LabelAuthProvider": "Authentication Provider",
|
||||
"LabelAutomaticallyAddToCollection": "Automatically add to collection",
|
||||
|
@ -1390,6 +1391,7 @@
|
|||
"Season": "Season",
|
||||
"SecondarySubtitles": "Secondary Subtitles",
|
||||
"SelectAdminUsername": "Please select a username for the admin account.",
|
||||
"SelectPreferredTranscodeVideoAudioCodecHelp": "Select the preferred audio codec to transcode to for video content. If the preferred codec is not supported, the server will use the next best available codec.",
|
||||
"SelectServer": "Select Server",
|
||||
"SendMessage": "Send message",
|
||||
"Series": "Series",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue