Hardware Acceleration
This chapter covers GPU acceleration in direct_play_nice for:
- H.264/HEVC hardware transcoding via FFmpeg encoders
- AI OCR for bitmap subtitle streams (PGS/VobSub/DVD)
Transcoding acceleration
direct_play_nice hardware encoder selection is currently targeted at H.264
and HEVC output.
Codec and hardware mapping implemented by the CLI
- H.264 hardware encoders:
h264_nvenc,h264_qsv,h264_vaapi,h264_videotoolbox,h264_amf1 2 3 4 5 6 - HEVC hardware encoders:
hevc_nvenc,hevc_qsv,hevc_vaapi,hevc_videotoolbox,hevc_amf1 2 3 4 5 6 - Backend availability is OS/build dependent and discovered at runtime7 8 6 5
You can inspect your current host/build support with:
direct_play_nice --probe-hw --probe-codecs --only-video --only-hw --probe-json
Transcoding performance and validation artifacts
- NVENC end-to-end matrix test validates profile/level/bitrate/device behavior:
- NVENC regression tests:
OCR acceleration (bitmap subtitles)
direct_play_nice uses ONNX Runtime providers for PP-OCR and has explicit
legacy-NVIDIA logic in auto mode.
What is supported in this project
- NVIDIA CUDA path for PP-OCRv3/PP-OCRv4 (primary validated path)
- Legacy NVIDIA behavior: if
nvidia-smireports compute capability major<= 5(Maxwell-class and older),--ocr-engine autopreferspp-ocr-v3and disables classifier for stability - Windows DirectML and Apple CoreML provider paths are wired and can be used when runtimes are installed9 10 11
- CPU fallback is available (or forced with
DPN_OCR_FORCE_CPU=1)
OCR workload guidance by hardware class
- Older NVIDIA families (Maxwell/Pascal-era systems): prefer
--ocr-engine pp-ocr-v312 - Newer NVIDIA families (Turing/Ampere/Ada): start with
--ocr-engine pp-ocr-v4 - Non-NVIDIA GPUs: use
autoand verify provider availability with probe logs; if providers are unavailable, OCR falls back to CPU/Tesseract path
OCR performance and validation artifacts
- Full-movie OCR benchmark (self-hosted Linux, PP-OCRv3 GPU-required profile):
87.62 FPS,3.65xrealtime - OCR AI/GPU paths are covered in integration tests:
-
NVIDIA FFmpeg acceleration guide: https://docs.nvidia.com/video-technologies/video-codec-sdk/13.0/ffmpeg-with-nvidia-gpu/index.html. ↩ ↩2
-
NVIDIA NVENC programming guide: https://docs.nvidia.com/video-technologies/video-codec-sdk/13.0/nvenc-video-encoder-api-prog-guide/index.html. ↩ ↩2
-
FFmpeg
h264_qsv/hevc_qsvencoder options: https://ffmpeg.org/ffmpeg-codecs.html#QSV-Encoders. ↩ ↩2 -
FFmpeg
h264_vaapi/hevc_vaapiencoder options: https://ffmpeg.org/ffmpeg-codecs.html#VAAPI-encoders. ↩ ↩2 -
Apple VideoToolbox framework: https://developer.apple.com/documentation/videotoolbox. ↩ ↩2 ↩3
-
AMD AMF SDK: https://github.com/GPUOpen-LibrariesAndSDKs/AMF. ↩ ↩2 ↩3
-
NVIDIA Video encode/decode support matrix: https://developer.nvidia.com/video-encode-and-decode-gpu-support-matrix-new. ↩
-
Intel oneVPL supported hardware: https://www.intel.com/content/www/us/en/docs/onevpl/upgrade-from-msdk/2021-3/supported-hardware.html. ↩
-
ONNX Runtime CUDA execution provider: https://onnxruntime.ai/docs/execution-providers/CUDA-ExecutionProvider.html. ↩
-
ONNX Runtime DirectML execution provider: https://onnxruntime.ai/docs/execution-providers/DirectML-ExecutionProvider.html. ↩
-
ONNX Runtime CoreML execution provider: https://onnxruntime.ai/docs/execution-providers/CoreML-ExecutionProvider.html. ↩
-
NVIDIA CUDA GPU compute capability list: https://developer.nvidia.com/cuda-gpus/. ↩