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