From f7c18ccc4ec0b6bafcce5fcb2485aa7d4269495e Mon Sep 17 00:00:00 2001 From: oshinongit Date: Thu, 15 Aug 2024 14:14:32 +0200 Subject: [PATCH] fix: choose correct bitrate file for pairing --- src/pairVmaf.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pairVmaf.ts b/src/pairVmaf.ts index 57d6cf0..9ff0aa7 100644 --- a/src/pairVmaf.ts +++ b/src/pairVmaf.ts @@ -59,7 +59,9 @@ export async function pairVmafWithResolutionAndBitrate( const width = parseInt(widthStr); const height = parseInt(heightStr); - const bitrate = bitrates ? bitrates[filename] : parseInt(bitrateStr); + const bitrate = bitrates + ? bitrates[filename.replace('_metadata.json', '.json')] + : parseInt(bitrateStr); const cpuTime = cpuTimes ? cpuTimes[filename] : undefined; if (filterFunction(bitrate, { width, height }, vmaf)) {