Skip to content

Instantly share code, notes, and snippets.

@sophiawisdom
Last active March 17, 2024 13:30
Show Gist options
  • Select an option

  • Save sophiawisdom/d203309814044771fbc61474be467cd6 to your computer and use it in GitHub Desktop.

Select an option

Save sophiawisdom/d203309814044771fbc61474be467cd6 to your computer and use it in GitHub Desktop.
First, `pip3 install PyObjc`, then run this script!
import VideoToolbox
for variable in dir(VideoToolbox):
# https://developer.apple.com/documentation/coremedia/1564239-video_codec_constants?language=objc
if not variable.startswith("kCMVideoCodecType_"): continue
num = getattr(VideoToolbox, variable)
# https://twitter.com/never_released/status/1769353248484258158
VideoToolbox.VTRegisterSupplementalVideoDecoderIfAvailable(num)
# https://developer.apple.com/documentation/videotoolbox/2887343-vtishardwaredecodesupported?language=objc
print(f"{variable[18:]}:\t{VideoToolbox.VTIsHardwareDecodeSupported(num)}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment