mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-03 01:39:37 +02:00
Feature for runners - handle storyboard-generation-job (#7191)
* Implement processing storyboards by runners * Fixed storyboard generation by runners * use common code patterns * fix import * improve debug logging for storyboard generation * config option for storyboard processing with remote-runners * refactor repetitive pattern * refactor storyboard related code to share common utlities * Fix test * Fix storyboard generation config logic * Improve logging * Added tests for storyboard generation with runners * Refactor PR --------- Co-authored-by: ilfarpro <ilfarpro@ya.ru> Co-authored-by: Chocobozzz <me@florianbigard.com>
This commit is contained in:
parent
e74bf8ae2a
commit
dd52e8b89e
50 changed files with 973 additions and 248 deletions
|
@ -582,7 +582,10 @@ function customConfig (): CustomConfig {
|
|||
}
|
||||
},
|
||||
storyboards: {
|
||||
enabled: CONFIG.STORYBOARDS.ENABLED
|
||||
enabled: CONFIG.STORYBOARDS.ENABLED,
|
||||
remoteRunners: {
|
||||
enabled: CONFIG.STORYBOARDS.REMOTE_RUNNERS.ENABLED
|
||||
}
|
||||
},
|
||||
defaults: {
|
||||
publish: {
|
||||
|
|
|
@ -15,6 +15,7 @@ import {
|
|||
RunnerJobUpdatePayload,
|
||||
ServerErrorCode,
|
||||
TranscriptionSuccess,
|
||||
GenerateStoryboardSuccess,
|
||||
UserRight,
|
||||
VODAudioMergeTranscodingSuccess,
|
||||
VODHLSTranscodingSuccess,
|
||||
|
@ -56,8 +57,13 @@ import { RunnerModel } from '@server/models/runner/runner.js'
|
|||
import express, { UploadFiles } from 'express'
|
||||
|
||||
const postRunnerJobSuccessVideoFiles = createReqFiles(
|
||||
[ 'payload[videoFile]', 'payload[resolutionPlaylistFile]', 'payload[vttFile]' ],
|
||||
{ ...MIMETYPES.VIDEO.MIMETYPE_EXT, ...MIMETYPES.M3U8.MIMETYPE_EXT, ...MIMETYPES.VIDEO_CAPTIONS.MIMETYPE_EXT }
|
||||
[ 'payload[videoFile]', 'payload[resolutionPlaylistFile]', 'payload[vttFile]', 'payload[storyboardFile]' ],
|
||||
{
|
||||
...MIMETYPES.VIDEO.MIMETYPE_EXT,
|
||||
...MIMETYPES.M3U8.MIMETYPE_EXT,
|
||||
...MIMETYPES.VIDEO_CAPTIONS.MIMETYPE_EXT,
|
||||
...MIMETYPES.IMAGE.MIMETYPE_EXT
|
||||
}
|
||||
)
|
||||
|
||||
const runnerJobUpdateVideoFiles = createReqFiles(
|
||||
|
@ -384,6 +390,14 @@ const jobSuccessPayloadBuilders: {
|
|||
|
||||
vttFile: files['payload[vttFile]'][0].path
|
||||
}
|
||||
},
|
||||
|
||||
'generate-video-storyboard': (payload: GenerateStoryboardSuccess, files) => {
|
||||
return {
|
||||
...payload,
|
||||
|
||||
storyboardFile: files['payload[storyboardFile]'][0].path
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ import { setupUploadResumableRoutes } from '@server/lib/uploadx.js'
|
|||
import { autoBlacklistVideoIfNeeded } from '@server/lib/video-blacklist.js'
|
||||
import { regenerateTranscriptionTaskIfNeeded } from '@server/lib/video-captions.js'
|
||||
import { buildNewFile, createVideoSource } from '@server/lib/video-file.js'
|
||||
import { buildMoveVideoJob, buildStoryboardJobIfNeeded } from '@server/lib/video-jobs.js'
|
||||
import { addRemoteStoryboardJobIfNeeded, buildLocalStoryboardJobIfNeeded, buildMoveVideoJob } from '@server/lib/video-jobs.js'
|
||||
import { VideoPathManager } from '@server/lib/video-path-manager.js'
|
||||
import { buildNextVideoState } from '@server/lib/video-state.js'
|
||||
import { openapiOperationDoc } from '@server/middlewares/doc.js'
|
||||
|
@ -172,7 +172,7 @@ async function addVideoJobsAfterUpload (video: MVideoFullLight, videoFile: MVide
|
|||
}
|
||||
},
|
||||
|
||||
buildStoryboardJobIfNeeded({ video, federate: false }),
|
||||
buildLocalStoryboardJobIfNeeded({ video, federate: false }),
|
||||
|
||||
{
|
||||
type: 'federate-video' as const,
|
||||
|
@ -201,6 +201,7 @@ async function addVideoJobsAfterUpload (video: MVideoFullLight, videoFile: MVide
|
|||
|
||||
await JobQueue.Instance.createSequentialJobFlow(...jobs)
|
||||
|
||||
await addRemoteStoryboardJobIfNeeded(video)
|
||||
await regenerateTranscriptionTaskIfNeeded(video)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue