Skip to main content

FFmpeg Hardware Codec Detect Script(HwCodecDetect)

中文版

Today's hardware-accelerated video codec landscape is a "field of a hundred schools of thought." To leverage the immense power of GPUs, hardware manufacturers have introduced their own acceleration frameworks and encoding standards, such as NVIDIA's NVEnc/NVDec, Intel's QSV, and AMD's AMF. Additionally, operating systems provide universal APIs like Microsoft's Media Foundation, DXVA2, and D3D12VA, while the open-source community has developed cross-platform standards like VAAPI and Vulkan.

While this diversity drives technological progress, it also presents a challenge for users and developers. Due to historical issues and compatibility quirks, a single piece of hardware might support multiple encoders, but they can differ significantly in performance, supported formats, and resolutions. As a result, when using FFmpeg for hardware acceleration, it's not always clear which encoder is best suited for a specific device.

This project was created to solve this very problem. It's a convenient tool for automatically detecting the hardware video encoder capabilities of your system. Using FFmpeg, it generates single-frame video files at various resolutions (from 240p to 8K) and attempts to process them with different hardware encoders. This allows it to quickly determine which hardware encoders are available on your system and what resolutions they support.

Key Features

Encoders

The script automatically detect and reports on the following major hardware encoders and their supported formats:

Encoder Name Supported Video Formats
NVEnc H.264、H.265、AV1
QSV (Quick Sync Video) H.264、H.265、AV1、MJPEG、MPEG-2、VP9
AMF (Advanced Media Framework) H.264、H.265、AV1
Media Foundation H.264、H.265
D3D12VA (Direct3D 12 Video Acceleration) H.265
VAAPI (Video Acceleration API) H.264、H.265、AV1、MJPEG、MPEG-2、VP8、VP9
Vulkan H.264、H.265
Apple VideoToolbox H.264、H.265

Decoders

The script automatically detect and reports on the following major hardware decoders and their supported formats:

Decoder Name Supported Video Formats
NVDec (CUVID) H.264、H.265、AV1、MJPEG、MPEG-1、MPEG-2、MPEG-4、VP8、VP9
QSV (Quick Sync Video) H.264、H.265、AV1、MJPEG、MPEG-2、VP8、VP9
AMF (Advanced Media Framework) H.264、H.265、AV1
DXVA2 (DirectX Video Acceleration) H.264、H.265、MJPEG、MPEG-1、MPEG-2、MPEG-4、VP8
D3D11VA (Direct3D 11 Video Acceleration) H.264、H.265、AV1、MJPEG、MPEG-1、MPEG-2、MPEG-4、VP8、VP9
Vulkan H.264、H.265、AV1
Apple VideoToolbox H.264、H.265、MPEG-2、MPEG-4

How to Use

You can install and use HwCodecDetect in two ways.

This is the easiest method if you just want to use the tool quickly.

  1. Install: Use pip to install hwcodecdetect from the official PyPI repository.

    pip install hwcodecdetect
    
  2. Run: After installation, run the hwcodecdetect command directly from your terminal.

    hwcodecdetect
    

Method 2: Download and Run Executable (Standalone)

Use this method if you prefer to run the tool without installing Python dependencies, or if the PyPI installation fails.

  1. Download: Go to the project's Releases page and download the executable file corresponding to your operating system (e.g., HwCodecDetect-Linux-x64, HwCodecDetect-Windows-x64.exe).

  2. (Linux/macOS only) Add Execute Permission: If you are on Linux or macOS, you need to grant the downloaded file execute permission.

    # Replace 'HwCodecDetect-Linux-x64' with the actual downloaded filename
    chmod +x HwCodecDetect-Linux-x64
    
  3. Run: Execute the file directly from your terminal.

    # For Linux/macOS
    ./HwCodecDetect-Linux-x64
    
    # For Windows (e.g., in PowerShell or Command Prompt)
    .\HwCodecDetect-Windows-x64.exe
    

Method 3: Install from Source

Use this method if you have cloned the project source code from GitHub and want to run it locally.

  1. Clone the repository: First, clone the project source code to your local machine.

    git clone https://github.com/whyb/HwCodecDetect.git ./HwCodecDetect
    
  2. Install dependencies: Navigate into the project's root directory and use pip to install the required dependencies.

    cd HwCodecDetect
    pip install .
    
  3. Run: After the installation is complete, run the hwcodecdetect command directly.

    hwcodecdetect
    

Final effect

Here are some possible results from a local test run: test result

Star History

Star History Chart

Metadata

Release files for HwCodecDetect 0.1.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for HwCodecDetect 0.1.8
File Size Uploaded Provenance Actions
hwcodecdetect-0.1.8.tar.gz 18.3 kB With provenance Details for hwcodecdetect-0.1.8.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for HwCodecDetect 0.1.8
File Interpreter ABI Platform Actions
hwcodecdetect-0.1.8-py3-none-any.whl Python 3 none any Details for hwcodecdetect-0.1.8-py3-none-any.whl

Total release size: 33.8 kB

Release files / hwcodecdetect-0.1.8.tar.gz

Download URL hwcodecdetect-0.1.8.tar.gz
Size 18.3 kB
Tags Source
SHA-256 checksum
How to use checksums
f547bae28af9618e2d95706d646a198c92760bf987f99d869c8031d632b1affa
BLAKE2b-256 checksum
How to use checksums
d4ac2a04b8ca7a969fb7780c2f2f1004ee45ae1f9725744eb125c6e9b8015320
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 26, 2025.

Transparency log

Release files / hwcodecdetect-0.1.8-py3-none-any.whl

Download URL hwcodecdetect-0.1.8-py3-none-any.whl
Size 15.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
41be176e09a0c444ada88fb6b09fe02fec7e82ade136d4a9b44c6d9232556ebb
BLAKE2b-256 checksum
How to use checksums
2091e76b9bdd7d5c0b9637fa55c7a573c111ff466bc6363901307b8501015ef0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 26, 2025.

Transparency log

Security for HwCodecDetect 0.1.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for hwcodecdetect-0.1.8.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 26, 2025.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.8 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page