ffmpeg auto thread
Set thread count to 0 and ffmpeg will chose automaticaly
This commit is contained in:
parent
19ca8ca939
commit
991feec9a3
|
@ -29,6 +29,7 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit {
|
||||||
{ value: 50 * 1024 * 1024 * 1024, label: '50GB' }
|
{ value: 50 * 1024 * 1024 * 1024, label: '50GB' }
|
||||||
]
|
]
|
||||||
transcodingThreadOptions = [
|
transcodingThreadOptions = [
|
||||||
|
{ value: 0, label: 'auto (not optimized)' },
|
||||||
{ value: 1, label: '1' },
|
{ value: 1, label: '1' },
|
||||||
{ value: 2, label: '2' },
|
{ value: 2, label: '2' },
|
||||||
{ value: 4, label: '4' },
|
{ value: 4, label: '4' },
|
||||||
|
|
|
@ -86,8 +86,10 @@ function transcode (options: TranscodeOptions) {
|
||||||
return new Promise<void>(async (res, rej) => {
|
return new Promise<void>(async (res, rej) => {
|
||||||
let command = ffmpeg(options.inputPath, { 'niceness': FFMPEG_NICE.TRANSCODING })
|
let command = ffmpeg(options.inputPath, { 'niceness': FFMPEG_NICE.TRANSCODING })
|
||||||
.output(options.outputPath)
|
.output(options.outputPath)
|
||||||
.outputOption('-threads ' + CONFIG.TRANSCODING.THREADS)
|
|
||||||
.preset(standard)
|
.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)
|
let fps = await getVideoFileFPS(options.inputPath)
|
||||||
if (options.resolution !== undefined) {
|
if (options.resolution !== undefined) {
|
||||||
|
|
Loading…
Reference in New Issue