PeerTube/shared/models/videos/transcoding/video-transcoding.model.ts

68 lines
1.3 KiB
TypeScript
Raw Normal View History

2021-11-18 14:35:08 +01:00
import { VideoResolution } from '../file/video-resolution.enum'
// Types used by plugins and ffmpeg-utils
2021-08-06 13:35:25 +02:00
export type EncoderOptionsBuilderParams = {
input: string
2021-08-06 13:35:25 +02:00
resolution: VideoResolution
2021-08-06 13:35:25 +02:00
2022-02-11 10:51:33 +01:00
// If PeerTube applies a filter, transcoding profile must not copy input stream
canCopyAudio: boolean
canCopyVideo: boolean
fps: number
2021-08-06 13:35:25 +02:00
// Could be undefined if we could not get input bitrate (some RTMP streams for example)
inputBitrate: number
inputRatio: number
// For lives
streamNum?: number
2021-08-06 13:35:25 +02:00
}
export type EncoderOptionsBuilder = (params: EncoderOptionsBuilderParams) => Promise<EncoderOptions> | EncoderOptions
export interface EncoderOptions {
copy?: boolean // Copy stream? Default to false
scaleFilter?: {
name: string
}
inputOptions?: string[]
outputOptions?: string[]
}
// 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[]
}
}
}