aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRigel Kent <sendmemail@rigelk.eu>2020-12-24 18:02:04 +0100
committerChocobozzz <chocobozzz@cpy.re>2021-01-13 09:14:09 +0100
commitb7085c713220c9c5a96c9bb77330c2ba6ae9274e (patch)
treea2cefbd1742d5f2ba48f76759f3450171dc224f8
parent7185dab3ff509cec9f03a15d826625b5a1bd0ada (diff)
downloadPeerTube-b7085c713220c9c5a96c9bb77330c2ba6ae9274e.tar.gz
PeerTube-b7085c713220c9c5a96c9bb77330c2ba6ae9274e.tar.zst
PeerTube-b7085c713220c9c5a96c9bb77330c2ba6ae9274e.zip
add support for 1440p (Quad HD/QHD/WQHD) videos
-rw-r--r--client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts4
-rw-r--r--config/default.yaml2
-rw-r--r--config/production.yaml.example2
-rw-r--r--config/test.yaml2
-rw-r--r--server/controllers/api/config.ts2
-rw-r--r--server/helpers/ffprobe-utils.ts1
-rw-r--r--server/initializers/checker-before-init.ts5
-rw-r--r--server/initializers/config.ts2
-rw-r--r--server/middlewares/validators/config.ts2
-rw-r--r--server/tests/api/check-params/config.ts2
-rw-r--r--server/tests/api/live/live-constraints.ts1
-rw-r--r--server/tests/api/live/live-permanent.ts2
-rw-r--r--server/tests/api/live/live-save-replay.ts1
-rw-r--r--server/tests/api/server/config.ts4
-rw-r--r--server/tests/api/server/stats.ts1
-rw-r--r--server/tests/api/videos/audio-only.ts1
-rw-r--r--server/tests/api/videos/video-hls.ts1
-rw-r--r--server/tests/cli/create-transcoding-job.ts1
-rw-r--r--shared/extra-utils/server/config.ts2
-rw-r--r--shared/models/server/custom-config.model.ts1
-rw-r--r--shared/models/videos/video-resolution.enum.ts9
-rw-r--r--support/doc/api/openapi.yaml4
-rw-r--r--support/docker/production/config/custom-environment-variables.yaml3
23 files changed, 51 insertions, 4 deletions
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts
index f74229af0..330ab075a 100644
--- a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts
+++ b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts
@@ -82,6 +82,10 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit, A
82 label: $localize`1080p` 82 label: $localize`1080p`
83 }, 83 },
84 { 84 {
85 id: '1440p',
86 label: $localize`1440p`
87 },
88 {
85 id: '2160p', 89 id: '2160p',
86 label: $localize`2160p` 90 label: $localize`2160p`
87 } 91 }
diff --git a/config/default.yaml b/config/default.yaml
index b68a96f51..d2c713b52 100644
--- a/config/default.yaml
+++ b/config/default.yaml
@@ -227,6 +227,7 @@ transcoding:
227 480p: false 227 480p: false
228 720p: false 228 720p: false
229 1080p: false 229 1080p: false
230 1440p: false
230 2160p: false 231 2160p: false
231 232
232 # Generate videos in a WebTorrent format (what we do since the first PeerTube release) 233 # Generate videos in a WebTorrent format (what we do since the first PeerTube release)
@@ -280,6 +281,7 @@ live:
280 480p: false 281 480p: false
281 720p: false 282 720p: false
282 1080p: false 283 1080p: false
284 1440p: false
283 2160p: false 285 2160p: false
284 286
285import: 287import:
diff --git a/config/production.yaml.example b/config/production.yaml.example
index 91eecbd67..4506ce259 100644
--- a/config/production.yaml.example
+++ b/config/production.yaml.example
@@ -240,6 +240,7 @@ transcoding:
240 480p: false 240 480p: false
241 720p: false 241 720p: false
242 1080p: false 242 1080p: false
243 1440p: false
243 2160p: false 244 2160p: false
244 245
245 # Generate videos in a WebTorrent format (what we do since the first PeerTube release) 246 # Generate videos in a WebTorrent format (what we do since the first PeerTube release)
@@ -293,6 +294,7 @@ live:
293 480p: false 294 480p: false
294 720p: false 295 720p: false
295 1080p: false 296 1080p: false
297 1440p: false
296 2160p: false 298 2160p: false
297 299
298import: 300import:
diff --git a/config/test.yaml b/config/test.yaml
index a8a724255..3e0346d64 100644
--- a/config/test.yaml
+++ b/config/test.yaml
@@ -78,6 +78,7 @@ transcoding:
78 480p: true 78 480p: true
79 720p: true 79 720p: true
80 1080p: true 80 1080p: true
81 1440p: true
81 2160p: true 82 2160p: true
82 hls: 83 hls:
83 enabled: true 84 enabled: true
@@ -98,6 +99,7 @@ live:
98 480p: false 99 480p: false
99 720p: false 100 720p: false
100 1080p: false 101 1080p: false
102 1440p: false
101 2160p: false 103 2160p: false
102 104
103import: 105import:
diff --git a/server/controllers/api/config.ts b/server/controllers/api/config.ts
index 2401e2ff4..8bc3123bf 100644
--- a/server/controllers/api/config.ts
+++ b/server/controllers/api/config.ts
@@ -423,6 +423,7 @@ function customConfig (): CustomConfig {
423 '480p': CONFIG.TRANSCODING.RESOLUTIONS['480p'], 423 '480p': CONFIG.TRANSCODING.RESOLUTIONS['480p'],
424 '720p': CONFIG.TRANSCODING.RESOLUTIONS['720p'], 424 '720p': CONFIG.TRANSCODING.RESOLUTIONS['720p'],
425 '1080p': CONFIG.TRANSCODING.RESOLUTIONS['1080p'], 425 '1080p': CONFIG.TRANSCODING.RESOLUTIONS['1080p'],
426 '1440p': CONFIG.TRANSCODING.RESOLUTIONS['1440p'],
426 '2160p': CONFIG.TRANSCODING.RESOLUTIONS['2160p'] 427 '2160p': CONFIG.TRANSCODING.RESOLUTIONS['2160p']
427 }, 428 },
428 webtorrent: { 429 webtorrent: {
@@ -447,6 +448,7 @@ function customConfig (): CustomConfig {
447 '480p': CONFIG.LIVE.TRANSCODING.RESOLUTIONS['480p'], 448 '480p': CONFIG.LIVE.TRANSCODING.RESOLUTIONS['480p'],
448 '720p': CONFIG.LIVE.TRANSCODING.RESOLUTIONS['720p'], 449 '720p': CONFIG.LIVE.TRANSCODING.RESOLUTIONS['720p'],
449 '1080p': CONFIG.LIVE.TRANSCODING.RESOLUTIONS['1080p'], 450 '1080p': CONFIG.LIVE.TRANSCODING.RESOLUTIONS['1080p'],
451 '1440p': CONFIG.LIVE.TRANSCODING.RESOLUTIONS['1440p'],
450 '2160p': CONFIG.LIVE.TRANSCODING.RESOLUTIONS['2160p'] 452 '2160p': CONFIG.LIVE.TRANSCODING.RESOLUTIONS['2160p']
451 } 453 }
452 } 454 }
diff --git a/server/helpers/ffprobe-utils.ts b/server/helpers/ffprobe-utils.ts
index 4dea6283c..adb459ed3 100644
--- a/server/helpers/ffprobe-utils.ts
+++ b/server/helpers/ffprobe-utils.ts
@@ -188,6 +188,7 @@ function computeResolutionsToTranscode (videoFileResolution: number, type: 'vod'
188 VideoResolution.H_720P, 188 VideoResolution.H_720P,
189 VideoResolution.H_240P, 189 VideoResolution.H_240P,
190 VideoResolution.H_1080P, 190 VideoResolution.H_1080P,
191 VideoResolution.H_1440P,
191 VideoResolution.H_4K 192 VideoResolution.H_4K
192 ] 193 ]
193 194
diff --git a/server/initializers/checker-before-init.ts b/server/initializers/checker-before-init.ts
index 765ef157e..7945e8586 100644
--- a/server/initializers/checker-before-init.ts
+++ b/server/initializers/checker-before-init.ts
@@ -23,7 +23,7 @@ function checkMissedConfig () {
23 'redundancy.videos.strategies', 'redundancy.videos.check_interval', 23 'redundancy.videos.strategies', 'redundancy.videos.check_interval',
24 'transcoding.enabled', 'transcoding.threads', 'transcoding.allow_additional_extensions', 'transcoding.hls.enabled', 24 'transcoding.enabled', 'transcoding.threads', 'transcoding.allow_additional_extensions', 'transcoding.hls.enabled',
25 'transcoding.resolutions.0p', 'transcoding.resolutions.240p', 'transcoding.resolutions.360p', 'transcoding.resolutions.480p', 25 'transcoding.resolutions.0p', 'transcoding.resolutions.240p', 'transcoding.resolutions.360p', 'transcoding.resolutions.480p',
26 'transcoding.resolutions.720p', 'transcoding.resolutions.1080p', 'transcoding.resolutions.2160p', 26 'transcoding.resolutions.720p', 'transcoding.resolutions.1080p', 'transcoding.resolutions.1440p', 'transcoding.resolutions.2160p',
27 'import.videos.http.enabled', 'import.videos.torrent.enabled', 'auto_blacklist.videos.of_users.enabled', 27 'import.videos.http.enabled', 'import.videos.torrent.enabled', 'auto_blacklist.videos.of_users.enabled',
28 'trending.videos.interval_days', 28 'trending.videos.interval_days',
29 'instance.name', 'instance.short_description', 'instance.description', 'instance.terms', 'instance.default_client_route', 29 'instance.name', 'instance.short_description', 'instance.description', 'instance.terms', 'instance.default_client_route',
@@ -41,7 +41,8 @@ function checkMissedConfig () {
41 'live.enabled', 'live.allow_replay', 'live.max_duration', 'live.max_user_lives', 'live.max_instance_lives', 41 'live.enabled', 'live.allow_replay', 'live.max_duration', 'live.max_user_lives', 'live.max_instance_lives',
42 'live.transcoding.enabled', 'live.transcoding.threads', 42 'live.transcoding.enabled', 'live.transcoding.threads',
43 'live.transcoding.resolutions.240p', 'live.transcoding.resolutions.360p', 'live.transcoding.resolutions.480p', 43 'live.transcoding.resolutions.240p', 'live.transcoding.resolutions.360p', 'live.transcoding.resolutions.480p',
44 'live.transcoding.resolutions.720p', 'live.transcoding.resolutions.1080p', 'live.transcoding.resolutions.2160p' 44 'live.transcoding.resolutions.720p', 'live.transcoding.resolutions.1080p', 'live.transcoding.resolutions.1440p',
45 'live.transcoding.resolutions.2160p'
45 ] 46 ]
46 47
47 const requiredAlternatives = [ 48 const requiredAlternatives = [
diff --git a/server/initializers/config.ts b/server/initializers/config.ts
index 705223b0a..0f58dc1d4 100644
--- a/server/initializers/config.ts
+++ b/server/initializers/config.ts
@@ -189,6 +189,7 @@ const CONFIG = {
189 get '480p' () { return config.get<boolean>('transcoding.resolutions.480p') }, 189 get '480p' () { return config.get<boolean>('transcoding.resolutions.480p') },
190 get '720p' () { return config.get<boolean>('transcoding.resolutions.720p') }, 190 get '720p' () { return config.get<boolean>('transcoding.resolutions.720p') },
191 get '1080p' () { return config.get<boolean>('transcoding.resolutions.1080p') }, 191 get '1080p' () { return config.get<boolean>('transcoding.resolutions.1080p') },
192 get '1440p' () { return config.get<boolean>('transcoding.resolutions.1440p') },
192 get '2160p' () { return config.get<boolean>('transcoding.resolutions.2160p') } 193 get '2160p' () { return config.get<boolean>('transcoding.resolutions.2160p') }
193 }, 194 },
194 HLS: { 195 HLS: {
@@ -221,6 +222,7 @@ const CONFIG = {
221 get '480p' () { return config.get<boolean>('live.transcoding.resolutions.480p') }, 222 get '480p' () { return config.get<boolean>('live.transcoding.resolutions.480p') },
222 get '720p' () { return config.get<boolean>('live.transcoding.resolutions.720p') }, 223 get '720p' () { return config.get<boolean>('live.transcoding.resolutions.720p') },
223 get '1080p' () { return config.get<boolean>('live.transcoding.resolutions.1080p') }, 224 get '1080p' () { return config.get<boolean>('live.transcoding.resolutions.1080p') },
225 get '1440p' () { return config.get<boolean>('live.transcoding.resolutions.1440p') },
224 get '2160p' () { return config.get<boolean>('live.transcoding.resolutions.2160p') } 226 get '2160p' () { return config.get<boolean>('live.transcoding.resolutions.2160p') }
225 } 227 }
226 } 228 }
diff --git a/server/middlewares/validators/config.ts b/server/middlewares/validators/config.ts
index 9c1cfa7e7..faabf17d7 100644
--- a/server/middlewares/validators/config.ts
+++ b/server/middlewares/validators/config.ts
@@ -45,6 +45,7 @@ const customConfigUpdateValidator = [
45 body('transcoding.resolutions.480p').isBoolean().withMessage('Should have a valid transcoding 480p resolution enabled boolean'), 45 body('transcoding.resolutions.480p').isBoolean().withMessage('Should have a valid transcoding 480p resolution enabled boolean'),
46 body('transcoding.resolutions.720p').isBoolean().withMessage('Should have a valid transcoding 720p resolution enabled boolean'), 46 body('transcoding.resolutions.720p').isBoolean().withMessage('Should have a valid transcoding 720p resolution enabled boolean'),
47 body('transcoding.resolutions.1080p').isBoolean().withMessage('Should have a valid transcoding 1080p resolution enabled boolean'), 47 body('transcoding.resolutions.1080p').isBoolean().withMessage('Should have a valid transcoding 1080p resolution enabled boolean'),
48 body('transcoding.resolutions.1440p').isBoolean().withMessage('Should have a valid transcoding 1440p resolution enabled boolean'),
48 body('transcoding.resolutions.2160p').isBoolean().withMessage('Should have a valid transcoding 2160p resolution enabled boolean'), 49 body('transcoding.resolutions.2160p').isBoolean().withMessage('Should have a valid transcoding 2160p resolution enabled boolean'),
49 50
50 body('transcoding.webtorrent.enabled').isBoolean().withMessage('Should have a valid webtorrent transcoding enabled boolean'), 51 body('transcoding.webtorrent.enabled').isBoolean().withMessage('Should have a valid webtorrent transcoding enabled boolean'),
@@ -75,6 +76,7 @@ const customConfigUpdateValidator = [
75 body('live.transcoding.resolutions.480p').isBoolean().withMessage('Should have a valid transcoding 480p resolution enabled boolean'), 76 body('live.transcoding.resolutions.480p').isBoolean().withMessage('Should have a valid transcoding 480p resolution enabled boolean'),
76 body('live.transcoding.resolutions.720p').isBoolean().withMessage('Should have a valid transcoding 720p resolution enabled boolean'), 77 body('live.transcoding.resolutions.720p').isBoolean().withMessage('Should have a valid transcoding 720p resolution enabled boolean'),
77 body('live.transcoding.resolutions.1080p').isBoolean().withMessage('Should have a valid transcoding 1080p resolution enabled boolean'), 78 body('live.transcoding.resolutions.1080p').isBoolean().withMessage('Should have a valid transcoding 1080p resolution enabled boolean'),
79 body('live.transcoding.resolutions.1440p').isBoolean().withMessage('Should have a valid transcoding 1440p resolution enabled boolean'),
78 body('live.transcoding.resolutions.2160p').isBoolean().withMessage('Should have a valid transcoding 2160p resolution enabled boolean'), 80 body('live.transcoding.resolutions.2160p').isBoolean().withMessage('Should have a valid transcoding 2160p resolution enabled boolean'),
79 81
80 body('search.remoteUri.users').isBoolean().withMessage('Should have a remote URI search for users boolean'), 82 body('search.remoteUri.users').isBoolean().withMessage('Should have a remote URI search for users boolean'),
diff --git a/server/tests/api/check-params/config.ts b/server/tests/api/check-params/config.ts
index fab440fc5..e36cdeab2 100644
--- a/server/tests/api/check-params/config.ts
+++ b/server/tests/api/check-params/config.ts
@@ -92,6 +92,7 @@ describe('Test config API validators', function () {
92 '480p': true, 92 '480p': true,
93 '720p': false, 93 '720p': false,
94 '1080p': false, 94 '1080p': false,
95 '1440p': false,
95 '2160p': false 96 '2160p': false
96 }, 97 },
97 webtorrent: { 98 webtorrent: {
@@ -118,6 +119,7 @@ describe('Test config API validators', function () {
118 '480p': true, 119 '480p': true,
119 '720p': true, 120 '720p': true,
120 '1080p': true, 121 '1080p': true,
122 '1440p': true,
121 '2160p': true 123 '2160p': true
122 } 124 }
123 } 125 }
diff --git a/server/tests/api/live/live-constraints.ts b/server/tests/api/live/live-constraints.ts
index 257673b66..1c60a7c76 100644
--- a/server/tests/api/live/live-constraints.ts
+++ b/server/tests/api/live/live-constraints.ts
@@ -179,6 +179,7 @@ describe('Test live constraints', function () {
179 '480p': true, 179 '480p': true,
180 '720p': true, 180 '720p': true,
181 '1080p': true, 181 '1080p': true,
182 '1440p': true,
182 '2160p': true 183 '2160p': true
183 } 184 }
184 } 185 }
diff --git a/server/tests/api/live/live-permanent.ts b/server/tests/api/live/live-permanent.ts
index 1128e993c..a5bda009f 100644
--- a/server/tests/api/live/live-permanent.ts
+++ b/server/tests/api/live/live-permanent.ts
@@ -75,6 +75,7 @@ describe('Permenant live', function () {
75 '480p': true, 75 '480p': true,
76 '720p': true, 76 '720p': true,
77 '1080p': true, 77 '1080p': true,
78 '1440p': true,
78 '2160p': true 79 '2160p': true
79 } 80 }
80 } 81 }
@@ -164,6 +165,7 @@ describe('Permenant live', function () {
164 '480p': false, 165 '480p': false,
165 '720p': false, 166 '720p': false,
166 '1080p': false, 167 '1080p': false,
168 '1440p': false,
167 '2160p': false 169 '2160p': false
168 } 170 }
169 } 171 }
diff --git a/server/tests/api/live/live-save-replay.ts b/server/tests/api/live/live-save-replay.ts
index 35fe4e7bd..757e11845 100644
--- a/server/tests/api/live/live-save-replay.ts
+++ b/server/tests/api/live/live-save-replay.ts
@@ -99,6 +99,7 @@ describe('Save replay setting', function () {
99 '480p': true, 99 '480p': true,
100 '720p': true, 100 '720p': true,
101 '1080p': true, 101 '1080p': true,
102 '1440p': true,
102 '2160p': true 103 '2160p': true
103 } 104 }
104 } 105 }
diff --git a/server/tests/api/server/config.ts b/server/tests/api/server/config.ts
index bfaad3688..af25f4800 100644
--- a/server/tests/api/server/config.ts
+++ b/server/tests/api/server/config.ts
@@ -75,6 +75,7 @@ function checkInitialConfig (server: ServerInfo, data: CustomConfig) {
75 expect(data.transcoding.resolutions['480p']).to.be.true 75 expect(data.transcoding.resolutions['480p']).to.be.true
76 expect(data.transcoding.resolutions['720p']).to.be.true 76 expect(data.transcoding.resolutions['720p']).to.be.true
77 expect(data.transcoding.resolutions['1080p']).to.be.true 77 expect(data.transcoding.resolutions['1080p']).to.be.true
78 expect(data.transcoding.resolutions['1440p']).to.be.true
78 expect(data.transcoding.resolutions['2160p']).to.be.true 79 expect(data.transcoding.resolutions['2160p']).to.be.true
79 expect(data.transcoding.webtorrent.enabled).to.be.true 80 expect(data.transcoding.webtorrent.enabled).to.be.true
80 expect(data.transcoding.hls.enabled).to.be.true 81 expect(data.transcoding.hls.enabled).to.be.true
@@ -91,6 +92,7 @@ function checkInitialConfig (server: ServerInfo, data: CustomConfig) {
91 expect(data.live.transcoding.resolutions['480p']).to.be.false 92 expect(data.live.transcoding.resolutions['480p']).to.be.false
92 expect(data.live.transcoding.resolutions['720p']).to.be.false 93 expect(data.live.transcoding.resolutions['720p']).to.be.false
93 expect(data.live.transcoding.resolutions['1080p']).to.be.false 94 expect(data.live.transcoding.resolutions['1080p']).to.be.false
95 expect(data.live.transcoding.resolutions['1440p']).to.be.false
94 expect(data.live.transcoding.resolutions['2160p']).to.be.false 96 expect(data.live.transcoding.resolutions['2160p']).to.be.false
95 97
96 expect(data.import.videos.http.enabled).to.be.true 98 expect(data.import.videos.http.enabled).to.be.true
@@ -322,6 +324,7 @@ describe('Test config', function () {
322 '480p': true, 324 '480p': true,
323 '720p': false, 325 '720p': false,
324 '1080p': false, 326 '1080p': false,
327 '1440p': false,
325 '2160p': false 328 '2160p': false
326 }, 329 },
327 webtorrent: { 330 webtorrent: {
@@ -346,6 +349,7 @@ describe('Test config', function () {
346 '480p': true, 349 '480p': true,
347 '720p': true, 350 '720p': true,
348 '1080p': true, 351 '1080p': true,
352 '1440p': true,
349 '2160p': true 353 '2160p': true
350 } 354 }
351 } 355 }
diff --git a/server/tests/api/server/stats.ts b/server/tests/api/server/stats.ts
index 6fbf32186..82065e770 100644
--- a/server/tests/api/server/stats.ts
+++ b/server/tests/api/server/stats.ts
@@ -153,6 +153,7 @@ describe('Test stats (excluding redundancy)', function () {
153 '480p': false, 153 '480p': false,
154 '720p': false, 154 '720p': false,
155 '1080p': false, 155 '1080p': false,
156 '1440p': false,
156 '2160p': false 157 '2160p': false
157 } 158 }
158 } 159 }
diff --git a/server/tests/api/videos/audio-only.ts b/server/tests/api/videos/audio-only.ts
index 294a00112..7ddbd5cd9 100644
--- a/server/tests/api/videos/audio-only.ts
+++ b/server/tests/api/videos/audio-only.ts
@@ -36,6 +36,7 @@ describe('Test audio only video transcoding', function () {
36 '480p': false, 36 '480p': false,
37 '720p': false, 37 '720p': false,
38 '1080p': false, 38 '1080p': false,
39 '1440p': false,
39 '2160p': false 40 '2160p': false
40 }, 41 },
41 hls: { 42 hls: {
diff --git a/server/tests/api/videos/video-hls.ts b/server/tests/api/videos/video-hls.ts
index f3dbbb114..d1720d0d9 100644
--- a/server/tests/api/videos/video-hls.ts
+++ b/server/tests/api/videos/video-hls.ts
@@ -202,6 +202,7 @@ describe('Test HLS videos', function () {
202 '480p': true, 202 '480p': true,
203 '720p': true, 203 '720p': true,
204 '1080p': true, 204 '1080p': true,
205 '1440p': true,
205 '2160p': true 206 '2160p': true
206 }, 207 },
207 hls: { 208 hls: {
diff --git a/server/tests/cli/create-transcoding-job.ts b/server/tests/cli/create-transcoding-job.ts
index 997a9a1fd..5bc1687cd 100644
--- a/server/tests/cli/create-transcoding-job.ts
+++ b/server/tests/cli/create-transcoding-job.ts
@@ -33,6 +33,7 @@ describe('Test create transcoding jobs', function () {
33 '480p': true, 33 '480p': true,
34 '720p': true, 34 '720p': true,
35 '1080p': true, 35 '1080p': true,
36 '1440p': true,
36 '2160p': true 37 '2160p': true
37 }, 38 },
38 hls: { 39 hls: {
diff --git a/shared/extra-utils/server/config.ts b/shared/extra-utils/server/config.ts
index 8702659c4..f7c488c0b 100644
--- a/shared/extra-utils/server/config.ts
+++ b/shared/extra-utils/server/config.ts
@@ -117,6 +117,7 @@ function updateCustomSubConfig (url: string, token: string, newConfig: DeepParti
117 '480p': true, 117 '480p': true,
118 '720p': false, 118 '720p': false,
119 '1080p': false, 119 '1080p': false,
120 '1440p': false,
120 '2160p': false 121 '2160p': false
121 }, 122 },
122 webtorrent: { 123 webtorrent: {
@@ -141,6 +142,7 @@ function updateCustomSubConfig (url: string, token: string, newConfig: DeepParti
141 '480p': true, 142 '480p': true,
142 '720p': true, 143 '720p': true,
143 '1080p': true, 144 '1080p': true,
145 '1440p': true,
144 '2160p': true 146 '2160p': true
145 } 147 }
146 } 148 }
diff --git a/shared/models/server/custom-config.model.ts b/shared/models/server/custom-config.model.ts
index 67e05e23f..9a6a24923 100644
--- a/shared/models/server/custom-config.model.ts
+++ b/shared/models/server/custom-config.model.ts
@@ -7,6 +7,7 @@ export type ConfigResolutions = {
7 '480p': boolean 7 '480p': boolean
8 '720p': boolean 8 '720p': boolean
9 '1080p': boolean 9 '1080p': boolean
10 '1440p': boolean
10 '2160p': boolean 11 '2160p': boolean
11} 12}
12 13
diff --git a/shared/models/videos/video-resolution.enum.ts b/shared/models/videos/video-resolution.enum.ts
index dcd55dad8..a5d2ac7fa 100644
--- a/shared/models/videos/video-resolution.enum.ts
+++ b/shared/models/videos/video-resolution.enum.ts
@@ -7,6 +7,7 @@ export const enum VideoResolution {
7 H_480P = 480, 7 H_480P = 480,
8 H_720P = 720, 8 H_720P = 720,
9 H_1080P = 1080, 9 H_1080P = 1080,
10 H_1440P = 1440,
10 H_4K = 2160 11 H_4K = 2160
11} 12}
12 13
@@ -53,9 +54,15 @@ function getBaseBitrate (resolution: number) {
53 return 5200 * 1000 54 return 5200 * 1000
54 } 55 }
55 56
57 if (resolution <= VideoResolution.H_1440P) {
58 // quality according to Google Live Encoder: 6000 - 13000 Kbps
59 // Quality according to YouTube Video Info: 8600 (av01) - 17000 (vp9.2) Kbps
60 return 10_000 * 1000
61 }
62
56 // 4K 63 // 4K
57 // quality according to Google Live Encoder: 13000 - 34000 Kbps 64 // quality according to Google Live Encoder: 13000 - 34000 Kbps
58 return 22000 * 1000 65 return 22_000 * 1000
59} 66}
60 67
61/** 68/**
diff --git a/support/doc/api/openapi.yaml b/support/doc/api/openapi.yaml
index 74b2dee28..fe4552ff7 100644
--- a/support/doc/api/openapi.yaml
+++ b/support/doc/api/openapi.yaml
@@ -3941,7 +3941,7 @@ components:
3941 properties: 3941 properties:
3942 id: 3942 id:
3943 type: integer 3943 type: integer
3944 description: 'Video resolution (240, 360, 720 ...)' 3944 description: 'Video resolution (240, 360, 720, 1080, 1440 or 2160)'
3945 example: 240 3945 example: 240
3946 label: 3946 label:
3947 type: string 3947 type: string
@@ -4829,6 +4829,8 @@ components:
4829 type: boolean 4829 type: boolean
4830 1080p: 4830 1080p:
4831 type: boolean 4831 type: boolean
4832 1440p:
4833 type: boolean
4832 2160p: 4834 2160p:
4833 type: boolean 4835 type: boolean
4834 hls: 4836 hls:
diff --git a/support/docker/production/config/custom-environment-variables.yaml b/support/docker/production/config/custom-environment-variables.yaml
index c4c627551..954c3714b 100644
--- a/support/docker/production/config/custom-environment-variables.yaml
+++ b/support/docker/production/config/custom-environment-variables.yaml
@@ -106,6 +106,9 @@ transcoding:
106 1080p: 106 1080p:
107 __name: "PEERTUBE_TRANSCODING_1080P" 107 __name: "PEERTUBE_TRANSCODING_1080P"
108 __format: "json" 108 __format: "json"
109 1440p:
110 __name: "PEERTUBE_TRANSCODING_1440P"
111 __format: "json"
109 2160p: 112 2160p:
110 __name: "PEERTUBE_TRANSCODING_2160P" 113 __name: "PEERTUBE_TRANSCODING_2160P"
111 __format: "json" 114 __format: "json"