diff options
Diffstat (limited to 'server/helpers/ffmpeg/ffmpeg-options.ts')
-rw-r--r-- | server/helpers/ffmpeg/ffmpeg-options.ts | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/server/helpers/ffmpeg/ffmpeg-options.ts b/server/helpers/ffmpeg/ffmpeg-options.ts deleted file mode 100644 index 64d7c4179..000000000 --- a/server/helpers/ffmpeg/ffmpeg-options.ts +++ /dev/null | |||
@@ -1,45 +0,0 @@ | |||
1 | import { logger } from '@server/helpers/logger' | ||
2 | import { CONFIG } from '@server/initializers/config' | ||
3 | import { FFMPEG_NICE } from '@server/initializers/constants' | ||
4 | import { FFmpegCommandWrapperOptions } from '@shared/ffmpeg' | ||
5 | import { AvailableEncoders } from '@shared/models' | ||
6 | |||
7 | type CommandType = 'live' | 'vod' | 'thumbnail' | ||
8 | |||
9 | export function getFFmpegCommandWrapperOptions (type: CommandType, availableEncoders?: AvailableEncoders): FFmpegCommandWrapperOptions { | ||
10 | return { | ||
11 | availableEncoders, | ||
12 | profile: getProfile(type), | ||
13 | |||
14 | niceness: FFMPEG_NICE[type.toUpperCase()], | ||
15 | tmpDirectory: CONFIG.STORAGE.TMP_DIR, | ||
16 | threads: getThreads(type), | ||
17 | |||
18 | logger: { | ||
19 | debug: logger.debug.bind(logger), | ||
20 | info: logger.info.bind(logger), | ||
21 | warn: logger.warn.bind(logger), | ||
22 | error: logger.error.bind(logger) | ||
23 | }, | ||
24 | lTags: { tags: [ 'ffmpeg' ] } | ||
25 | } | ||
26 | } | ||
27 | |||
28 | // --------------------------------------------------------------------------- | ||
29 | // Private | ||
30 | // --------------------------------------------------------------------------- | ||
31 | |||
32 | function getThreads (type: CommandType) { | ||
33 | if (type === 'live') return CONFIG.LIVE.TRANSCODING.THREADS | ||
34 | if (type === 'vod') return CONFIG.TRANSCODING.THREADS | ||
35 | |||
36 | // Auto | ||
37 | return 0 | ||
38 | } | ||
39 | |||
40 | function getProfile (type: CommandType) { | ||
41 | if (type === 'live') return CONFIG.LIVE.TRANSCODING.PROFILE | ||
42 | if (type === 'vod') return CONFIG.TRANSCODING.PROFILE | ||
43 | |||
44 | return undefined | ||
45 | } | ||