我最近安装了OBS工作室在我的笔记本电脑(联想 Thinkpad T410)上安装 Ubuntu 20.04 LTS。虽然我在安装过程中没有遇到任何问题,但我无法运行 OBS Studio 本身,因为我一直遇到以下错误:
Failed to initialize video. Your GPU may not be supported, or your graphics drivers may need to be updated.
为了向您提供所有必要的详细信息,这里是该obs
命令的完整控制台输出:
Attempted path: share/obs/obs-studio/locale/en-US.ini
Attempted path: /usr/share/obs/obs-studio/locale/en-US.ini
Attempted path: share/obs/obs-studio/locale.ini
Attempted path: /usr/share/obs/obs-studio/locale.ini
Attempted path: share/obs/obs-studio/locale/fr-FR.ini
Attempted path: /usr/share/obs/obs-studio/locale/fr-FR.ini
info: Using preferred locale 'fr-FR'
Attempted path: share/obs/obs-studio/themes/Dark.qss
Attempted path: /usr/share/obs/obs-studio/themes/Dark.qss
info: CPU Name: Intel(R) Core(TM) i5 CPU M 520 @ 2.40GHz
info: CPU Speed: 1548.597MHz
info: Physical Cores: 2, Logical Cores: 4
info: Physical Memory: 3733MB Total, 228MB Free
info: Kernel Version: Linux 5.4.0-52-generic
info: Distribution: "Ubuntu" "20.04"
info: Window System: X11.0, Vendor: The X.Org Foundation, Version: 1.20.8
info: Portable mode: false
Attempted path: share/obs/obs-studio/themes/Dark/no_sources.svg
Attempted path: /usr/share/obs/obs-studio/themes/Dark/no_sources.svg
QMetaObject::connectSlotsByName: No matching signal for on_advAudioProps_clicked()
QMetaObject::connectSlotsByName: No matching signal for on_advAudioProps_destroyed()
QMetaObject::connectSlotsByName: No matching signal for on_actionGridMode_triggered()
QMetaObject::connectSlotsByName: No matching signal for on_program_customContextMenuRequested(QPoint)
QMetaObject::connectSlotsByName: No matching signal for on_transitionRemove_clicked()
info: OBS 26.0.2 (linux)
info: ---------------------------------
info: ---------------------------------
info: audio settings reset:
samples per sec: 48000
speakers: 2
info: ---------------------------------
info: Initializing OpenGL...
error: X Error: GLXBadFBConfig, Major opcode: 152, Minor opcode: 34, Serial: 29
error: Failed to create OpenGL context.
error: Failed to create context!
error: device_create (GL) failed
error: Failed to initialize video. Your GPU may not be supported, or your graphics drivers may need to be updated.
info: Freeing OBS context data
info: == Profiler Results =============================
info: run_program_init: 2009,26 ms
info: ┣OBSApp::AppInit: 9,107 ms
info: ┃ ┗OBSApp::InitLocale: 4,805 ms
info: ┗OBSApp::OBSInit: 241,855 ms
info: ┣obs_startup: 20,295 ms
info: ┗OBSBasic::OBSInit: 54,346 ms
info: ┣OBSBasic::InitBasicConfig: 0,672 ms
info: ┣OBSBasic::ResetAudio: 0,257 ms
info: ┗OBSBasic::ResetVideo: 52,276 ms
info: obs_hotkey_thread(25 ms): min=0,129 ms, median=0,325 ms, max=15,866 ms, 99th percentile=15,866 ms, 100% below 25 ms
info: audio_thread(Audio): min=0,021 ms, median=0,042 ms, max=0,086 ms, 99th percentile=0,086 ms
info: =================================================
info: == Profiler Time Between Calls ==================
info: obs_hotkey_thread(25 ms): min=25,215 ms, median=25,444 ms, max=40,983 ms, 64,4068% within ±2% of 25 ms (0% lower, 35,5932% higher)
info: =================================================
info: Number of memory leaks: 178
搜索问题后,我发现我的问题在于我的 OpenGL 版本太旧了(2.1)。虽然我的 GPU(集成;我的 CPU 是 Intel i5 M520)不是最先进的,但它对于 OBS Studio 来说似乎并不太旧,因为我也在 Windows 10 上安装了相同的程序(因为我的笔记本电脑是双重启动) 并且我运行它从我的网络摄像头或打开的窗口中捕获数据没有任何问题。
但是,我很难找到如何在 Ubuntu 20.04 下升级我的 OpenGL 版本。我最好的尝试是通过 PPA 获取更新版本的 Mesa 3D 库kisak-mesa
,但虽然它升级了我的 Mesa 版本,但并没有改变 OpenGL 版本。这是我运行命令时得到的结果glxinfo | grep "OpenGL version"
:
OpenGL version string: 2.1 Mesa 20.2.1 - kisak-mesa PPA
另外,我还看了附加驱动程序选项卡软件和更新,但就我而言,此选项卡完全是空的,并且没有建议任何可以改善我当前情况的驱动程序。
我能做什么来解决这个问题?最近的另一个问题建议通过 snap 安装 OBS Studio,但尽管尝试了,我仍然遇到与之前相同的问题。
在此先非常感谢您的帮助。
答案1
这在 Debian 10 上对我有用
LIBGL_ALWAYS_SOFTWARE=1 obs