fix: Increase width tolerance for frame class matching to accommodate ultrawide aspect ratios
This commit is contained in:
@@ -90,10 +90,11 @@ class MediaInfoExtractor:
|
|||||||
effective_height = height
|
effective_height = height
|
||||||
|
|
||||||
# First, try to match width to typical widths
|
# First, try to match width to typical widths
|
||||||
|
# Use a larger tolerance (10 pixels) to handle cinema/ultrawide aspect ratios
|
||||||
width_matches = []
|
width_matches = []
|
||||||
for frame_class, info in FRAME_CLASSES.items():
|
for frame_class, info in FRAME_CLASSES.items():
|
||||||
for tw in info['typical_widths']:
|
for tw in info['typical_widths']:
|
||||||
if abs(width - tw) <= 5 and frame_class.endswith(scan_type):
|
if abs(width - tw) <= 10 and frame_class.endswith(scan_type):
|
||||||
diff = abs(height - info['nominal_height'])
|
diff = abs(height - info['nominal_height'])
|
||||||
width_matches.append((frame_class, diff))
|
width_matches.append((frame_class, diff))
|
||||||
|
|
||||||
|
|||||||
@@ -148,5 +148,11 @@
|
|||||||
"interlaced": false,
|
"interlaced": false,
|
||||||
"expected_frame_class": "1080p",
|
"expected_frame_class": "1080p",
|
||||||
"testname": "test-mistakenly-high-height"
|
"testname": "test-mistakenly-high-height"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"resolution": [1912,798],
|
||||||
|
"interlaced": false,
|
||||||
|
"expected_frame_class": "1080p",
|
||||||
|
"testname": "test-mistakenly-high-height-2"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
Reference in New Issue
Block a user