diff options
author | Chocobozzz <me@florianbigard.com> | 2021-01-28 15:52:44 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-01-28 15:55:39 +0100 |
commit | 1896bca09e088b0da9d5e845407ecebae330618c (patch) | |
tree | 56041c445c0cd49aca536d0fd6b586730f4d341e /server/controllers/api/config.ts | |
parent | 529b37527cff5203a0689a15ce73dcee6e1eece2 (diff) | |
download | PeerTube-1896bca09e088b0da9d5e845407ecebae330618c.tar.gz PeerTube-1896bca09e088b0da9d5e845407ecebae330618c.tar.zst PeerTube-1896bca09e088b0da9d5e845407ecebae330618c.zip |
Support transcoding options/encoders by plugins
Diffstat (limited to 'server/controllers/api/config.ts')
-rw-r--r-- | server/controllers/api/config.ts | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/server/controllers/api/config.ts b/server/controllers/api/config.ts index 45c03be24..7fda06a87 100644 --- a/server/controllers/api/config.ts +++ b/server/controllers/api/config.ts | |||
@@ -18,6 +18,7 @@ import { PluginManager } from '../../lib/plugins/plugin-manager' | |||
18 | import { getThemeOrDefault } from '../../lib/plugins/theme-utils' | 18 | import { getThemeOrDefault } from '../../lib/plugins/theme-utils' |
19 | import { asyncMiddleware, authenticate, ensureUserHasRight } from '../../middlewares' | 19 | import { asyncMiddleware, authenticate, ensureUserHasRight } from '../../middlewares' |
20 | import { customConfigUpdateValidator } from '../../middlewares/validators/config' | 20 | import { customConfigUpdateValidator } from '../../middlewares/validators/config' |
21 | import { VideoTranscodingProfilesManager } from '@server/lib/video-transcoding-profiles' | ||
21 | 22 | ||
22 | const configRouter = express.Router() | 23 | const configRouter = express.Router() |
23 | 24 | ||
@@ -114,7 +115,9 @@ async function getConfig (req: express.Request, res: express.Response) { | |||
114 | webtorrent: { | 115 | webtorrent: { |
115 | enabled: CONFIG.TRANSCODING.WEBTORRENT.ENABLED | 116 | enabled: CONFIG.TRANSCODING.WEBTORRENT.ENABLED |
116 | }, | 117 | }, |
117 | enabledResolutions: getEnabledResolutions('vod') | 118 | enabledResolutions: getEnabledResolutions('vod'), |
119 | profile: CONFIG.TRANSCODING.PROFILE, | ||
120 | availableProfiles: VideoTranscodingProfilesManager.Instance.getAvailableProfiles('vod') | ||
118 | }, | 121 | }, |
119 | live: { | 122 | live: { |
120 | enabled: CONFIG.LIVE.ENABLED, | 123 | enabled: CONFIG.LIVE.ENABLED, |
@@ -126,7 +129,9 @@ async function getConfig (req: express.Request, res: express.Response) { | |||
126 | 129 | ||
127 | transcoding: { | 130 | transcoding: { |
128 | enabled: CONFIG.LIVE.TRANSCODING.ENABLED, | 131 | enabled: CONFIG.LIVE.TRANSCODING.ENABLED, |
129 | enabledResolutions: getEnabledResolutions('live') | 132 | enabledResolutions: getEnabledResolutions('live'), |
133 | profile: CONFIG.LIVE.TRANSCODING.PROFILE, | ||
134 | availableProfiles: VideoTranscodingProfilesManager.Instance.getAvailableProfiles('live') | ||
130 | }, | 135 | }, |
131 | 136 | ||
132 | rtmp: { | 137 | rtmp: { |
@@ -412,6 +417,7 @@ function customConfig (): CustomConfig { | |||
412 | allowAdditionalExtensions: CONFIG.TRANSCODING.ALLOW_ADDITIONAL_EXTENSIONS, | 417 | allowAdditionalExtensions: CONFIG.TRANSCODING.ALLOW_ADDITIONAL_EXTENSIONS, |
413 | allowAudioFiles: CONFIG.TRANSCODING.ALLOW_AUDIO_FILES, | 418 | allowAudioFiles: CONFIG.TRANSCODING.ALLOW_AUDIO_FILES, |
414 | threads: CONFIG.TRANSCODING.THREADS, | 419 | threads: CONFIG.TRANSCODING.THREADS, |
420 | profile: CONFIG.TRANSCODING.PROFILE, | ||
415 | resolutions: { | 421 | resolutions: { |
416 | '0p': CONFIG.TRANSCODING.RESOLUTIONS['0p'], | 422 | '0p': CONFIG.TRANSCODING.RESOLUTIONS['0p'], |
417 | '240p': CONFIG.TRANSCODING.RESOLUTIONS['240p'], | 423 | '240p': CONFIG.TRANSCODING.RESOLUTIONS['240p'], |
@@ -438,6 +444,7 @@ function customConfig (): CustomConfig { | |||
438 | transcoding: { | 444 | transcoding: { |
439 | enabled: CONFIG.LIVE.TRANSCODING.ENABLED, | 445 | enabled: CONFIG.LIVE.TRANSCODING.ENABLED, |
440 | threads: CONFIG.LIVE.TRANSCODING.THREADS, | 446 | threads: CONFIG.LIVE.TRANSCODING.THREADS, |
447 | profile: CONFIG.LIVE.TRANSCODING.PROFILE, | ||
441 | resolutions: { | 448 | resolutions: { |
442 | '240p': CONFIG.LIVE.TRANSCODING.RESOLUTIONS['240p'], | 449 | '240p': CONFIG.LIVE.TRANSCODING.RESOLUTIONS['240p'], |
443 | '360p': CONFIG.LIVE.TRANSCODING.RESOLUTIONS['360p'], | 450 | '360p': CONFIG.LIVE.TRANSCODING.RESOLUTIONS['360p'], |