aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/ffmpeg-utils.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/helpers/ffmpeg-utils.ts')
-rw-r--r--server/helpers/ffmpeg-utils.ts6
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 @@
1import * as ffmpeg from 'fluent-ffmpeg' 1import * as ffmpeg from 'fluent-ffmpeg'
2import { join } from 'path' 2import { join } from 'path'
3import { VideoResolution } from '../../shared/models/videos' 3import { VideoResolution } from '../../shared/models/videos'
4import { CONFIG, VIDEO_TRANSCODING_FPS } from '../initializers' 4import { CONFIG, VIDEO_TRANSCODING_FPS, FFMPEG_NICE } from '../initializers'
5import { unlinkPromise } from './core-utils' 5import { unlinkPromise } from './core-utils'
6import { processImage } from './image-utils' 6import { processImage } from './image-utils'
7import { logger } from './logger' 7import { 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
85function transcode (options: TranscodeOptions) { 85function 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