+ private buildAvailableProfiles () {
+ for (const type of [ 'vod', 'live' ]) {
+ const result = new Set()
+
+ const encoders = this.availableEncoders[type]
+
+ for (const encoderName of Object.keys(encoders)) {
+ for (const profile of Object.keys(encoders[encoderName])) {
+ result.add(profile)
+ }
+ }
+
+ this.availableProfiles[type] = Array.from(result)
+ }
+
+ logger.debug('Available transcoding profiles built.', { availableProfiles: this.availableProfiles })
+ }
+
+ private buildDefaultEncodersPriorities () {
+ return {
+ video: [
+ { name: 'libx264', priority: 100 }
+ ],
+
+ // Try the first one, if not available try the second one etc
+ audio: [
+ // we favor VBR, if a good AAC encoder is available
+ { name: 'libfdk_aac', priority: 200 },
+ { name: 'aac', priority: 100 }
+ ]
+ }
+ }
+