Skip to content

AllastorV/Cuda-ntscqt

Repository files navigation

CUDA/NVENC Enhanced Fork

The CUDA-supported version of the VHS video emulation program NTSCQT.I'm not very good at coding, so it's an AI-supported project. You can access the original project via this: JargeZ/ntscqt.

This fork brings optional GPU acceleration (CUDA/CuPy) and a faster FFmpeg streaming pipeline (NVDEC/NVENC) to the original ntscQT. You can still use the classic CPU path — all GPU features are opt‑in and have safe fallbacks.

New In This Fork

  • CUDA acceleration (optional, toggle in UI)
    • GPU implementations for heavy stages: Ringing/Ringing2, BGR↔YIQ conversion, composite chroma lowpass (lite), VHS luma/chroma lowpass, VHS chroma vertical blend.
    • Falls back to CPU when CUDA is unavailable.
  • NVENC/NVDEC streaming pipeline (optional)
    • Streams raw frames directly to FFmpeg and encodes with h264_nvenc (no temp files), while copying/encoding audio in the same pass.
    • Uses NVDEC (GPU decode) + scale_cuda when available; automatically falls back to the legacy reader if not.
  • Drag & drop file opening.
  • Dark mode toggle that persists independently from system theme.
  • Audio handling improvements
    • For MP4 outputs, unsupported input codecs are automatically transcoded to AAC — otherwise audio is copied.
    • If FFmpeg is missing, the app writes video via OpenCV and attempts a post‑mux when FFmpeg later becomes available.

Requirements

  • Python with the repo requirements installed.
  • FFmpeg with NVENC/NVDEC on PATH (for best performance).
    • Windows (PowerShell): choco install ffmpeg -y or winget install ffmpeg.ffmpeg
    • Verify: ffmpeg -hide_banner -encoders | findstr nvenc should list h264_nvenc.
  • CUDA + CuPy (optional, for GPU compute): pip install cupy-cuda12x (CUDA 12.x).

Quick Start

  1. Install dependencies (and optional CuPy):
    • pip install -r requirements.txt
    • pip install cupy-cuda12x (optional, for CUDA compute)
  2. Ensure FFmpeg is installed and on PATH (see above).
  3. Run the app: python ntscQT.py
  4. In the UI, open a video (or drag & drop), then enable:
    • Use CUDA (experimental)
    • Use NVENC (NVIDIA)
  5. For maximum speed:
    • Disable LivePreview
    • Keep Render Height reasonable; optionally enable x2 nearest upscaling

Performance Tips

  • Both toggles (CUDA + NVENC) should be ON for best results.
  • Higher render resolutions increase GPU utilization (within VRAM limits).
  • NVENC is tuned for speed (preset p1, constQP, qp≈22). You can increase qp to 24–26 for even faster encodes.

Troubleshooting

  • FFmpeg not found
    • The app falls back to a CPU‑only writer; video renders without audio. Install FFmpeg to regain audio + NVENC speed.
  • No audio in MP4 output
    • With FFmpeg present, the app will transcode unsupported input codecs to AAC automatically. Verify FFmpeg is on PATH.
  • Low GPU usage
    • Ensure both toggles are ON, CuPy is installed, and the render resolution is not too small. Confirm h264_nvenc is available.

About

The CUDA-supported version of the VHS video emulation program NTSCQT.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published