Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

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

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-smi reports compute capability major <= 5 (Maxwell-class and older), --ocr-engine auto prefers pp-ocr-v3 and 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 auto and verify provider availability with probe logs; if providers are unavailable, OCR falls back to CPU/Tesseract path

OCR performance and validation artifacts


  1. NVIDIA FFmpeg acceleration guide: https://docs.nvidia.com/video-technologies/video-codec-sdk/13.0/ffmpeg-with-nvidia-gpu/index.html. ↩2

  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

  3. FFmpeg h264_qsv / hevc_qsv encoder options: https://ffmpeg.org/ffmpeg-codecs.html#QSV-Encoders. ↩2

  4. FFmpeg h264_vaapi / hevc_vaapi encoder options: https://ffmpeg.org/ffmpeg-codecs.html#VAAPI-encoders. ↩2

  5. Apple VideoToolbox framework: https://developer.apple.com/documentation/videotoolbox. ↩2 ↩3

  6. AMD AMF SDK: https://github.com/GPUOpen-LibrariesAndSDKs/AMF. ↩2 ↩3

  7. NVIDIA Video encode/decode support matrix: https://developer.nvidia.com/video-encode-and-decode-gpu-support-matrix-new.

  8. Intel oneVPL supported hardware: https://www.intel.com/content/www/us/en/docs/onevpl/upgrade-from-msdk/2021-3/supported-hardware.html.

  9. ONNX Runtime CUDA execution provider: https://onnxruntime.ai/docs/execution-providers/CUDA-ExecutionProvider.html.

  10. ONNX Runtime DirectML execution provider: https://onnxruntime.ai/docs/execution-providers/DirectML-ExecutionProvider.html.

  11. ONNX Runtime CoreML execution provider: https://onnxruntime.ai/docs/execution-providers/CoreML-ExecutionProvider.html.

  12. NVIDIA CUDA GPU compute capability list: https://developer.nvidia.com/cuda-gpus/.