aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/ffmpeg-utils.ts
diff options
context:
space:
mode:
authorJorropo <jorropo.pgm@gmail.com>2018-07-27 11:45:05 +0200
committerChocobozzz <me@florianbigard.com>2018-08-01 10:57:13 +0200
commit80bc88c1330c5cf6f5da0ec9252f905e30037f59 (patch)
treea0a6f5b4b39687b74c538693e2ee30c7c2c3d573 /server/helpers/ffmpeg-utils.ts
parent4a5ccac5f1df4cbe1f016d1b6aad0a334bba33ae (diff)
downloadPeerTube-80bc88c1330c5cf6f5da0ec9252f905e30037f59.tar.gz
PeerTube-80bc88c1330c5cf6f5da0ec9252f905e30037f59.tar.zst
PeerTube-80bc88c1330c5cf6f5da0ec9252f905e30037f59.zip
Nice ffmpeg to 15 and 2
Niceness 15 for video conversionNiceness 2 for image generation (niceness 2 doesn't make it slower, just don't block servers and other app)
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