mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-04 10:19:35 +02:00
Add plugin hook on transcoding resolutions building
This commit is contained in:
parent
22df69fdec
commit
ebb9e53ada
6 changed files with 51 additions and 6 deletions
|
@ -26,6 +26,7 @@ import {
|
|||
optimizeOriginalVideofile,
|
||||
transcodeNewWebTorrentResolution
|
||||
} from '../../transcoding/transcoding'
|
||||
import { Hooks } from '@server/lib/plugins/hooks'
|
||||
|
||||
type HandlerFunction = (job: Job, payload: VideoTranscodingPayload, video: MVideoFullLight, user: MUser) => Promise<void>
|
||||
|
||||
|
@ -269,7 +270,12 @@ async function createLowerResolutionsJobs (options: {
|
|||
const { video, user, videoFileResolution, isPortraitMode, isNewVideo, hasAudio, type } = options
|
||||
|
||||
// Create transcoding jobs if there are enabled resolutions
|
||||
const resolutionsEnabled = computeLowerResolutionsToTranscode(videoFileResolution, 'vod')
|
||||
const resolutionsEnabled = await Hooks.wrapObject(
|
||||
computeLowerResolutionsToTranscode(videoFileResolution, 'vod'),
|
||||
'filter:transcoding.auto.lower-resolutions-to-transcode.result',
|
||||
options
|
||||
)
|
||||
|
||||
const resolutionCreated: string[] = []
|
||||
|
||||
for (const resolution of resolutionsEnabled) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue