2021-01-28 15:52:44 +01:00
|
|
|
import { VideoResolution } from './video-resolution.enum'
|
|
|
|
|
|
|
|
// Types used by plugins and ffmpeg-utils
|
|
|
|
|
|
|
|
export type EncoderOptionsBuilder = (params: {
|
|
|
|
input: string
|
|
|
|
resolution: VideoResolution
|
|
|
|
fps?: number
|
|
|
|
streamNum?: number
|
|
|
|
}) => Promise<EncoderOptions> | EncoderOptions
|
|
|
|
|
|
|
|
export interface EncoderOptions {
|
|
|
|
copy?: boolean // Copy stream? Default to false
|
|
|
|
|
2021-04-09 10:36:21 +02:00
|
|
|
scaleFilter?: {
|
|
|
|
name: string
|
|
|
|
}
|
|
|
|
|
2021-04-03 23:51:37 +02:00
|
|
|
inputOptions?: string[]
|
|
|
|
outputOptions?: string[]
|
2021-01-28 15:52:44 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// All our encoders
|
|
|
|
|
|
|
|
export interface EncoderProfile <T> {
|
|
|
|
[ profile: string ]: T
|
|
|
|
|
|
|
|
default: T
|
|
|
|
}
|
|
|
|
|
|
|
|
export type AvailableEncoders = {
|
|
|
|
available: {
|
|
|
|
live: {
|
|
|
|
[ encoder: string ]: EncoderProfile<EncoderOptionsBuilder>
|
|
|
|
}
|
|
|
|
|
|
|
|
vod: {
|
|
|
|
[ encoder: string ]: EncoderProfile<EncoderOptionsBuilder>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
encodersToTry: {
|
|
|
|
vod: {
|
|
|
|
video: string[]
|
|
|
|
audio: string[]
|
|
|
|
}
|
|
|
|
|
|
|
|
live: {
|
|
|
|
video: string[]
|
|
|
|
audio: string[]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|