aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-08-05 10:36:19 +0200
committerChocobozzz <me@florianbigard.com>2022-08-09 09:18:07 +0200
commit84cae54e7a2595bea0c3ea106a4d111fd11a4ec6 (patch)
tree03fe73edf049ce60df6bbc34dcfb2031c07ea59c /server/controllers/api
parent7e0f50d6e0c7dc583d40e196c283eb20dc386ae6 (diff)
downloadPeerTube-84cae54e7a2595bea0c3ea106a4d111fd11a4ec6.tar.gz
PeerTube-84cae54e7a2595bea0c3ea106a4d111fd11a4ec6.tar.zst
PeerTube-84cae54e7a2595bea0c3ea106a4d111fd11a4ec6.zip
Add option to not transcode original resolution
Diffstat (limited to 'server/controllers/api')
-rw-r--r--server/controllers/api/config.ts4
-rw-r--r--server/controllers/api/videos/transcoding.ts10
2 files changed, 7 insertions, 7 deletions
diff --git a/server/controllers/api/config.ts b/server/controllers/api/config.ts
index cfb750bc9..ff2fa9d86 100644
--- a/server/controllers/api/config.ts
+++ b/server/controllers/api/config.ts
@@ -227,6 +227,7 @@ function customConfig (): CustomConfig {
227 '1440p': CONFIG.TRANSCODING.RESOLUTIONS['1440p'], 227 '1440p': CONFIG.TRANSCODING.RESOLUTIONS['1440p'],
228 '2160p': CONFIG.TRANSCODING.RESOLUTIONS['2160p'] 228 '2160p': CONFIG.TRANSCODING.RESOLUTIONS['2160p']
229 }, 229 },
230 alwaysTranscodeOriginalResolution: CONFIG.TRANSCODING.ALWAYS_TRANSCODE_ORIGINAL_RESOLUTION,
230 webtorrent: { 231 webtorrent: {
231 enabled: CONFIG.TRANSCODING.WEBTORRENT.ENABLED 232 enabled: CONFIG.TRANSCODING.WEBTORRENT.ENABLED
232 }, 233 },
@@ -256,7 +257,8 @@ function customConfig (): CustomConfig {
256 '1080p': CONFIG.LIVE.TRANSCODING.RESOLUTIONS['1080p'], 257 '1080p': CONFIG.LIVE.TRANSCODING.RESOLUTIONS['1080p'],
257 '1440p': CONFIG.LIVE.TRANSCODING.RESOLUTIONS['1440p'], 258 '1440p': CONFIG.LIVE.TRANSCODING.RESOLUTIONS['1440p'],
258 '2160p': CONFIG.LIVE.TRANSCODING.RESOLUTIONS['2160p'] 259 '2160p': CONFIG.LIVE.TRANSCODING.RESOLUTIONS['2160p']
259 } 260 },
261 alwaysTranscodeOriginalResolution: CONFIG.LIVE.TRANSCODING.ALWAYS_TRANSCODE_ORIGINAL_RESOLUTION
260 } 262 }
261 }, 263 },
262 videoStudio: { 264 videoStudio: {
diff --git a/server/controllers/api/videos/transcoding.ts b/server/controllers/api/videos/transcoding.ts
index a360a8b6a..09ab7dc0f 100644
--- a/server/controllers/api/videos/transcoding.ts
+++ b/server/controllers/api/videos/transcoding.ts
@@ -1,5 +1,5 @@
1import express from 'express' 1import express from 'express'
2import { computeLowerResolutionsToTranscode } from '@server/helpers/ffmpeg' 2import { computeResolutionsToTranscode } from '@server/helpers/ffmpeg'
3import { logger, loggerTagsFactory } from '@server/helpers/logger' 3import { logger, loggerTagsFactory } from '@server/helpers/logger'
4import { addTranscodingJob } from '@server/lib/video' 4import { addTranscodingJob } from '@server/lib/video'
5import { HttpStatusCode, UserRight, VideoState, VideoTranscodingCreate } from '@shared/models' 5import { HttpStatusCode, UserRight, VideoState, VideoTranscodingCreate } from '@shared/models'
@@ -30,9 +30,9 @@ async function createTranscoding (req: express.Request, res: express.Response) {
30 30
31 const body: VideoTranscodingCreate = req.body 31 const body: VideoTranscodingCreate = req.body
32 32
33 const { resolution: maxResolution, isPortraitMode, audioStream } = await video.probeMaxQualityFile() 33 const { resolution: maxResolution, audioStream } = await video.probeMaxQualityFile()
34 const resolutions = await Hooks.wrapObject( 34 const resolutions = await Hooks.wrapObject(
35 computeLowerResolutionsToTranscode(maxResolution, 'vod').concat([ maxResolution ]), 35 computeResolutionsToTranscode({ inputResolution: maxResolution, type: 'vod', includeInputResolution: true }),
36 'filter:transcoding.manual.lower-resolutions-to-transcode.result', 36 'filter:transcoding.manual.lower-resolutions-to-transcode.result',
37 body 37 body
38 ) 38 )
@@ -50,7 +50,6 @@ async function createTranscoding (req: express.Request, res: express.Response) {
50 type: 'new-resolution-to-hls', 50 type: 'new-resolution-to-hls',
51 videoUUID: video.uuid, 51 videoUUID: video.uuid,
52 resolution, 52 resolution,
53 isPortraitMode,
54 hasAudio: !!audioStream, 53 hasAudio: !!audioStream,
55 copyCodecs: false, 54 copyCodecs: false,
56 isNewVideo: false, 55 isNewVideo: false,
@@ -64,8 +63,7 @@ async function createTranscoding (req: express.Request, res: express.Response) {
64 isNewVideo: false, 63 isNewVideo: false,
65 resolution, 64 resolution,
66 hasAudio: !!audioStream, 65 hasAudio: !!audioStream,
67 createHLSIfNeeded: false, 66 createHLSIfNeeded: false
68 isPortraitMode
69 }) 67 })
70 } 68 }
71 } 69 }