X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=shared%2Fmodels%2Fvideos%2Fvideo-resolution.enum.ts;h=7da5e71004dc1f061ece37e0c53b0daab9fdc081;hb=e8bafea35bc930cb8ac5b2d521a188642a1adffe;hp=c9b25892102b146bcdfb52208c715546e65b1f54;hpb=2f71dcf8de13e5250957173c9a2efe1c5544aeb2;p=github%2FChocobozzz%2FPeerTube.git diff --git a/shared/models/videos/video-resolution.enum.ts b/shared/models/videos/video-resolution.enum.ts index c9b258921..7da5e7100 100644 --- a/shared/models/videos/video-resolution.enum.ts +++ b/shared/models/videos/video-resolution.enum.ts @@ -15,7 +15,7 @@ export enum VideoResolution { * Google Live Encoder: https://support.google.com/youtube/answer/2853702?hl=en * YouTube Video Info (tested with random music video): https://www.h3xed.com/blogmedia/youtube-info.php */ -export function getBaseBitrate (resolution: VideoResolution) { +function getBaseBitrate (resolution: VideoResolution) { switch (resolution) { case VideoResolution.H_240P: // quality according to Google Live Encoder: 300 - 700 Kbps @@ -50,8 +50,7 @@ export function getBaseBitrate (resolution: VideoResolution) { * getBaseBitrate() * 1.4. All other values are calculated linearly * between these two points. */ -export function getTargetBitrate (resolution: VideoResolution, fps: number, - fpsTranscodingConstants: VideoTranscodingFPS) { +export function getTargetBitrate (resolution: VideoResolution, fps: number, fpsTranscodingConstants: VideoTranscodingFPS) { const baseBitrate = getBaseBitrate(resolution) // The maximum bitrate, used when fps === VideoTranscodingFPS.MAX // Based on numbers from Youtube, 60 fps bitrate divided by 30 fps bitrate: @@ -71,7 +70,6 @@ export function getTargetBitrate (resolution: VideoResolution, fps: number, /** * The maximum bitrate we expect to see on a transcoded video in bytes per second. */ -export function getMaxBitrate (resolution: VideoResolution, fps: number, - fpsTranscodingConstants: VideoTranscodingFPS) { +export function getMaxBitrate (resolution: VideoResolution, fps: number, fpsTranscodingConstants: VideoTranscodingFPS) { return getTargetBitrate(resolution, fps, fpsTranscodingConstants) * 2 }