From 96d4d490b11b1205af055dda711887c4d14fe3d9 Mon Sep 17 00:00:00 2001 From: Ross Patterson Date: Mon, 12 Aug 2019 01:07:40 -0700 Subject: [PATCH] Detect: Fix handling of GPUs not listed in hwaccel APIs For example, Windows remote desktop --- ffmpeg/_detect.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ffmpeg/_detect.py b/ffmpeg/_detect.py index 463174a..e2e8316 100644 --- a/ffmpeg/_detect.py +++ b/ffmpeg/_detect.py @@ -166,8 +166,10 @@ def detect_hwaccels(hwaccels=None, cmd='ffmpeg'): gpus = detect_gpus() api_avail = set() for gpu in gpus: - api_avail.update( - data['hwaccels']['api_avail'][plat_sys][gpu['vendor']]) + vendor_apis = data['hwaccels']['api_avail'][plat_sys].get( + gpu['vendor']) + if vendor_apis: + api_avail.update(vendor_apis) hwaccels = [ hwaccel for hwaccel in hwaccels if hwaccel['name'] in api_avail]