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

Merge pull request #1662 from dmitrylyzo/fix-ios-transcode

Add h264 codec profile for TS container

(cherry picked from commit 58198df5ce)
Signed-off-by: Joshua M. Boniface <joshua@boniface.me>
This commit is contained in:
Anthony Lavado 2020-07-27 13:09:39 -07:00 committed by Joshua M. Boniface
parent 027cb4f744
commit 5c9847468f

View file

@ -714,10 +714,7 @@ define(['browser'], function (browser) {
} }
} }
profile.CodecProfiles.push({ const h264CodecProfileConditions = [
Type: 'Video',
Codec: 'h264',
Conditions: [
{ {
Condition: 'NotEquals', Condition: 'NotEquals',
Property: 'IsAnamorphic', Property: 'IsAnamorphic',
@ -736,11 +733,10 @@ define(['browser'], function (browser) {
Value: maxH264Level.toString(), Value: maxH264Level.toString(),
IsRequired: false IsRequired: false
} }
] ];
});
if (!browser.edgeUwp && !browser.tizen && !browser.web0s) { if (!browser.edgeUwp && !browser.tizen && !browser.web0s) {
profile.CodecProfiles[profile.CodecProfiles.length - 1].Conditions.push({ h264CodecProfileConditions.push({
Condition: 'NotEquals', Condition: 'NotEquals',
Property: 'IsInterlaced', Property: 'IsInterlaced',
Value: 'true', Value: 'true',
@ -749,7 +745,7 @@ define(['browser'], function (browser) {
} }
if (maxVideoWidth) { if (maxVideoWidth) {
profile.CodecProfiles[profile.CodecProfiles.length - 1].Conditions.push({ h264CodecProfileConditions.push({
Condition: 'LessThanEqual', Condition: 'LessThanEqual',
Property: 'Width', Property: 'Width',
Value: maxVideoWidth.toString(), Value: maxVideoWidth.toString(),
@ -762,7 +758,7 @@ define(['browser'], function (browser) {
var h264MaxVideoBitrate = globalMaxVideoBitrate; var h264MaxVideoBitrate = globalMaxVideoBitrate;
if (h264MaxVideoBitrate) { if (h264MaxVideoBitrate) {
profile.CodecProfiles[profile.CodecProfiles.length - 1].Conditions.push({ h264CodecProfileConditions.push({
Condition: 'LessThanEqual', Condition: 'LessThanEqual',
Property: 'VideoBitrate', Property: 'VideoBitrate',
Value: h264MaxVideoBitrate, Value: h264MaxVideoBitrate,
@ -770,6 +766,33 @@ define(['browser'], function (browser) {
}); });
} }
// On iOS 12.x, for TS container max h264 level is 4.2
if (browser.iOS && browser.iOSVersion < 13) {
const codecProfile = {
Type: 'Video',
Codec: 'h264',
Container: 'ts',
Conditions: h264CodecProfileConditions.filter((condition) => {
return condition.Property !== 'VideoLevel';
})
};
codecProfile.Conditions.push({
Condition: 'LessThanEqual',
Property: 'VideoLevel',
Value: '42',
IsRequired: false
});
profile.CodecProfiles.push(codecProfile);
}
profile.CodecProfiles.push({
Type: 'Video',
Codec: 'h264',
Conditions: h264CodecProfileConditions
});
var globalVideoConditions = []; var globalVideoConditions = [];
if (globalMaxVideoBitrate) { if (globalMaxVideoBitrate) {