diff options
Diffstat (limited to 'server/helpers/ffmpeg-utils.ts')
-rw-r--r-- | server/helpers/ffmpeg-utils.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/server/helpers/ffmpeg-utils.ts b/server/helpers/ffmpeg-utils.ts index 13bce7d30..ab187aa59 100644 --- a/server/helpers/ffmpeg-utils.ts +++ b/server/helpers/ffmpeg-utils.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import * as ffmpeg from 'fluent-ffmpeg' | 1 | import * as ffmpeg from 'fluent-ffmpeg' |
2 | import { join } from 'path' | 2 | import { join } from 'path' |
3 | import { VideoResolution } from '../../shared/models/videos' | 3 | import { VideoResolution } from '../../shared/models/videos' |
4 | import { CONFIG, VIDEO_TRANSCODING_FPS } from '../initializers' | 4 | import { CONFIG, VIDEO_TRANSCODING_FPS, FFMPEG_NICE } from '../initializers' |
5 | import { unlinkPromise } from './core-utils' | 5 | import { unlinkPromise } from './core-utils' |
6 | import { processImage } from './image-utils' | 6 | import { processImage } from './image-utils' |
7 | import { logger } from './logger' | 7 | import { logger } from './logger' |
@@ -56,7 +56,7 @@ async function generateImageFromVideoFile (fromPath: string, folder: string, ima | |||
56 | 56 | ||
57 | try { | 57 | try { |
58 | await new Promise<string>((res, rej) => { | 58 | await new Promise<string>((res, rej) => { |
59 | ffmpeg(fromPath) | 59 | ffmpeg(fromPath, { 'niceness': FFMPEG_NICE.THUMBNAIL }) |
60 | .on('error', rej) | 60 | .on('error', rej) |
61 | .on('end', () => res(imageName)) | 61 | .on('end', () => res(imageName)) |
62 | .thumbnail(options) | 62 | .thumbnail(options) |
@@ -84,7 +84,7 @@ type TranscodeOptions = { | |||
84 | 84 | ||
85 | function transcode (options: TranscodeOptions) { | 85 | function transcode (options: TranscodeOptions) { |
86 | return new Promise<void>(async (res, rej) => { | 86 | return new Promise<void>(async (res, rej) => { |
87 | let command = ffmpeg(options.inputPath) | 87 | let command = ffmpeg(options.inputPath, { 'niceness': FFMPEG_NICE.TRANSCODING }) |
88 | .output(options.outputPath) | 88 | .output(options.outputPath) |
89 | .outputOption('-threads ' + CONFIG.TRANSCODING.THREADS) | 89 | .outputOption('-threads ' + CONFIG.TRANSCODING.THREADS) |
90 | .renice(5) // we don't want to make the system unrepsonsive | 90 | .renice(5) // we don't want to make the system unrepsonsive |