aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/video-transcoding.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/video-transcoding.ts')
-rw-r--r--server/lib/video-transcoding.ts13
1 files changed, 12 insertions, 1 deletions
diff --git a/server/lib/video-transcoding.ts b/server/lib/video-transcoding.ts
index 078e85acf..a6b79eaea 100644
--- a/server/lib/video-transcoding.ts
+++ b/server/lib/video-transcoding.ts
@@ -201,6 +201,16 @@ function generateHlsPlaylist (options: {
201 }) 201 })
202} 202}
203 203
204function getEnabledResolutions (type: 'vod' | 'live') {
205 const transcoding = type === 'vod'
206 ? CONFIG.TRANSCODING
207 : CONFIG.LIVE.TRANSCODING
208
209 return Object.keys(transcoding.RESOLUTIONS)
210 .filter(key => transcoding.ENABLED && transcoding.RESOLUTIONS[key] === true)
211 .map(r => parseInt(r, 10))
212}
213
204// --------------------------------------------------------------------------- 214// ---------------------------------------------------------------------------
205 215
206export { 216export {
@@ -208,7 +218,8 @@ export {
208 generateHlsPlaylistFromTS, 218 generateHlsPlaylistFromTS,
209 optimizeOriginalVideofile, 219 optimizeOriginalVideofile,
210 transcodeNewResolution, 220 transcodeNewResolution,
211 mergeAudioVideofile 221 mergeAudioVideofile,
222 getEnabledResolutions
212} 223}
213 224
214// --------------------------------------------------------------------------- 225// ---------------------------------------------------------------------------