]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - shared/models/videos/transcoding/video-transcoding.model.ts
Add ability to run transcoding jobs
[github/Chocobozzz/PeerTube.git] / shared / models / videos / transcoding / video-transcoding.model.ts
CommitLineData
ad5db104 1import { VideoResolution } from '../file/video-resolution.enum'
1896bca0
C
2
3// Types used by plugins and ffmpeg-utils
4
679c12e6 5export type EncoderOptionsBuilderParams = {
1896bca0 6 input: string
679c12e6 7
1896bca0 8 resolution: VideoResolution
679c12e6
C
9
10 // Could be null for "merge audio" transcoding
1896bca0 11 fps?: number
679c12e6
C
12
13 // Could be undefined if we could not get input bitrate (some RTMP streams for example)
14 inputBitrate: number
15 inputRatio: number
16
17 // For lives
1896bca0 18 streamNum?: number
679c12e6
C
19}
20
21export type EncoderOptionsBuilder = (params: EncoderOptionsBuilderParams) => Promise<EncoderOptions> | EncoderOptions
1896bca0
C
22
23export interface EncoderOptions {
24 copy?: boolean // Copy stream? Default to false
25
3e03b961
C
26 scaleFilter?: {
27 name: string
28 }
29
43f7a43c 30 inputOptions?: string[]
43f7a43c 31 outputOptions?: string[]
1896bca0
C
32}
33
34// All our encoders
35
36export interface EncoderProfile <T> {
37 [ profile: string ]: T
38
39 default: T
40}
41
42export type AvailableEncoders = {
43 available: {
44 live: {
45 [ encoder: string ]: EncoderProfile<EncoderOptionsBuilder>
46 }
47
48 vod: {
49 [ encoder: string ]: EncoderProfile<EncoderOptionsBuilder>
50 }
51 }
52
53 encodersToTry: {
54 vod: {
55 video: string[]
56 audio: string[]
57 }
58
59 live: {
60 video: string[]
61 audio: string[]
62 }
63 }
64}