aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/models/videos/video-transcoding.model.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-01-28 15:52:44 +0100
committerChocobozzz <me@florianbigard.com>2021-01-28 15:55:39 +0100
commit1896bca09e088b0da9d5e845407ecebae330618c (patch)
tree56041c445c0cd49aca536d0fd6b586730f4d341e /shared/models/videos/video-transcoding.model.ts
parent529b37527cff5203a0689a15ce73dcee6e1eece2 (diff)
downloadPeerTube-1896bca09e088b0da9d5e845407ecebae330618c.tar.gz
PeerTube-1896bca09e088b0da9d5e845407ecebae330618c.tar.zst
PeerTube-1896bca09e088b0da9d5e845407ecebae330618c.zip
Support transcoding options/encoders by plugins
Diffstat (limited to 'shared/models/videos/video-transcoding.model.ts')
-rw-r--r--shared/models/videos/video-transcoding.model.ts48
1 files changed, 48 insertions, 0 deletions
diff --git a/shared/models/videos/video-transcoding.model.ts b/shared/models/videos/video-transcoding.model.ts
new file mode 100644
index 000000000..06b555c16
--- /dev/null
+++ b/shared/models/videos/video-transcoding.model.ts
@@ -0,0 +1,48 @@
1import { VideoResolution } from './video-resolution.enum'
2
3// Types used by plugins and ffmpeg-utils
4
5export type EncoderOptionsBuilder = (params: {
6 input: string
7 resolution: VideoResolution
8 fps?: number
9 streamNum?: number
10}) => Promise<EncoderOptions> | EncoderOptions
11
12export interface EncoderOptions {
13 copy?: boolean // Copy stream? Default to false
14
15 outputOptions: string[]
16}
17
18// All our encoders
19
20export interface EncoderProfile <T> {
21 [ profile: string ]: T
22
23 default: T
24}
25
26export type AvailableEncoders = {
27 available: {
28 live: {
29 [ encoder: string ]: EncoderProfile<EncoderOptionsBuilder>
30 }
31
32 vod: {
33 [ encoder: string ]: EncoderProfile<EncoderOptionsBuilder>
34 }
35 }
36
37 encodersToTry: {
38 vod: {
39 video: string[]
40 audio: string[]
41 }
42
43 live: {
44 video: string[]
45 audio: string[]
46 }
47 }
48}