FFmpeg VAAPI encoder fails to start when profile contains a stale vaapi_device path

Open Beginner friendly
#13,773 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
Half a day
Newbie friendliness
68/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
c

Research direction

Start in obs-ffmpeg-vaapi.c at the av_hwdevice_ctx_create call and inspect how a saved vaapi_device path is handled. Reproduce the issue with a profile containing a nonexistent device path, then verify that streaming falls back to local auto-detection and starts successfully.

Written by the indexing model from the issue text.

Description

Operating System Info

NixOS 26.11, Linux 7.1.7, x86_64, AMD Renoir (Radeon Vega) iGPU

Other OS

No response

OBS Studio Version

32.1.2

OBS Studio Version (Other)

No response

OBS Studio Log URL

https://obsproject.com/logs/WG8xbiO8m0utxiBB

OBS Studio Crash Log URL

No response

Expected Behavior

If the saved vaapi_device path does not exist, the encoder should fall back to auto-detection and the stream should still start.

Current Behavior

The FFmpeg VAAPI encoder uses the vaapi_device path saved in the profile without checking it. My two machines share a home directory, so a profile can carry the other machine's device path (for example /dev/dri/by-path/pci-0000:00:02.0-render on the Intel machine). If that path does not exist, streaming fails:

[FFmpeg VAAPI encoder: 'advanced_video_stream'] Failed to create VAAPI device context: Invalid argument
Stream output type 'rtmp_output' failed to start!
Steps to Reproduce
  1. Configure the FFmpeg VAAPI encoder on one machine (the profile saves the local device path, for example /dev/dri/by-path/pci-0000:04:00.0-render).
  2. Use the same profile on a second machine with a different GPU.
  3. Start streaming.
Anything else we should know?

Leaving vaapi_device empty makes ffmpeg auto-detect the local render node, so the fix could be a fallback in obs-ffmpeg-vaapi.c when av_hwdevice_ctx_create fails. I can prepare a patch if that is acceptable.

Dominant language
C
Stars
76.4k
Forks
10.2k
Avg merge
4d 23h
Merged PRs (30d)
12

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from obsproject/obs-studio

All issues in obsproject/obs-studio

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.