]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
ffmpeg auto thread
authorJorropo <jorropo.pgm@gmail.com>
Fri, 27 Jul 2018 18:41:05 +0000 (20:41 +0200)
committerChocobozzz <me@florianbigard.com>
Wed, 1 Aug 2018 08:57:13 +0000 (10:57 +0200)
Set thread count to 0 and ffmpeg will chose automaticaly

client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts
server/helpers/ffmpeg-utils.ts

index c77249a0286544696daba5922d80508d6c38d463..2edfb267e83fd9e08a904f6a7df43ec8ba27f892 100644 (file)
@@ -29,6 +29,7 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit {
     { value: 50 * 1024 * 1024 * 1024, label: '50GB' }
   ]
   transcodingThreadOptions = [
+    { value: 0, label: 'auto (not optimized)' },
     { value: 1, label: '1' },
     { value: 2, label: '2' },
     { value: 4, label: '4' },
index f0e2c0af5764caff5d29746476aef246e009d922..c170fc1a89e590bcb3642aa6c01fe496fd697d98 100644 (file)
@@ -86,8 +86,10 @@ function transcode (options: TranscodeOptions) {
   return new Promise<void>(async (res, rej) => {
     let command = ffmpeg(options.inputPath, { 'niceness': FFMPEG_NICE.TRANSCODING })
                     .output(options.outputPath)
-                    .outputOption('-threads ' + CONFIG.TRANSCODING.THREADS)
                     .preset(standard)
+    if (CONFIG.TRANSCODING.THREADS > 0) {
+      command.outputOption('-threads ' + CONFIG.TRANSCODING.THREADS) // if we don't set any threads ffmpeg will chose automatically
+    }
 
     let fps = await getVideoFileFPS(options.inputPath)
     if (options.resolution !== undefined) {