aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/models/videos/transcoding/video-transcoding.model.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-11-18 14:35:08 +0100
committerChocobozzz <me@florianbigard.com>2021-11-18 15:20:57 +0100
commitad5db1044c8599eaaaa2a578b350777ae996b068 (patch)
tree3e003cccf021152405d49b21c6c91b703c8ae96c /shared/models/videos/transcoding/video-transcoding.model.ts
parentb46cf4b920984492df598c1b61179acfc7f6f22e (diff)
downloadPeerTube-ad5db1044c8599eaaaa2a578b350777ae996b068.tar.gz
PeerTube-ad5db1044c8599eaaaa2a578b350777ae996b068.tar.zst
PeerTube-ad5db1044c8599eaaaa2a578b350777ae996b068.zip
Add ability to run transcoding jobs
Diffstat (limited to 'shared/models/videos/transcoding/video-transcoding.model.ts')
-rw-r--r--shared/models/videos/transcoding/video-transcoding.model.ts64
1 files changed, 64 insertions, 0 deletions
diff --git a/shared/models/videos/transcoding/video-transcoding.model.ts b/shared/models/videos/transcoding/video-transcoding.model.ts
new file mode 100644
index 000000000..3a7fb6472
--- /dev/null
+++ b/shared/models/videos/transcoding/video-transcoding.model.ts
@@ -0,0 +1,64 @@
1import { VideoResolution } from '../file/video-resolution.enum'
2
3// Types used by plugins and ffmpeg-utils
4
5export 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
21export type EncoderOptionsBuilder = (params: EncoderOptionsBuilderParams) => Promise<EncoderOptions> | EncoderOptions
22
23export 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
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}