diff options
Diffstat (limited to 'server/lib')
-rw-r--r-- | server/lib/hls.ts | 14 | ||||
-rw-r--r-- | server/lib/job-queue/handlers/video-file-import.ts | 12 | ||||
-rw-r--r-- | server/lib/job-queue/handlers/video-import.ts | 2 | ||||
-rw-r--r-- | server/lib/job-queue/handlers/video-live-ending.ts | 5 | ||||
-rw-r--r-- | server/lib/job-queue/handlers/video-transcoding.ts | 2 | ||||
-rw-r--r-- | server/lib/live-manager.ts | 9 | ||||
-rw-r--r-- | server/lib/video-transcoding.ts | 11 |
7 files changed, 22 insertions, 33 deletions
diff --git a/server/lib/hls.ts b/server/lib/hls.ts index 7aa152638..9ea83f337 100644 --- a/server/lib/hls.ts +++ b/server/lib/hls.ts | |||
@@ -1,17 +1,17 @@ | |||
1 | import { basename, dirname, join } from 'path' | ||
2 | import { HLS_STREAMING_PLAYLIST_DIRECTORY, P2P_MEDIA_LOADER_PEER_VERSION } from '../initializers/constants' | ||
3 | import { close, ensureDir, move, open, outputJSON, pathExists, read, readFile, remove, writeFile } from 'fs-extra' | 1 | import { close, ensureDir, move, open, outputJSON, pathExists, read, readFile, remove, writeFile } from 'fs-extra' |
4 | import { getVideoStreamSize, getAudioStreamCodec, getVideoStreamCodec } from '../helpers/ffmpeg-utils' | 2 | import { flatten, uniq } from 'lodash' |
3 | import { basename, dirname, join } from 'path' | ||
4 | import { MVideoWithFile } from '@server/types/models' | ||
5 | import { sha256 } from '../helpers/core-utils' | 5 | import { sha256 } from '../helpers/core-utils' |
6 | import { VideoStreamingPlaylistModel } from '../models/video/video-streaming-playlist' | 6 | import { getAudioStreamCodec, getVideoStreamCodec, getVideoStreamSize } from '../helpers/ffprobe-utils' |
7 | import { logger } from '../helpers/logger' | 7 | import { logger } from '../helpers/logger' |
8 | import { doRequest, doRequestAndSaveToFile } from '../helpers/requests' | 8 | import { doRequest, doRequestAndSaveToFile } from '../helpers/requests' |
9 | import { generateRandomString } from '../helpers/utils' | 9 | import { generateRandomString } from '../helpers/utils' |
10 | import { flatten, uniq } from 'lodash' | ||
11 | import { VideoFileModel } from '../models/video/video-file' | ||
12 | import { CONFIG } from '../initializers/config' | 10 | import { CONFIG } from '../initializers/config' |
11 | import { HLS_STREAMING_PLAYLIST_DIRECTORY, P2P_MEDIA_LOADER_PEER_VERSION } from '../initializers/constants' | ||
13 | import { sequelizeTypescript } from '../initializers/database' | 12 | import { sequelizeTypescript } from '../initializers/database' |
14 | import { MVideoWithFile } from '@server/types/models' | 13 | import { VideoFileModel } from '../models/video/video-file' |
14 | import { VideoStreamingPlaylistModel } from '../models/video/video-streaming-playlist' | ||
15 | import { getVideoFilename, getVideoFilePath } from './video-paths' | 15 | import { getVideoFilename, getVideoFilePath } from './video-paths' |
16 | 16 | ||
17 | async function updateStreamingPlaylistsInfohashesIfNeeded () { | 17 | async function updateStreamingPlaylistsInfohashesIfNeeded () { |
diff --git a/server/lib/job-queue/handlers/video-file-import.ts b/server/lib/job-queue/handlers/video-file-import.ts index f9bc3137c..18823ee9c 100644 --- a/server/lib/job-queue/handlers/video-file-import.ts +++ b/server/lib/job-queue/handlers/video-file-import.ts | |||
@@ -1,15 +1,15 @@ | |||
1 | import * as Bull from 'bull' | 1 | import * as Bull from 'bull' |
2 | import { logger } from '../../../helpers/logger' | ||
3 | import { VideoModel } from '../../../models/video/video' | ||
4 | import { publishNewResolutionIfNeeded } from './video-transcoding' | ||
5 | import { getVideoFileFPS, getVideoFileResolution } from '../../../helpers/ffmpeg-utils' | ||
6 | import { copy, stat } from 'fs-extra' | 2 | import { copy, stat } from 'fs-extra' |
7 | import { VideoFileModel } from '../../../models/video/video-file' | ||
8 | import { extname } from 'path' | 3 | import { extname } from 'path' |
9 | import { MVideoFile, MVideoWithFile } from '@server/types/models' | ||
10 | import { createTorrentAndSetInfoHash } from '@server/helpers/webtorrent' | 4 | import { createTorrentAndSetInfoHash } from '@server/helpers/webtorrent' |
11 | import { getVideoFilePath } from '@server/lib/video-paths' | 5 | import { getVideoFilePath } from '@server/lib/video-paths' |
6 | import { MVideoFile, MVideoWithFile } from '@server/types/models' | ||
12 | import { VideoFileImportPayload } from '@shared/models' | 7 | import { VideoFileImportPayload } from '@shared/models' |
8 | import { getVideoFileFPS, getVideoFileResolution } from '../../../helpers/ffprobe-utils' | ||
9 | import { logger } from '../../../helpers/logger' | ||
10 | import { VideoModel } from '../../../models/video/video' | ||
11 | import { VideoFileModel } from '../../../models/video/video-file' | ||
12 | import { publishNewResolutionIfNeeded } from './video-transcoding' | ||
13 | 13 | ||
14 | async function processVideoFileImport (job: Bull.Job) { | 14 | async function processVideoFileImport (job: Bull.Job) { |
15 | const payload = job.data as VideoFileImportPayload | 15 | const payload = job.data as VideoFileImportPayload |
diff --git a/server/lib/job-queue/handlers/video-import.ts b/server/lib/job-queue/handlers/video-import.ts index 9210aec54..5a82a8d2b 100644 --- a/server/lib/job-queue/handlers/video-import.ts +++ b/server/lib/job-queue/handlers/video-import.ts | |||
@@ -17,7 +17,7 @@ import { | |||
17 | } from '../../../../shared' | 17 | } from '../../../../shared' |
18 | import { VideoImportState } from '../../../../shared/models/videos' | 18 | import { VideoImportState } from '../../../../shared/models/videos' |
19 | import { ThumbnailType } from '../../../../shared/models/videos/thumbnail.type' | 19 | import { ThumbnailType } from '../../../../shared/models/videos/thumbnail.type' |
20 | import { getDurationFromVideoFile, getVideoFileFPS, getVideoFileResolution } from '../../../helpers/ffmpeg-utils' | 20 | import { getDurationFromVideoFile, getVideoFileFPS, getVideoFileResolution } from '../../../helpers/ffprobe-utils' |
21 | import { logger } from '../../../helpers/logger' | 21 | import { logger } from '../../../helpers/logger' |
22 | import { getSecureTorrentName } from '../../../helpers/utils' | 22 | import { getSecureTorrentName } from '../../../helpers/utils' |
23 | import { createTorrentAndSetInfoHash, downloadWebTorrentVideo } from '../../../helpers/webtorrent' | 23 | import { createTorrentAndSetInfoHash, downloadWebTorrentVideo } from '../../../helpers/webtorrent' |
diff --git a/server/lib/job-queue/handlers/video-live-ending.ts b/server/lib/job-queue/handlers/video-live-ending.ts index 599aabf80..447744224 100644 --- a/server/lib/job-queue/handlers/video-live-ending.ts +++ b/server/lib/job-queue/handlers/video-live-ending.ts | |||
@@ -1,7 +1,9 @@ | |||
1 | import * as Bull from 'bull' | 1 | import * as Bull from 'bull' |
2 | import { readdir, remove } from 'fs-extra' | 2 | import { readdir, remove } from 'fs-extra' |
3 | import { join } from 'path' | 3 | import { join } from 'path' |
4 | import { getDurationFromVideoFile, getVideoFileResolution, hlsPlaylistToFragmentedMP4 } from '@server/helpers/ffmpeg-utils' | 4 | import { hlsPlaylistToFragmentedMP4 } from '@server/helpers/ffmpeg-utils' |
5 | import { getDurationFromVideoFile, getVideoFileResolution } from '@server/helpers/ffprobe-utils' | ||
6 | import { generateVideoMiniature } from '@server/lib/thumbnail' | ||
5 | import { publishAndFederateIfNeeded } from '@server/lib/video' | 7 | import { publishAndFederateIfNeeded } from '@server/lib/video' |
6 | import { getHLSDirectory } from '@server/lib/video-paths' | 8 | import { getHLSDirectory } from '@server/lib/video-paths' |
7 | import { generateHlsPlaylist } from '@server/lib/video-transcoding' | 9 | import { generateHlsPlaylist } from '@server/lib/video-transcoding' |
@@ -12,7 +14,6 @@ import { VideoStreamingPlaylistModel } from '@server/models/video/video-streamin | |||
12 | import { MStreamingPlaylist, MVideo, MVideoLive } from '@server/types/models' | 14 | import { MStreamingPlaylist, MVideo, MVideoLive } from '@server/types/models' |
13 | import { ThumbnailType, VideoLiveEndingPayload, VideoState } from '@shared/models' | 15 | import { ThumbnailType, VideoLiveEndingPayload, VideoState } from '@shared/models' |
14 | import { logger } from '../../../helpers/logger' | 16 | import { logger } from '../../../helpers/logger' |
15 | import { generateVideoMiniature } from '@server/lib/thumbnail' | ||
16 | 17 | ||
17 | async function processVideoLiveEnding (job: Bull.Job) { | 18 | async function processVideoLiveEnding (job: Bull.Job) { |
18 | const payload = job.data as VideoLiveEndingPayload | 19 | const payload = job.data as VideoLiveEndingPayload |
diff --git a/server/lib/job-queue/handlers/video-transcoding.ts b/server/lib/job-queue/handlers/video-transcoding.ts index 843a9f1b5..b6b8d9071 100644 --- a/server/lib/job-queue/handlers/video-transcoding.ts +++ b/server/lib/job-queue/handlers/video-transcoding.ts | |||
@@ -9,7 +9,7 @@ import { | |||
9 | VideoTranscodingPayload | 9 | VideoTranscodingPayload |
10 | } from '../../../../shared' | 10 | } from '../../../../shared' |
11 | import { retryTransactionWrapper } from '../../../helpers/database-utils' | 11 | import { retryTransactionWrapper } from '../../../helpers/database-utils' |
12 | import { computeResolutionsToTranscode } from '../../../helpers/ffmpeg-utils' | 12 | import { computeResolutionsToTranscode } from '../../../helpers/ffprobe-utils' |
13 | import { logger } from '../../../helpers/logger' | 13 | import { logger } from '../../../helpers/logger' |
14 | import { CONFIG } from '../../../initializers/config' | 14 | import { CONFIG } from '../../../initializers/config' |
15 | import { sequelizeTypescript } from '../../../initializers/database' | 15 | import { sequelizeTypescript } from '../../../initializers/database' |
diff --git a/server/lib/live-manager.ts b/server/lib/live-manager.ts index feb6c5275..4d2e9b1b3 100644 --- a/server/lib/live-manager.ts +++ b/server/lib/live-manager.ts | |||
@@ -4,13 +4,8 @@ import { FfmpegCommand } from 'fluent-ffmpeg' | |||
4 | import { ensureDir, stat } from 'fs-extra' | 4 | import { ensureDir, stat } from 'fs-extra' |
5 | import { basename } from 'path' | 5 | import { basename } from 'path' |
6 | import { isTestInstance } from '@server/helpers/core-utils' | 6 | import { isTestInstance } from '@server/helpers/core-utils' |
7 | import { | 7 | import { runLiveMuxing, runLiveTranscoding } from '@server/helpers/ffmpeg-utils' |
8 | computeResolutionsToTranscode, | 8 | import { computeResolutionsToTranscode, getVideoFileFPS, getVideoFileResolution } from '@server/helpers/ffprobe-utils' |
9 | getVideoFileFPS, | ||
10 | getVideoFileResolution, | ||
11 | runLiveMuxing, | ||
12 | runLiveTranscoding | ||
13 | } from '@server/helpers/ffmpeg-utils' | ||
14 | import { logger } from '@server/helpers/logger' | 9 | import { logger } from '@server/helpers/logger' |
15 | import { CONFIG, registerConfigChangedHandler } from '@server/initializers/config' | 10 | import { CONFIG, registerConfigChangedHandler } from '@server/initializers/config' |
16 | import { MEMOIZE_TTL, P2P_MEDIA_LOADER_PEER_VERSION, VIDEO_LIVE, VIEW_LIFETIME, WEBSERVER } from '@server/initializers/constants' | 11 | import { MEMOIZE_TTL, P2P_MEDIA_LOADER_PEER_VERSION, VIDEO_LIVE, VIEW_LIFETIME, WEBSERVER } from '@server/initializers/constants' |
diff --git a/server/lib/video-transcoding.ts b/server/lib/video-transcoding.ts index 9882a14db..ca969b235 100644 --- a/server/lib/video-transcoding.ts +++ b/server/lib/video-transcoding.ts | |||
@@ -4,15 +4,8 @@ import { createTorrentAndSetInfoHash } from '@server/helpers/webtorrent' | |||
4 | import { MStreamingPlaylistFilesVideo, MVideoFile, MVideoWithAllFiles, MVideoWithFile } from '@server/types/models' | 4 | import { MStreamingPlaylistFilesVideo, MVideoFile, MVideoWithAllFiles, MVideoWithFile } from '@server/types/models' |
5 | import { VideoResolution } from '../../shared/models/videos' | 5 | import { VideoResolution } from '../../shared/models/videos' |
6 | import { VideoStreamingPlaylistType } from '../../shared/models/videos/video-streaming-playlist.type' | 6 | import { VideoStreamingPlaylistType } from '../../shared/models/videos/video-streaming-playlist.type' |
7 | import { | 7 | import { transcode, TranscodeOptions, TranscodeOptionsType } from '../helpers/ffmpeg-utils' |
8 | canDoQuickTranscode, | 8 | import { canDoQuickTranscode, getDurationFromVideoFile, getMetadataFromFile, getVideoFileFPS } from '../helpers/ffprobe-utils' |
9 | getDurationFromVideoFile, | ||
10 | getMetadataFromFile, | ||
11 | getVideoFileFPS, | ||
12 | transcode, | ||
13 | TranscodeOptions, | ||
14 | TranscodeOptionsType | ||
15 | } from '../helpers/ffmpeg-utils' | ||
16 | import { logger } from '../helpers/logger' | 9 | import { logger } from '../helpers/logger' |
17 | import { CONFIG } from '../initializers/config' | 10 | import { CONFIG } from '../initializers/config' |
18 | import { HLS_STREAMING_PLAYLIST_DIRECTORY, P2P_MEDIA_LOADER_PEER_VERSION, WEBSERVER } from '../initializers/constants' | 11 | import { HLS_STREAMING_PLAYLIST_DIRECTORY, P2P_MEDIA_LOADER_PEER_VERSION, WEBSERVER } from '../initializers/constants' |