aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJorropo <jorropo.pgm@gmail.com>2018-07-27 20:41:05 +0200
committerChocobozzz <me@florianbigard.com>2018-08-01 10:57:13 +0200
commit991feec9a3f371e28274884f7635dc2e57dca284 (patch)
treeec1e0ae9b58aa262a08f5737738bab0c40e7b479
parent19ca8ca93975d99c16ab94c1526a34be74f63b95 (diff)
downloadPeerTube-991feec9a3f371e28274884f7635dc2e57dca284.tar.gz
PeerTube-991feec9a3f371e28274884f7635dc2e57dca284.tar.zst
PeerTube-991feec9a3f371e28274884f7635dc2e57dca284.zip
ffmpeg auto thread
Set thread count to 0 and ffmpeg will chose automaticaly
-rw-r--r--client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts1
-rw-r--r--server/helpers/ffmpeg-utils.ts4
2 files changed, 4 insertions, 1 deletions
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts
index c77249a02..2edfb267e 100644
--- a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts
+++ b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts
@@ -29,6 +29,7 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit {
29 { value: 50 * 1024 * 1024 * 1024, label: '50GB' } 29 { value: 50 * 1024 * 1024 * 1024, label: '50GB' }
30 ] 30 ]
31 transcodingThreadOptions = [ 31 transcodingThreadOptions = [
32 { value: 0, label: 'auto (not optimized)' },
32 { value: 1, label: '1' }, 33 { value: 1, label: '1' },
33 { value: 2, label: '2' }, 34 { value: 2, label: '2' },
34 { value: 4, label: '4' }, 35 { value: 4, label: '4' },
diff --git a/server/helpers/ffmpeg-utils.ts b/server/helpers/ffmpeg-utils.ts
index f0e2c0af5..c170fc1a8 100644
--- a/server/helpers/ffmpeg-utils.ts
+++ b/server/helpers/ffmpeg-utils.ts
@@ -86,8 +86,10 @@ 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, { 'niceness': FFMPEG_NICE.TRANSCODING }) 87 let command = ffmpeg(options.inputPath, { 'niceness': FFMPEG_NICE.TRANSCODING })
88 .output(options.outputPath) 88 .output(options.outputPath)
89 .outputOption('-threads ' + CONFIG.TRANSCODING.THREADS)
90 .preset(standard) 89 .preset(standard)
90 if (CONFIG.TRANSCODING.THREADS > 0) {
91 command.outputOption('-threads ' + CONFIG.TRANSCODING.THREADS) // if we don't set any threads ffmpeg will chose automatically
92 }
91 93
92 let fps = await getVideoFileFPS(options.inputPath) 94 let fps = await getVideoFileFPS(options.inputPath)
93 if (options.resolution !== undefined) { 95 if (options.resolution !== undefined) {