]>
Commit | Line | Data |
---|---|---|
1 | import { VideoResolution } from '../file/video-resolution.enum' | |
2 | ||
3 | // Types used by plugins and ffmpeg-utils | |
4 | ||
5 | export type EncoderOptionsBuilderParams = { | |
6 | input: string | |
7 | ||
8 | resolution: VideoResolution | |
9 | ||
10 | // Could be null for "merge audio" transcoding | |
11 | fps?: number | |
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 | |
18 | streamNum?: number | |
19 | } | |
20 | ||
21 | export type EncoderOptionsBuilder = (params: EncoderOptionsBuilderParams) => Promise<EncoderOptions> | EncoderOptions | |
22 | ||
23 | export interface EncoderOptions { | |
24 | copy?: boolean // Copy stream? Default to false | |
25 | ||
26 | scaleFilter?: { | |
27 | name: string | |
28 | } | |
29 | ||
30 | inputOptions?: string[] | |
31 | outputOptions?: string[] | |
32 | } | |
33 | ||
34 | // All our encoders | |
35 | ||
36 | export interface EncoderProfile <T> { | |
37 | [ profile: string ]: T | |
38 | ||
39 | default: T | |
40 | } | |
41 | ||
42 | export 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 | } |