diff options
author | Florian CUNY <poslovitch@bentobox.world> | 2021-11-05 10:23:02 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-05 10:23:02 +0100 |
commit | 8dd754c76735417305c4b68e2ada6f623e9d7650 (patch) | |
tree | ac08054cc81f7aff812e175443298f287f66b96d /shared | |
parent | dd6d2a7ce50e7ff02e00995ccc87f8f929ad9709 (diff) | |
download | PeerTube-8dd754c76735417305c4b68e2ada6f623e9d7650.tar.gz PeerTube-8dd754c76735417305c4b68e2ada6f623e9d7650.tar.zst PeerTube-8dd754c76735417305c4b68e2ada6f623e9d7650.zip |
Added 144p encoding (#4492)
* Added 144p encoding
Implements https://github.com/Chocobozzz/PeerTube/issues/4428
* Fixed typo in core-utils
* Increased BitPerPixel for 144p
* Disabled 144p by default in test.yaml
* Another try at fixing tests
* Fixed test in video-transcoder (api-3)
* Fixed test in video-imports (api-4)
* Fixed test in live-constraints (api-2)
* Tried to fix tests in api-3 again
* Revert "Tried to fix tests in api-3 again"
This reverts commit 266e1143fa37f333d149c2c2791c7bd33621ac14.
* Fixed test in config.ts (api-2)
* Try to fix test in video-hls.ts (api-3)
* Fixed test in video-transcoder.ts (api-3)
* Fix tests
Co-authored-by: Chocobozzz <me@florianbigard.com>
Diffstat (limited to 'shared')
-rw-r--r-- | shared/core-utils/videos/bitrate.ts | 3 | ||||
-rw-r--r-- | shared/extra-utils/server/config-command.ts | 3 | ||||
-rw-r--r-- | shared/models/server/custom-config.model.ts | 1 | ||||
-rw-r--r-- | shared/models/videos/video-resolution.enum.ts | 1 |
4 files changed, 8 insertions, 0 deletions
diff --git a/shared/core-utils/videos/bitrate.ts b/shared/core-utils/videos/bitrate.ts index a6712f8a4..18c6e2f6c 100644 --- a/shared/core-utils/videos/bitrate.ts +++ b/shared/core-utils/videos/bitrate.ts | |||
@@ -6,6 +6,7 @@ type BitPerPixel = { [ id in VideoResolution ]: number } | |||
6 | 6 | ||
7 | const averageBitPerPixel: BitPerPixel = { | 7 | const averageBitPerPixel: BitPerPixel = { |
8 | [VideoResolution.H_NOVIDEO]: 0, | 8 | [VideoResolution.H_NOVIDEO]: 0, |
9 | [VideoResolution.H_144P]: 0.19, | ||
9 | [VideoResolution.H_240P]: 0.17, | 10 | [VideoResolution.H_240P]: 0.17, |
10 | [VideoResolution.H_360P]: 0.15, | 11 | [VideoResolution.H_360P]: 0.15, |
11 | [VideoResolution.H_480P]: 0.12, | 12 | [VideoResolution.H_480P]: 0.12, |
@@ -17,6 +18,7 @@ const averageBitPerPixel: BitPerPixel = { | |||
17 | 18 | ||
18 | const maxBitPerPixel: BitPerPixel = { | 19 | const maxBitPerPixel: BitPerPixel = { |
19 | [VideoResolution.H_NOVIDEO]: 0, | 20 | [VideoResolution.H_NOVIDEO]: 0, |
21 | [VideoResolution.H_144P]: 0.32, | ||
20 | [VideoResolution.H_240P]: 0.29, | 22 | [VideoResolution.H_240P]: 0.29, |
21 | [VideoResolution.H_360P]: 0.26, | 23 | [VideoResolution.H_360P]: 0.26, |
22 | [VideoResolution.H_480P]: 0.22, | 24 | [VideoResolution.H_480P]: 0.22, |
@@ -73,6 +75,7 @@ function calculateBitrate (options: { | |||
73 | VideoResolution.H_480P, | 75 | VideoResolution.H_480P, |
74 | VideoResolution.H_360P, | 76 | VideoResolution.H_360P, |
75 | VideoResolution.H_240P, | 77 | VideoResolution.H_240P, |
78 | VideoResolution.H_144P, | ||
76 | VideoResolution.H_NOVIDEO | 79 | VideoResolution.H_NOVIDEO |
77 | ] | 80 | ] |
78 | 81 | ||
diff --git a/shared/extra-utils/server/config-command.ts b/shared/extra-utils/server/config-command.ts index 2746e9ac4..7a768b4df 100644 --- a/shared/extra-utils/server/config-command.ts +++ b/shared/extra-utils/server/config-command.ts | |||
@@ -8,6 +8,7 @@ export class ConfigCommand extends AbstractCommand { | |||
8 | 8 | ||
9 | static getCustomConfigResolutions (enabled: boolean) { | 9 | static getCustomConfigResolutions (enabled: boolean) { |
10 | return { | 10 | return { |
11 | '144p': enabled, | ||
11 | '240p': enabled, | 12 | '240p': enabled, |
12 | '360p': enabled, | 13 | '360p': enabled, |
13 | '480p': enabled, | 14 | '480p': enabled, |
@@ -232,6 +233,7 @@ export class ConfigCommand extends AbstractCommand { | |||
232 | profile: 'default', | 233 | profile: 'default', |
233 | resolutions: { | 234 | resolutions: { |
234 | '0p': false, | 235 | '0p': false, |
236 | '144p': false, | ||
235 | '240p': false, | 237 | '240p': false, |
236 | '360p': true, | 238 | '360p': true, |
237 | '480p': true, | 239 | '480p': true, |
@@ -258,6 +260,7 @@ export class ConfigCommand extends AbstractCommand { | |||
258 | threads: 4, | 260 | threads: 4, |
259 | profile: 'default', | 261 | profile: 'default', |
260 | resolutions: { | 262 | resolutions: { |
263 | '144p': true, | ||
261 | '240p': true, | 264 | '240p': true, |
262 | '360p': true, | 265 | '360p': true, |
263 | '480p': true, | 266 | '480p': true, |
diff --git a/shared/models/server/custom-config.model.ts b/shared/models/server/custom-config.model.ts index 322fbb797..3ed932494 100644 --- a/shared/models/server/custom-config.model.ts +++ b/shared/models/server/custom-config.model.ts | |||
@@ -2,6 +2,7 @@ import { NSFWPolicyType } from '../videos/nsfw-policy.type' | |||
2 | import { BroadcastMessageLevel } from './broadcast-message-level.type' | 2 | import { BroadcastMessageLevel } from './broadcast-message-level.type' |
3 | 3 | ||
4 | export type ConfigResolutions = { | 4 | export type ConfigResolutions = { |
5 | '144p': boolean | ||
5 | '240p': boolean | 6 | '240p': boolean |
6 | '360p': boolean | 7 | '360p': boolean |
7 | '480p': boolean | 8 | '480p': boolean |
diff --git a/shared/models/videos/video-resolution.enum.ts b/shared/models/videos/video-resolution.enum.ts index 24cd2d04d..5b48ad353 100644 --- a/shared/models/videos/video-resolution.enum.ts +++ b/shared/models/videos/video-resolution.enum.ts | |||
@@ -1,5 +1,6 @@ | |||
1 | export const enum VideoResolution { | 1 | export const enum VideoResolution { |
2 | H_NOVIDEO = 0, | 2 | H_NOVIDEO = 0, |
3 | H_144P = 144, | ||
3 | H_240P = 240, | 4 | H_240P = 240, |
4 | H_360P = 360, | 5 | H_360P = 360, |
5 | H_480P = 480, | 6 | H_480P = 480, |