feat(transcode): add Intel VA-API (Arc) GPU backend#30
Open
Pon-node wants to merge 1 commit into
Open
Conversation
Adds a full-GPU Intel VA-API path alongside the existing NVENC / CPU backends: - h264_vaapi / hevc_vaapi / av1_vaapi encoders in profiles.py (CQP rate control; VA-surface pixel format), selected via the existing --h264/h265/av1-encoder flags. - engine.py: -vaapi_device for GPU encode, and an optional HWACCEL_DECODE path (-hwaccel vaapi + scale_vaapi) that keeps decode + scale + encode all on the GPU. FFMPEG_BIN lets the image pick the ffmpeg build. - Dockerfile.intel on jellyfin-ffmpeg — distro ffmpeg's scale_vaapi / av1_qsv are broken on Arc; the jellyfin build ships the patched iHD + oneVPL stack. docker-compose.intel.yml wires it up with --device /dev/dri. - Dockerfile.gpu (NVENC CUDA base) to realize the README's "CUDA base" note. - runner.py advertises a non-NVIDIA GPU to discovery via RUNNER_GPU_* env, since register_runner auto-detects only NVIDIA. Verified on an Intel Arc A770: h264/hevc/av1 renditions all encode on the GPU; 10 concurrent AV1 sessions hold 2.7x realtime with ~92% less CPU than the sw-decode path. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a full-GPU Intel VA-API backend to the transcode app, alongside the existing NVENC / CPU paths. Motivated by running the transcoder on an Intel Arc A770.
What
profiles.py—h264_vaapi/hevc_vaapi/av1_vaapisupport invideo_args: CQP rate control (-rc_mode CQP -qp), nv12 VA-surface pixel format, chroma clamp to 4:2:0. Selected through the existing--h264/h265/av1-encoderflags.engine.py—-vaapi_devicefor GPU encode, plus an optionalHWACCEL_DECODEpath (-hwaccel vaapi -hwaccel_output_format vaapi+scale_vaapi) that keeps decode + scale + encode all on the GPU.FFMPEG_BINlets the image choose the ffmpeg build.Dockerfile.intel— built on jellyfin-ffmpeg7. Distro ffmpeg'sscale_vaapiandav1_qsvare broken on Arc (Cannot allocate memory/Invalid FrameType); the jellyfin build ships the patched iHD + oneVPL stack that fixes both.docker-compose.intel.ymlwires it up with--device /dev/dri.Dockerfile.gpu— NVENC CUDA base, realizing the README's existing "CUDA base" note (no functional change to the CPU/NVENC code paths).runner.py— advertises a non-NVIDIA GPU to orchestrator discovery viaRUNNER_GPU_*env, sinceregister_runnerauto-detects NVIDIA only (Intel runners otherwise show with nogpufield).NVENC / CPU behavior is unchanged; VA-API is purely additive and opt-in via the encoder flags +
Dockerfile.intel.Test plan
Built
Dockerfile.inteland ran the batch surface on an Intel Arc A770 (renderD129):POST /transcodewith an H264 + HEVC + AV1 ladder → all three renditions encode on the GPU, valid output (ffprobeconfirmsh264/hevc/av1).Notes
scale_vaapi+*_vaapipipeline).scale_qsv+*_qsvis an alternative that also works on jellyfin-ffmpeg, but a single VA-API pipeline is simpler and covers H264/HEVC/AV1 uniformly. On distro ffmpeg bothscale_vaapiandav1_qsvfail on Arc, which is whyDockerfile.inteluses jellyfin-ffmpeg.