diff options
Diffstat (limited to 'server/lib/job-queue/handlers/video-live-ending.ts')
-rw-r--r-- | server/lib/job-queue/handlers/video-live-ending.ts | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/server/lib/job-queue/handlers/video-live-ending.ts b/server/lib/job-queue/handlers/video-live-ending.ts index 4daf9249b..e10e306a7 100644 --- a/server/lib/job-queue/handlers/video-live-ending.ts +++ b/server/lib/job-queue/handlers/video-live-ending.ts | |||
@@ -1,8 +1,9 @@ | |||
1 | import * as Bull from 'bull' | 1 | import * as Bull from 'bull' |
2 | import { copy, pathExists, readdir, remove } from 'fs-extra' | 2 | import { pathExists, readdir, remove } from 'fs-extra' |
3 | import { join } from 'path' | 3 | import { join } from 'path' |
4 | import { getDurationFromVideoFile, getVideoFileResolution } from '@server/helpers/ffprobe-utils' | 4 | import { ffprobePromise, getAudioStream, getAudioStreamCodec, getDurationFromVideoFile, getVideoFileResolution } from '@server/helpers/ffprobe-utils' |
5 | import { VIDEO_LIVE } from '@server/initializers/constants' | 5 | import { VIDEO_LIVE } from '@server/initializers/constants' |
6 | import { LiveManager } from '@server/lib/live-manager' | ||
6 | import { generateVideoMiniature } from '@server/lib/thumbnail' | 7 | import { generateVideoMiniature } from '@server/lib/thumbnail' |
7 | import { publishAndFederateIfNeeded } from '@server/lib/video' | 8 | import { publishAndFederateIfNeeded } from '@server/lib/video' |
8 | import { getHLSDirectory } from '@server/lib/video-paths' | 9 | import { getHLSDirectory } from '@server/lib/video-paths' |
@@ -14,7 +15,6 @@ import { VideoStreamingPlaylistModel } from '@server/models/video/video-streamin | |||
14 | import { MStreamingPlaylist, MVideo, MVideoLive } from '@server/types/models' | 15 | import { MStreamingPlaylist, MVideo, MVideoLive } from '@server/types/models' |
15 | import { ThumbnailType, VideoLiveEndingPayload, VideoState } from '@shared/models' | 16 | import { ThumbnailType, VideoLiveEndingPayload, VideoState } from '@shared/models' |
16 | import { logger } from '../../../helpers/logger' | 17 | import { logger } from '../../../helpers/logger' |
17 | import { LiveManager } from '@server/lib/live-manager' | ||
18 | 18 | ||
19 | async function processVideoLiveEnding (job: Bull.Job) { | 19 | async function processVideoLiveEnding (job: Bull.Job) { |
20 | const payload = job.data as VideoLiveEndingPayload | 20 | const payload = job.data as VideoLiveEndingPayload |
@@ -106,13 +106,17 @@ async function saveLive (video: MVideo, live: MVideoLive) { | |||
106 | const concatenatedTsFile = LiveManager.Instance.buildConcatenatedName(playlistFile) | 106 | const concatenatedTsFile = LiveManager.Instance.buildConcatenatedName(playlistFile) |
107 | const concatenatedTsFilePath = join(replayDirectory, concatenatedTsFile) | 107 | const concatenatedTsFilePath = join(replayDirectory, concatenatedTsFile) |
108 | 108 | ||
109 | const { videoFileResolution, isPortraitMode } = await getVideoFileResolution(concatenatedTsFilePath) | 109 | const probe = await ffprobePromise(concatenatedTsFilePath) |
110 | const { audioStream } = await getAudioStream(concatenatedTsFilePath, probe) | ||
111 | |||
112 | const { videoFileResolution, isPortraitMode } = await getVideoFileResolution(concatenatedTsFilePath, probe) | ||
110 | 113 | ||
111 | const outputPath = await generateHlsPlaylistFromTS({ | 114 | const outputPath = await generateHlsPlaylistFromTS({ |
112 | video: videoWithFiles, | 115 | video: videoWithFiles, |
113 | concatenatedTsFilePath, | 116 | concatenatedTsFilePath, |
114 | resolution: videoFileResolution, | 117 | resolution: videoFileResolution, |
115 | isPortraitMode | 118 | isPortraitMode, |
119 | isAAC: audioStream?.codec_name === 'aac' | ||
116 | }) | 120 | }) |
117 | 121 | ||
118 | if (!durationDone) { | 122 | if (!durationDone) { |