Regenerate storyboard after studio
This commit is contained in:
parent
4826cb2c69
commit
ba56aadb63
2 changed files with 26 additions and 7 deletions
|
@ -236,7 +236,7 @@ const JOB_TTL: { [id in JobType]: number } = {
|
||||||
'activitypub-refresher': 60000 * 10, // 10 minutes
|
'activitypub-refresher': 60000 * 10, // 10 minutes
|
||||||
'video-redundancy': 1000 * 3600 * 3, // 3 hours
|
'video-redundancy': 1000 * 3600 * 3, // 3 hours
|
||||||
'video-live-ending': 1000 * 60 * 10, // 10 minutes
|
'video-live-ending': 1000 * 60 * 10, // 10 minutes
|
||||||
'generate-video-storyboard': 1000 * 3600 * 3, // 3 hours
|
'generate-video-storyboard': 1000 * 3600 * 6, // 6 hours
|
||||||
'manage-video-torrent': 1000 * 3600 * 3, // 3 hours
|
'manage-video-torrent': 1000 * 3600 * 3, // 3 hours
|
||||||
'move-to-object-storage': 1000 * 60 * 60 * 3, // 3 hours
|
'move-to-object-storage': 1000 * 60 * 60 * 3, // 3 hours
|
||||||
'move-to-file-system': 1000 * 60 * 60 * 3, // 3 hours
|
'move-to-file-system': 1000 * 60 * 60 * 3, // 3 hours
|
||||||
|
|
|
@ -3,14 +3,11 @@ import { join } from 'path'
|
||||||
import { logger, loggerTagsFactory } from '@server/helpers/logger.js'
|
import { logger, loggerTagsFactory } from '@server/helpers/logger.js'
|
||||||
import { createTorrentAndSetInfoHashFromPath } from '@server/helpers/webtorrent.js'
|
import { createTorrentAndSetInfoHashFromPath } from '@server/helpers/webtorrent.js'
|
||||||
import { CONFIG } from '@server/initializers/config.js'
|
import { CONFIG } from '@server/initializers/config.js'
|
||||||
import { UserModel } from '@server/models/user/user.js'
|
|
||||||
import { MUser, MVideo, MVideoFile, MVideoFullLight, MVideoWithAllFiles } from '@server/types/models/index.js'
|
import { MUser, MVideo, MVideoFile, MVideoFullLight, MVideoWithAllFiles } from '@server/types/models/index.js'
|
||||||
import { getVideoStreamDuration } from '@peertube/peertube-ffmpeg'
|
import { getVideoStreamDuration } from '@peertube/peertube-ffmpeg'
|
||||||
import { VideoStudioEditionPayload, VideoStudioTask, VideoStudioTaskPayload } from '@peertube/peertube-models'
|
import { VideoStudioEditionPayload, VideoStudioTask, VideoStudioTaskPayload } from '@peertube/peertube-models'
|
||||||
import { federateVideoIfNeeded } from './activitypub/videos/index.js'
|
|
||||||
import { JobQueue } from './job-queue/index.js'
|
import { JobQueue } from './job-queue/index.js'
|
||||||
import { VideoStudioTranscodingJobHandler } from './runners/index.js'
|
import { VideoStudioTranscodingJobHandler } from './runners/index.js'
|
||||||
import { createOptimizeOrMergeAudioJobs } from './transcoding/create-transcoding-job.js'
|
|
||||||
import { getTranscodingJobPriority } from './transcoding/transcoding-priority.js'
|
import { getTranscodingJobPriority } from './transcoding/transcoding-priority.js'
|
||||||
import { buildNewFile, removeHLSPlaylist, removeWebVideoFile } from './video-file.js'
|
import { buildNewFile, removeHLSPlaylist, removeWebVideoFile } from './video-file.js'
|
||||||
import { VideoPathManager } from './video-path-manager.js'
|
import { VideoPathManager } from './video-path-manager.js'
|
||||||
|
@ -108,11 +105,33 @@ export async function onVideoStudioEnded (options: {
|
||||||
video.duration = await getVideoStreamDuration(outputPath)
|
video.duration = await getVideoStreamDuration(outputPath)
|
||||||
await video.save()
|
await video.save()
|
||||||
|
|
||||||
await federateVideoIfNeeded(video, false, undefined)
|
return JobQueue.Instance.createSequentialJobFlow(
|
||||||
|
{
|
||||||
|
type: 'generate-video-storyboard' as 'generate-video-storyboard',
|
||||||
|
payload: {
|
||||||
|
videoUUID: video.uuid,
|
||||||
|
federate: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
const user = await UserModel.loadByVideoId(video.id)
|
{
|
||||||
|
type: 'federate-video' as 'federate-video',
|
||||||
|
payload: {
|
||||||
|
videoUUID: video.uuid,
|
||||||
|
isNewVideo: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
await createOptimizeOrMergeAudioJobs({ video, videoFile: newFile, isNewVideo: false, user, videoFileAlreadyLocked: false })
|
{
|
||||||
|
type: 'transcoding-job-builder' as 'transcoding-job-builder',
|
||||||
|
payload: {
|
||||||
|
videoUUID: video.uuid,
|
||||||
|
optimizeJob: {
|
||||||
|
isNewVideo: false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
Loading…
Add table
Reference in a new issue