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 }))
concatenatedTsFilePath: string
resolution: VideoResolution
isPortraitMode: boolean
+ isAAC: boolean
}) {
return generateHlsPlaylistCommon({
video: options.video,
resolution: options.resolution,
isPortraitMode: options.isPortraitMode,
inputPath: options.concatenatedTsFilePath,
- type: 'hls-from-ts' as 'hls-from-ts'
+ type: 'hls-from-ts' as 'hls-from-ts',
+ isAAC: options.isAAC
})
}
})
}
+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
}
// ---------------------------------------------------------------------------
inputPath: string
resolution: VideoResolution
copyCodecs?: boolean
+ isAAC?: boolean
isPortraitMode: boolean
}) {
- const { type, video, inputPath, resolution, copyCodecs, isPortraitMode } = options
+ const { type, video, inputPath, resolution, copyCodecs, isPortraitMode, isAAC } = options
const baseHlsDirectory = join(HLS_STREAMING_PLAYLIST_DIRECTORY, video.uuid)
await ensureDir(join(HLS_STREAMING_PLAYLIST_DIRECTORY, video.uuid))
copyCodecs,
isPortraitMode,
+ isAAC,
+
hlsPlaylist: {
videoFilename
}