From 1896bca09e088b0da9d5e845407ecebae330618c Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 28 Jan 2021 15:52:44 +0100 Subject: Support transcoding options/encoders by plugins --- shared/models/videos/index.ts | 1 + shared/models/videos/video-transcoding.model.ts | 48 +++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 shared/models/videos/video-transcoding.model.ts (limited to 'shared/models/videos') diff --git a/shared/models/videos/index.ts b/shared/models/videos/index.ts index abf144f23..fac3e0b2f 100644 --- a/shared/models/videos/index.ts +++ b/shared/models/videos/index.ts @@ -34,6 +34,7 @@ export * from './video-state.enum' export * from './video-streaming-playlist.model' export * from './video-streaming-playlist.type' +export * from './video-transcoding.model' export * from './video-transcoding-fps.model' export * from './video-update.model' 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 @@ +import { VideoResolution } from './video-resolution.enum' + +// Types used by plugins and ffmpeg-utils + +export type EncoderOptionsBuilder = (params: { + input: string + resolution: VideoResolution + fps?: number + streamNum?: number +}) => Promise | EncoderOptions + +export interface EncoderOptions { + copy?: boolean // Copy stream? Default to false + + outputOptions: string[] +} + +// All our encoders + +export interface EncoderProfile { + [ profile: string ]: T + + default: T +} + +export type AvailableEncoders = { + available: { + live: { + [ encoder: string ]: EncoderProfile + } + + vod: { + [ encoder: string ]: EncoderProfile + } + } + + encodersToTry: { + vod: { + video: string[] + audio: string[] + } + + live: { + video: string[] + audio: string[] + } + } +} -- cgit v1.2.3