Skip to content

Add hardware acceleration#525

Open
webysther wants to merge 9 commits intoC4illin:mainfrom
webysther:hwa
Open

Add hardware acceleration#525
webysther wants to merge 9 commits intoC4illin:mainfrom
webysther:hwa

Conversation

@webysther
Copy link

@webysther webysther commented Jan 28, 2026

Recording2026-01-280348031-ezgif com-video-to-gif-converter

make this pr obsolete: #480
fix #523
add drivers, need configuration to fix #518

Testing: ghcr.io/webysther/convertx:hwa

docker compose for intel:

services:
  convertx:
    image: ghcr.io/webysther/convertx:hwa
    environment:
      FFMPEG_ARGS: -hwaccel qsv
    devices:
      - /dev/dri:/dev/dri
    ...

Same as documentation in lsio for intel, amd and others. We need volunteer to test with gpu.

Using Lsio base
Suport for AMD, Intel, Nvidia and others
  Parse FFMPEG_ARGS and FFMPEG_OUTPUT_ARGS into arrays
  Detect 'qsv' and 'cuda' flags and map codecs to
  Hardware encoders (h264_qsv/hevc_qsv and h264_nvenc/hevc_nvenc)
  Make codec_short mutable to allow reassignment
  Log constructed ffmpeg command for visibility
  Enables runtime custom ffmpeg args and hw encoder selection
  Improves deployment flexibility and performance tuning
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 issues found across 2 files

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="Dockerfile">

<violation number="1" location="Dockerfile:52">
P2: Hard-coded x86_64 multiarch paths in buildstage and LIBVA_DRIVERS_PATH break arm64 builds and VAAPI driver discovery when building for aarch64.</violation>
</file>

<file name="src/converters/ffmpeg.ts">

<violation number="1" location="src/converters/ffmpeg.ts:751">
P2: CUDA hardware acceleration cases incorrectly select Intel QSV encoders instead of NVIDIA NVENC encoders.</violation>

<violation number="2" location="src/converters/ffmpeg.ts:761">
P2: Incorrect removal of hardware-accel args: slice keeps only the element before -hwaccel and drops all other args instead of removing -hwaccel and its value.</violation>
</file>

Since this is your first cubic review, here's how it works:

  • cubic automatically reviews your code and comments on bugs and improvements
  • Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
  • Ask questions if you need clarification on any suggestion

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

webysther and others added 3 commits January 28, 2026 05:00
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
@C4illin
Copy link
Owner

C4illin commented Jan 30, 2026

The arm image fails to build

@webysther
Copy link
Author

The arm image fails to build

I don't have arm here, the lsio have another dockerfile for it. There something I can do to solve fix this?

@webysther
Copy link
Author

webysther commented Jan 30, 2026

The arm image fails to build

As you can see here (https://github.com/linuxserver/docker-ffmpeg/blob/master/Dockerfile.aarch64) they use a dockerfile specialized for arm, because the drivers change. We need to do the same or drop support for arm in the next release until we change the workflow to build a arm dedicated image, this is required as the drivers differs a lot.

We need someone with arm to help with this part, I don't have a way to test in my side, sorry.

@webysther
Copy link
Author

webysther commented Jan 30, 2026

another solution, some projects use a suffix for gpu, in our case we maybe build another image with the suffix of -gpu like ollama do.

Example:

image https://github.com/imagegenius/docker-immich

@aryasenna
Copy link

aryasenna commented Feb 2, 2026

We need volunteer to test with GPU.

Hi, I tested your build with:

  1. Intel iGPU P630
  2. Nvidia RTX 3600

H264.mp4 and H265.mp4 transcoding (encode + decode) works.

As for the ARM build failing: I don't think even Nvidia has an ARM driver and nvenc library yet for their dedicated GPUs. (There is one for their Tegra and Jetson SoCs, but I'm not sure if it's a relevant platform for ConvertX).

The OSS Nouveau driver has ARM support but doesn't appear to support encoding yet (it's decode only using VDPAU).

Maybe it makes sense to just not include the conflicting Nvidia driver/ffmpeg with nvenc support in the ARM build? What do you think?

We can always make another PR once the driver and library are available.

@webysther
Copy link
Author

We need volunteer to test with GPU.

Hi, I tested your build with:

  1. Intel iGPU P630
  2. Nvidia RTX 3600

H264.mp4 and H265.mp4 transcoding (encode + decode) works.

As for the ARM build failing: I don't think even Nvidia has an ARM driver and nvenc library yet for their dedicated GPUs. (There is one for their Tegra and Jetson SoCs, but I'm not sure if it's a relevant platform for ConvertX).

The OSS Nouveau driver has ARM support but doesn't appear to support encoding yet (it's decode only using VDPAU).

Maybe it makes sense to just not include the conflicting Nvidia driver/ffmpeg with nvenc support in the ARM build? What do you think?

We can always make another PR once the driver and library are available.

yeap, can you split the dockerfile in two and edit the workflow?

@C4illin
Copy link
Owner

C4illin commented Feb 11, 2026

here is another approach: #534
ffmpeg version 8.0.1-3+b1 Copyright (c) 2000-2025 the FFmpeg developers

or is there a difference between linuxserver ffmpeg and debian ffmpeg?

@webysther
Copy link
Author

webysther commented Feb 11, 2026

here is another approach: #534 ffmpeg version 8.0.1-3+b1 Copyright (c) 2000-2025 the FFmpeg developers

or is there a difference between linuxserver ffmpeg and debian ffmpeg?

Exists, the ffmpeg is compiled from source to allow filters and functions to work well with /dev/dri (amd/intel) and nvidia. But maybe for our use case make sense only use a plain ffmpeg and see what happens.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] Add igpu support inside docker image Intel VAAPI hardware acceleration fails on Synology (DS720+) - Missing drivers in image?

3 participants