@@ -8,7 +8,7 @@ import { FastStats } from './stats'
8
8
9
9
const log = logger ( 'webrtcperf:vmaf' )
10
10
11
- const cpus = Math . min ( os . cpus ( ) . length , 16 )
11
+ const cpus = os . cpus ( ) . length
12
12
13
13
export interface IvfFrame {
14
14
pts : number
@@ -73,7 +73,7 @@ export async function prepareVideo(
73
73
const textHeight = Math . round ( fontsize * 1.2 )
74
74
const filter = vmafVideoCrop ? cropFilter ( json5 . parse ( vmafVideoCrop ) , 0 , ',' ) : ''
75
75
await runShellCommand (
76
- `ffmpeg -hide_banner -loglevel warning -threads ${ cpus } \
76
+ `ffmpeg -hide_banner -loglevel warning -threads ${ Math . min ( cpus , 16 ) } \
77
77
${ videoDuration ? `-t ${ videoDuration } ` : '' } \
78
78
-i ${ fpath } \
79
79
-filter_complex "[0:v]scale=w=${ videoWidth || width } :h=${ videoHeight || height } ,fps=${ videoFramerate || frameRate } ,${ filter } \
@@ -104,7 +104,7 @@ export async function convertToIvf(fpath: string, crop?: string, keepSourceFile
104
104
await runShellCommand (
105
105
`ffmpeg -y -hide_banner -y -loglevel warning -i ${ fpath } -map 0:v \
106
106
-c:v vp8 -quality best -cpu-used 0 -crf 1 -b:v 20M -qmin 1 -qmax 10 \
107
- -g 1 -threads ${ cpus } ${ filter } -an \
107
+ -g 1 -threads ${ Math . min ( cpus , 16 ) } ${ filter } -an \
108
108
-f ivf ${ outputPath } ` ,
109
109
true ,
110
110
)
@@ -502,7 +502,7 @@ export async function runVmaf(
502
502
} ,
503
503
)
504
504
505
- const ffmpegCmd = `ffmpeg -hide_banner -loglevel warning -y -threads ${ cpus } \
505
+ const ffmpegCmd = `ffmpeg -hide_banner -loglevel warning -y -threads ${ Math . min ( cpus , 16 ) } \
506
506
-i ${ degradedPath } \
507
507
-i ${ referencePath } \
508
508
`
0 commit comments