Support for Full NVIDIA Hardware Acceleration (NVENC/CUDA) #40
Replies: 4 comments 2 replies
-
|
For me it's dealing with 6K Opengate footage, which without NVENC takes hours to ingest while with NVENC it's reduced to a few minutes But even regular 4K renders get ingested many times faster with NVENC. |
Beta Was this translation helpful? Give feedback.
-
|
Hey, I figured out the bottleneck for 6K Open Gate footage. The hardcoded CPU filter_complex forces uncompressed frames across the PCIe bus, tanking performance. Projects like Unmanic (which is also Python-based) and Tdarr have open-source routing engines that dynamically swap to scale_cuda to keep the whole pipeline in VRAM. Could we look into adapting a similar hardware-path generator for Freeframe? Right now with the ffmpeg wrapper script (which already increases speed like 10x with 6k footage)
WIth a proper pipeline skipping slow software scaling and moving things around on the bus, things could be even another 2-3x faster. The wrapper-script I'm using right now: |
Beta Was this translation helpful? Give feedback.
-
|
Found a full hardware accelerated solution boosting speeds incredibly: |
Beta Was this translation helpful? Give feedback.
-
|
@ravirajsinh45 — following up on the original #37 / Discussion #40. I've now implemented a proper portable transcoder backend in What it does:
One upstream-relevant note: ConfigurationAll via env (wired through the worker
Detects PQ ( Example: I kept the PR scoped to code only — PR is up: #127 — would love a review, or guidance on what to change before it lands. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Moved from issue #37 by @deezid — converting to a discussion to gauge demand before scheduling. If you need NVENC/CUDA transcoding, please 👍 this post or leave a comment describing your workflow and GPU.
The ask
Currently, processing high-resolution masters (4K/6K) puts heavy load on the CPU. While the system may be using some hardware encoding, it appears to be a "half-CPU" implementation. For professional studio workflows using NVIDIA cards (like my 1080 Ti), we need full hardware offloading.
Steps to reproduce
Upload a video clip. Wait forever for it to finish since decoding and encoding runs on CPU.
Expected behavior
To fully utilize NVIDIA GPUs, the FFmpeg command needs to include the hardware accelerator flag before the input and the NVENC codec for the output:
```
ffmpeg -hwaccel cuda -hwaccel_output_format cuda -i input_master_6K.mov \
-vf "scale_cuda=1920:1080" \
-c:v h264_nvenc -preset p4 -tune hq -b:v 8M \
-c:a aac -b:a 192k \
output_preview_1080p.mp4
```
Requirements
Reporter's workaround
Because FreeFrame does not natively support NVENC or CUDA, the reporter is currently using a Python wrapper to intercept the app's FFmpeg calls. The wrapper replaces `libx264` with `h264_nvenc` and translates CRF values to bitrates. Full wrapper script is in the original issue #37.
Limitation: Even with the wrapper, `-threads 0` is required to scale on CPU because the internal logic doesn't support the CUDA hardware context needed for `scale_cuda`. This still results in heavy CPU usage during 6K transcodes — but the whole process is significantly faster than without.
Why this is parked (for now)
This is a sizable feature — it touches the transcoder package, Docker image, compose file, and deployment docs. Rough scope:
Before committing engineering time, we want to see how many users actually need it. If this affects your workflow, please upvote this discussion or reply with your GPU and typical source format (4K ProRes, 6K R3D, 10-bit HEVC, etc).
Beta Was this translation helpful? Give feedback.
All reactions