From ad3405d087b306efa5eb62a69c9b797b04eab4ce Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 6 Jun 2019 14:45:57 +0200 Subject: Improve 4K video quality after transcoding --- shared/extra-utils/server/follows.ts | 2 +- shared/models/videos/video-resolution.enum.ts | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'shared') diff --git a/shared/extra-utils/server/follows.ts b/shared/extra-utils/server/follows.ts index 1505804de..68c5a2e2b 100644 --- a/shared/extra-utils/server/follows.ts +++ b/shared/extra-utils/server/follows.ts @@ -1,7 +1,7 @@ import * as request from 'supertest' import { ServerInfo } from './servers' import { waitJobs } from './jobs' -import { makeGetRequest, makePostBodyRequest } from '..' +import { makePostBodyRequest } from '../requests/requests' function getFollowersListPaginationAndSort (url: string, start: number, count: number, sort: string, search?: string) { const path = '/api/v1/server/followers' diff --git a/shared/models/videos/video-resolution.enum.ts b/shared/models/videos/video-resolution.enum.ts index 7da5e7100..51efa2e8b 100644 --- a/shared/models/videos/video-resolution.enum.ts +++ b/shared/models/videos/video-resolution.enum.ts @@ -5,7 +5,8 @@ export enum VideoResolution { H_360P = 360, H_480P = 480, H_720P = 720, - H_1080P = 1080 + H_1080P = 1080, + H_4K = 2160 } /** @@ -33,11 +34,14 @@ function getBaseBitrate (resolution: VideoResolution) { // quality according to Google Live Encoder: 1,500 - 4,000 Kbps // Quality according to YouTube Video Info: 1752 Kbps return 1750 * 1000 - case VideoResolution.H_1080P: // fallthrough - default: + case VideoResolution.H_1080P: // quality according to Google Live Encoder: 3000 - 6000 Kbps // Quality according to YouTube Video Info: 3277 Kbps return 3300 * 1000 + case VideoResolution.H_4K: // fallthrough + default: + // quality according to Google Live Encoder: 13000 - 34000 Kbps + return 15000 * 1000 } } -- cgit v1.2.3