const videoOutputPath = getVideoFilePath(video, inputVideoFile)
await onVideoFileTranscoding(video, inputVideoFile, videoTranscodedPath, videoOutputPath)
+
+ return transcodeType
} catch (err) {
// Auto destruction...
video.destroy().catch(err => logger.error('Cannot destruct video after transcoding failure.', { err }))
})
}
+function getEnabledResolutions (type: 'vod' | 'live') {
+ const transcoding = type === 'vod'
+ ? CONFIG.TRANSCODING
+ : CONFIG.LIVE.TRANSCODING
+
+ return Object.keys(transcoding.RESOLUTIONS)
+ .filter(key => transcoding.ENABLED && transcoding.RESOLUTIONS[key] === true)
+ .map(r => parseInt(r, 10))
+}
+
// ---------------------------------------------------------------------------
export {
generateHlsPlaylistFromTS,
optimizeOriginalVideofile,
transcodeNewResolution,
- mergeAudioVideofile
+ mergeAudioVideofile,
+ getEnabledResolutions
}
// ---------------------------------------------------------------------------