mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Add setting for preferred video codec
This commit is contained in:
parent
ef6bbc8212
commit
b234888485
5 changed files with 42 additions and 0 deletions
|
@ -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();
|
const preferredTranscodeVideoAudioCodec = appSettings.preferredTranscodeVideoAudioCodec();
|
||||||
if (preferredTranscodeVideoAudioCodec) {
|
if (preferredTranscodeVideoAudioCodec) {
|
||||||
profile.TranscodingProfiles.forEach((transcodingProfile) => {
|
profile.TranscodingProfiles.forEach((transcodingProfile) => {
|
||||||
|
|
|
@ -182,6 +182,7 @@ function loadForm(context, user, userSettings, systemInfo, apiClient) {
|
||||||
context.querySelector('.chkRememberSubtitleSelections').checked = user.Configuration.RememberSubtitleSelections || false;
|
context.querySelector('.chkRememberSubtitleSelections').checked = user.Configuration.RememberSubtitleSelections || false;
|
||||||
context.querySelector('.chkExternalVideoPlayer').checked = appSettings.enableSystemExternalPlayers();
|
context.querySelector('.chkExternalVideoPlayer').checked = appSettings.enableSystemExternalPlayers();
|
||||||
context.querySelector('.chkLimitSupportedVideoResolution').checked = appSettings.limitSupportedVideoResolution();
|
context.querySelector('.chkLimitSupportedVideoResolution').checked = appSettings.limitSupportedVideoResolution();
|
||||||
|
context.querySelector('#selectPreferredTranscodeVideoCodec').value = appSettings.preferredTranscodeVideoCodec();
|
||||||
context.querySelector('#selectPreferredTranscodeVideoAudioCodec').value = appSettings.preferredTranscodeVideoAudioCodec();
|
context.querySelector('#selectPreferredTranscodeVideoAudioCodec').value = appSettings.preferredTranscodeVideoAudioCodec();
|
||||||
|
|
||||||
setMaxBitrateIntoField(context.querySelector('.selectVideoInNetworkQuality'), true, 'Video');
|
setMaxBitrateIntoField(context.querySelector('.selectVideoInNetworkQuality'), true, 'Video');
|
||||||
|
@ -218,6 +219,7 @@ function saveUser(context, user, userSettingsInstance, apiClient) {
|
||||||
appSettings.maxChromecastBitrate(context.querySelector('.selectChromecastVideoQuality').value);
|
appSettings.maxChromecastBitrate(context.querySelector('.selectChromecastVideoQuality').value);
|
||||||
appSettings.maxVideoWidth(context.querySelector('.selectMaxVideoWidth').value);
|
appSettings.maxVideoWidth(context.querySelector('.selectMaxVideoWidth').value);
|
||||||
appSettings.limitSupportedVideoResolution(context.querySelector('.chkLimitSupportedVideoResolution').checked);
|
appSettings.limitSupportedVideoResolution(context.querySelector('.chkLimitSupportedVideoResolution').checked);
|
||||||
|
appSettings.preferredTranscodeVideoCodec(context.querySelector('#selectPreferredTranscodeVideoCodec').value);
|
||||||
appSettings.preferredTranscodeVideoAudioCodec(context.querySelector('#selectPreferredTranscodeVideoAudioCodec').value);
|
appSettings.preferredTranscodeVideoAudioCodec(context.querySelector('#selectPreferredTranscodeVideoAudioCodec').value);
|
||||||
|
|
||||||
appSettings.enableDts(context.querySelector('.chkEnableDts').checked);
|
appSettings.enableDts(context.querySelector('.chkEnableDts').checked);
|
||||||
|
|
|
@ -180,6 +180,17 @@
|
||||||
<div class="fieldDescription checkboxFieldDescription">${EnableTrueHdHelp}</div>
|
<div class="fieldDescription checkboxFieldDescription">${EnableTrueHdHelp}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="selectContainer">
|
||||||
|
<select is="emby-select" id="selectPreferredTranscodeVideoCodec" label="${LabelSelectPreferredTranscodeVideoCodec}">
|
||||||
|
<option value="">${Auto}</option>
|
||||||
|
<option value="h264">H264</option>
|
||||||
|
<option value="hevc">HEVC</option>
|
||||||
|
<option value="av1">AV1</option>
|
||||||
|
<option value="vp9">VP9</option>
|
||||||
|
</select>
|
||||||
|
<div class="fieldDescription">${SelectPreferredTranscodeVideoCodecHelp}</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="selectContainer">
|
<div class="selectContainer">
|
||||||
<select is="emby-select" id="selectPreferredTranscodeVideoAudioCodec" label="${LabelSelectPreferredTranscodeVideoAudioCodec}">
|
<select is="emby-select" id="selectPreferredTranscodeVideoAudioCodec" label="${LabelSelectPreferredTranscodeVideoAudioCodec}">
|
||||||
<option value="">${Auto}</option>
|
<option value="">${Auto}</option>
|
||||||
|
|
|
@ -132,6 +132,18 @@ class AppSettings {
|
||||||
return toBoolean(this.get('limitSupportedVideoResolution'), false);
|
return toBoolean(this.get('limitSupportedVideoResolution'), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get or set preferred transcode video codec.
|
||||||
|
* @param {string|undefined} val - Preferred transcode video codec or undefined.
|
||||||
|
* @return {string} Preferred transcode video codec.
|
||||||
|
*/
|
||||||
|
preferredTranscodeVideoCodec(val) {
|
||||||
|
if (val !== undefined) {
|
||||||
|
return this.set('preferredTranscodeVideoCodec', val);
|
||||||
|
}
|
||||||
|
return this.get('preferredTranscodeVideoCodec') || '';
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get or set preferred transcode audio codec in video playback.
|
* Get or set preferred transcode audio codec in video playback.
|
||||||
* @param {string|undefined} val - Preferred transcode audio codec or undefined.
|
* @param {string|undefined} val - Preferred transcode audio codec or undefined.
|
||||||
|
|
|
@ -946,6 +946,7 @@
|
||||||
"LabelVideoCodec": "Video codec",
|
"LabelVideoCodec": "Video codec",
|
||||||
"LabelVideoRange": "Video range",
|
"LabelVideoRange": "Video range",
|
||||||
"LabelVideoResolution": "Video resolution",
|
"LabelVideoResolution": "Video resolution",
|
||||||
|
"LabelSelectPreferredTranscodeVideoCodec": "Preferred transcode video codec",
|
||||||
"LabelWeb": "Web",
|
"LabelWeb": "Web",
|
||||||
"LabelWebVersion": "Web version",
|
"LabelWebVersion": "Web version",
|
||||||
"LabelYear": "Year",
|
"LabelYear": "Year",
|
||||||
|
@ -1391,6 +1392,7 @@
|
||||||
"Season": "Season",
|
"Season": "Season",
|
||||||
"SecondarySubtitles": "Secondary Subtitles",
|
"SecondarySubtitles": "Secondary Subtitles",
|
||||||
"SelectAdminUsername": "Please select a username for the admin account.",
|
"SelectAdminUsername": "Please select a username for the admin account.",
|
||||||
|
"SelectPreferredTranscodeVideoCodecHelp": "Select the preferred video codec to transcode to. If the preferred codec is not supported, the server will use the next best available codec.",
|
||||||
"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.",
|
"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",
|
"SelectServer": "Select Server",
|
||||||
"SendMessage": "Send message",
|
"SendMessage": "Send message",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue