aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/job-queue/handlers/video-live-ending.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/job-queue/handlers/video-live-ending.ts')
-rw-r--r--server/lib/job-queue/handlers/video-live-ending.ts10
1 files changed, 6 insertions, 4 deletions
diff --git a/server/lib/job-queue/handlers/video-live-ending.ts b/server/lib/job-queue/handlers/video-live-ending.ts
index 2f3a971bd..1bf43f592 100644
--- a/server/lib/job-queue/handlers/video-live-ending.ts
+++ b/server/lib/job-queue/handlers/video-live-ending.ts
@@ -1,25 +1,25 @@
1import { Job } from 'bullmq' 1import { Job } from 'bullmq'
2import { readdir, remove } from 'fs-extra' 2import { readdir, remove } from 'fs-extra'
3import { join } from 'path' 3import { join } from 'path'
4import { ffprobePromise, getAudioStream, getVideoStreamDimensionsInfo } from '@server/helpers/ffmpeg'
5import { getLocalVideoActivityPubUrl } from '@server/lib/activitypub/url' 4import { getLocalVideoActivityPubUrl } from '@server/lib/activitypub/url'
6import { federateVideoIfNeeded } from '@server/lib/activitypub/videos' 5import { federateVideoIfNeeded } from '@server/lib/activitypub/videos'
7import { cleanupAndDestroyPermanentLive, cleanupTMPLiveFiles, cleanupUnsavedNormalLive } from '@server/lib/live' 6import { cleanupAndDestroyPermanentLive, cleanupTMPLiveFiles, cleanupUnsavedNormalLive } from '@server/lib/live'
8import { generateHLSMasterPlaylistFilename, generateHlsSha256SegmentsFilename, getLiveReplayBaseDirectory } from '@server/lib/paths' 7import { generateHLSMasterPlaylistFilename, generateHlsSha256SegmentsFilename, getLiveReplayBaseDirectory } from '@server/lib/paths'
9import { generateVideoMiniature } from '@server/lib/thumbnail' 8import { generateVideoMiniature } from '@server/lib/thumbnail'
10import { generateHlsPlaylistResolutionFromTS } from '@server/lib/transcoding/transcoding' 9import { generateHlsPlaylistResolutionFromTS } from '@server/lib/transcoding/hls-transcoding'
10import { VideoPathManager } from '@server/lib/video-path-manager'
11import { moveToNextState } from '@server/lib/video-state' 11import { moveToNextState } from '@server/lib/video-state'
12import { VideoModel } from '@server/models/video/video' 12import { VideoModel } from '@server/models/video/video'
13import { VideoBlacklistModel } from '@server/models/video/video-blacklist' 13import { VideoBlacklistModel } from '@server/models/video/video-blacklist'
14import { VideoFileModel } from '@server/models/video/video-file' 14import { VideoFileModel } from '@server/models/video/video-file'
15import { VideoLiveModel } from '@server/models/video/video-live' 15import { VideoLiveModel } from '@server/models/video/video-live'
16import { VideoLiveReplaySettingModel } from '@server/models/video/video-live-replay-setting'
16import { VideoLiveSessionModel } from '@server/models/video/video-live-session' 17import { VideoLiveSessionModel } from '@server/models/video/video-live-session'
17import { VideoStreamingPlaylistModel } from '@server/models/video/video-streaming-playlist' 18import { VideoStreamingPlaylistModel } from '@server/models/video/video-streaming-playlist'
18import { MVideo, MVideoLive, MVideoLiveSession, MVideoWithAllFiles } from '@server/types/models' 19import { MVideo, MVideoLive, MVideoLiveSession, MVideoWithAllFiles } from '@server/types/models'
20import { ffprobePromise, getAudioStream, getVideoStreamDimensionsInfo, getVideoStreamFPS } from '@shared/ffmpeg'
19import { ThumbnailType, VideoLiveEndingPayload, VideoState } from '@shared/models' 21import { ThumbnailType, VideoLiveEndingPayload, VideoState } from '@shared/models'
20import { logger, loggerTagsFactory } from '../../../helpers/logger' 22import { logger, loggerTagsFactory } from '../../../helpers/logger'
21import { VideoPathManager } from '@server/lib/video-path-manager'
22import { VideoLiveReplaySettingModel } from '@server/models/video/video-live-replay-setting'
23 23
24const lTags = loggerTagsFactory('live', 'job') 24const lTags = loggerTagsFactory('live', 'job')
25 25
@@ -224,6 +224,7 @@ async function assignReplayFilesToVideo (options: {
224 const probe = await ffprobePromise(concatenatedTsFilePath) 224 const probe = await ffprobePromise(concatenatedTsFilePath)
225 const { audioStream } = await getAudioStream(concatenatedTsFilePath, probe) 225 const { audioStream } = await getAudioStream(concatenatedTsFilePath, probe)
226 const { resolution } = await getVideoStreamDimensionsInfo(concatenatedTsFilePath, probe) 226 const { resolution } = await getVideoStreamDimensionsInfo(concatenatedTsFilePath, probe)
227 const fps = await getVideoStreamFPS(concatenatedTsFilePath, probe)
227 228
228 try { 229 try {
229 await generateHlsPlaylistResolutionFromTS({ 230 await generateHlsPlaylistResolutionFromTS({
@@ -231,6 +232,7 @@ async function assignReplayFilesToVideo (options: {
231 inputFileMutexReleaser, 232 inputFileMutexReleaser,
232 concatenatedTsFilePath, 233 concatenatedTsFilePath,
233 resolution, 234 resolution,
235 fps,
234 isAAC: audioStream?.codec_name === 'aac' 236 isAAC: audioStream?.codec_name === 'aac'
235 }) 237 })
236 } catch (err) { 238 } catch (err) {