您尚未登录。

#1 2022-11-12 20:18:35

chen05_20
会员
注册时间: 2021-04-02
帖子: 107

obs捕捉不到屏幕,如何解决?

安装的是obs-studio包,wayland环境,来源的屏幕采集,视频画面都是黑的

离线

#2 2022-11-12 23:23:25

依云
会员
所在地: a.k.a. 百合仙子
注册时间: 2011-08-21
帖子: 7,570
个人网站

Re: obs捕捉不到屏幕,如何解决?

什么桌面环境?

离线

#3 2022-11-13 11:41:17

chen05_20
会员
注册时间: 2021-04-02
帖子: 107

Re: obs捕捉不到屏幕,如何解决?

依云 说:

什么桌面环境?

gnome最新版本

离线

#4 2022-11-13 12:27:56

matrikslee
会员
注册时间: 2017-04-21
帖子: 353
个人网站

Re: obs捕捉不到屏幕,如何解决?

gnome的话大概率是wayland环境吧?obs在wayland下需要依赖pipewire做屏幕采集,你检查一下是不是有什么pw相关的包没安装

https://wiki.archlinux.org/title/PipeWi … en_sharing参考这段wiki,主要检查一下你是否安装了xdg-desktop-portalxdg-desktop-portal-gnome这两个包

安装了软件包之后重启xdg-desktop-portal.service这个系统服务应该就可以立即生效了

最近编辑记录 matrikslee (2022-11-13 12:36:12)

离线

#5 2022-11-13 13:54:04

chen05_20
会员
注册时间: 2021-04-02
帖子: 107

Re: obs捕捉不到屏幕,如何解决?

matrikslee 说:

gnome的话大概率是wayland环境吧?obs在wayland下需要依赖pipewire做屏幕采集,你检查一下是不是有什么pw相关的包没安装

https://wiki.archlinux.org/title/PipeWi … en_sharing参考这段wiki,主要检查一下你是否安装了xdg-desktop-portalxdg-desktop-portal-gnome这两个包

安装了软件包之后重启xdg-desktop-portal.service这个系统服务应该就可以立即生效了

2个包都装过了,但是.service不在默认的 /lib/systemd/system目录,复制一份过去后,执行 systemctl restart xdg-desktop-portal.service 后,报如下错误

11月 13 13:50:54 cm-pc systemd[1]: Starting Portal service...
11月 13 13:50:54 cm-pc xdg-desktop-portal[100893]: error: No session bus: 无法在没有 X11 $DISPLAY 的情况下自动启动 D-Bus
11月 13 13:50:54 cm-pc systemd[1]: xdg-desktop-portal.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
11月 13 13:50:54 cm-pc systemd[1]: xdg-desktop-portal.service: Failed with result 'exit-code'.
11月 13 13:50:54 cm-pc systemd[1]: Failed to start Portal service.

离线

#6 2022-11-13 15:14:54

KafCoppelia
会员
注册时间: 2022-06-20
帖子: 124
个人网站

Re: obs捕捉不到屏幕,如何解决?

老问题了,参见:https://aur.archlinux.org/packages/wemeet-binhttps://wiki.archlinux.org/title/Screen … video_feed

我也是wayland,一直是这样解决的

离线

#7 2022-11-13 15:54:56

matrikslee
会员
注册时间: 2017-04-21
帖子: 353
个人网站

Re: obs捕捉不到屏幕,如何解决?

chen05_20 说:

2个包都装过了,但是.service不在默认的 /lib/systemd/system目录,复制一份过去后,执行 systemctl restart xdg-desktop-portal.service 后,报如下错误

11月 13 13:50:54 cm-pc systemd[1]: Starting Portal service...
11月 13 13:50:54 cm-pc xdg-desktop-portal[100893]: error: No session bus: 无法在没有 X11 $DISPLAY 的情况下自动启动 D-Bus
11月 13 13:50:54 cm-pc systemd[1]: xdg-desktop-portal.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
11月 13 13:50:54 cm-pc systemd[1]: xdg-desktop-portal.service: Failed with result 'exit-code'.
11月 13 13:50:54 cm-pc systemd[1]: Failed to start Portal service.

不是你这么搞的,怪我之前没说清楚,

xdg-desktop-portal.service是一个user service(用户级别的服务)所以启用的时候要用

systemctl --user start xdg-desktop-portal
systemctl --user start xdg-desktop-portal-gnome

你把/lib/systemd/system目录下面自己手动复制过去的service删掉吧,然后再用上面两条命令试试

KafCoppelia 说:

老问题了,参见:https://aur.archlinux.org/packages/wemeet-bin、https://wiki.archlinux.org/title/Screen … video_feed

我也是wayland,一直是这样解决的

你说的东西和楼主的问题不是一回事,楼主要解决最原始的屏幕录制问题,也就是目前wayland下面屏幕录制的解决方案——通过pipewire的实现抓屏

你提到的内容都是解决特定软件不支持wayland现有屏幕录制方案的问题,
用v4l2虚拟相机也要先抓到屏幕内容(也就是上面提到的pipewire方法)然后放进去,然后让想用的软件从v4l2虚拟相机中拿图像。。

最近编辑记录 matrikslee (2022-11-13 16:03:02)

离线

#8 2022-11-13 19:00:54

chen05_20
会员
注册时间: 2021-04-02
帖子: 107

Re: obs捕捉不到屏幕,如何解决?

matrikslee 说:
chen05_20 说:

2个包都装过了,但是.service不在默认的 /lib/systemd/system目录,复制一份过去后,执行 systemctl restart xdg-desktop-portal.service 后,报如下错误

11月 13 13:50:54 cm-pc systemd[1]: Starting Portal service...
11月 13 13:50:54 cm-pc xdg-desktop-portal[100893]: error: No session bus: 无法在没有 X11 $DISPLAY 的情况下自动启动 D-Bus
11月 13 13:50:54 cm-pc systemd[1]: xdg-desktop-portal.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
11月 13 13:50:54 cm-pc systemd[1]: xdg-desktop-portal.service: Failed with result 'exit-code'.
11月 13 13:50:54 cm-pc systemd[1]: Failed to start Portal service.

不是你这么搞的,怪我之前没说清楚,

xdg-desktop-portal.service是一个user service(用户级别的服务)所以启用的时候要用

systemctl --user start xdg-desktop-portal
systemctl --user start xdg-desktop-portal-gnome

你把/lib/systemd/system目录下面自己手动复制过去的service删掉吧,然后再用上面两条命令试试

KafCoppelia 说:

老问题了,参见:https://aur.archlinux.org/packages/wemeet-bin、https://wiki.archlinux.org/title/Screen … video_feed

我也是wayland,一直是这样解决的

你说的东西和楼主的问题不是一回事,楼主要解决最原始的屏幕录制问题,也就是目前wayland下面屏幕录制的解决方案——通过pipewire的实现抓屏

你提到的内容都是解决特定软件不支持wayland现有屏幕录制方案的问题,
用v4l2虚拟相机也要先抓到屏幕内容(也就是上面提到的pipewire方法)然后放进去,然后让想用的软件从v4l2虚拟相机中拿图像。。

额,好像还是不行,屏幕还是黑的,接收流的播放器也是一直黑

离线

#9 2022-11-13 19:04:33

chen05_20
会员
注册时间: 2021-04-02
帖子: 107

Re: obs捕捉不到屏幕,如何解决?

所有obs的debug在这

debug: Found portal inhibitor
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/zh-CN.ini
Attempted path: /usr/share/obs/obs-studio/locale/zh-CN.ini
info: Using preferred locale 'zh-CN'
Attempted path: share/obs/obs-studio/themes/Yami.qss
Attempted path: /usr/share/obs/obs-studio/themes/Yami.qss
info: Platform: Wayland
info: CPU Name: 11th Gen Intel(R) Core(TM) i7-1160G7 @ 1.20GHz
info: CPU Speed: 3600.000MHz
info: Physical Cores: 4, Logical Cores: 8
info: Physical Memory: 15721MB Total, 1053MB Free
info: Kernel Version: Linux 6.0.8-arch1-1
info: Distribution: "Arch Linux" Unknown
info: Session Type: wayland
info: Qt Version: 6.4.0 (runtime), 6.4.0 (compiled)
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
qt.core.qmetaobject.connectslotsbyname: QMetaObject::connectSlotsByName: No matching signal for on_tbar_position_valueChanged(int)
qt.core.qmetaobject.connectslotsbyname: QMetaObject::connectSlotsByName: No matching signal for on_actionShowTransitionProperties_triggered()
qt.core.qmetaobject.connectslotsbyname: QMetaObject::connectSlotsByName: No matching signal for on_actionHideTransitionProperties_triggered()
info: OBS 28.0.3-2 (linux)
info: ---------------------------------
info: ---------------------------------
info: audio settings reset:
	samples per sec: 48000
	speakers:        2
	max buffering:   960 milliseconds
	buffering type:  dynamically increasing
info: ---------------------------------
info: Initializing OpenGL...
info: Using EGL/Wayland
info: Initialized EGL 1.5
info: Loading up OpenGL on adapter Intel Mesa Intel(R) Xe Graphics (TGL GT2)
info: OpenGL loaded successfully, version 4.6 (Core Profile) Mesa 22.2.3, shading language 4.60
info: ---------------------------------
info: video settings reset:
	base resolution:   1920x1080
	output resolution: 1280x720
	downscale filter:  Bicubic
	fps:               60/1
	format:            NV12
	YUV mode:          Rec. 709/Partial
info: NV12 texture support not available
info: P010 texture support not available
info: Audio monitoring device:
	name: 默认
	id: default
info: ---------------------------------
warning: Failed to load 'en-US' text for module: 'decklink-captions.so'
warning: Failed to load 'en-US' text for module: 'decklink-output-ui.so'
libDeckLinkAPI.so: 无法打开共享对象文件: 没有那个文件或目录
warning: A DeckLink iterator could not be created.  The DeckLink drivers may not be installed
warning: Failed to initialize module 'decklink.so'
info: [pipewire] Available captures:
info: [pipewire]     - Desktop capture
info: [pipewire]     - Window capture
warning: v4l2loopback not installed, virtual camera disabled
info: FFMPEG VAAPI supported
info: ---------------------------------
info:   Loaded Modules:
info:     text-freetype2.so
info:     rtmp-services.so
info:     obs-x264.so
info:     obs-vst.so
info:     obs-transitions.so
info:     obs-outputs.so
info:     obs-filters.so
info:     obs-ffmpeg.so
info:     linux-v4l2.so
info:     linux-pulseaudio.so
info:     linux-pipewire.so
info:     linux-jack.so
info:     linux-capture.so
info:     linux-alsa.so
info:     image-source.so
info:     frontend-tools.so
info:     decklink-output-ui.so
info:     decklink-captions.so
info: ---------------------------------
info: ==== Startup complete ===============================================
info: All scene data cleared
info: ------------------------------------------------
info: pulse-input: Server name: 'pulseaudio 16.1'
info: pulse-input: Audio format: s16le, 48000 Hz, 2 channels
info: pulse-input: Started recording from 'alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__hw_sofhdadsp_3__sink.monitor'
info: [Loaded global audio device]: '桌面音频'
info: pulse-input: Server name: 'pulseaudio 16.1'
info: pulse-input: Audio format: s16le, 48000 Hz, 4 channels
info: pulse-input: Started recording from 'alsa_input.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__hw_sofhdadsp_6__source'
info: [Loaded global audio device]: '麦克风/Aux'
info: PipeWire initialized
info: Switched to scene '测试桌面'
info: ------------------------------------------------
info: Loaded scenes:
info: - scene '测试桌面':
info:     - source: '屏幕采集(PipeWire)' (pipewire-desktop-capture-source)
info: ------------------------------------------------
info: [pipewire] Screencast session created
info: [pipewire] Asking for desktop
Attempted path: share/obs/obs-studio/images/overflow.png
Attempted path: /usr/share/obs/obs-studio/images/overflow.png
info: [pipewire] desktop selected, setting up screencast
info: [pipewire] Server version: 0.3.59
info: [pipewire] Library version: 0.3.59
info: [pipewire] Header version: 0.3.59
info: [pipewire] Created stream 0x563e97221f10
info: [pipewire] Stream 0x563e97221f10 state: "connecting" (error: none)
info: [pipewire] Playing stream 0x563e97221f10
info: [pipewire] Stream 0x563e97221f10 state: "paused" (error: none)
info: [pipewire] Stream 0x563e97221f10 state: "unconnected" (error: none)
info: PipeWire initialized
info: [pipewire] Screencast session created
info: [pipewire] Asking for desktop
info: [pipewire] desktop selected, setting up screencast
info: [pipewire] Server version: 0.3.59
info: [pipewire] Library version: 0.3.59
info: [pipewire] Header version: 0.3.59
info: [pipewire] Created stream 0x563e97221f10
info: [pipewire] Stream 0x563e97221f10 state: "connecting" (error: none)
info: [pipewire] Playing stream 0x563e97221f10
info: [pipewire] Stream 0x563e97221f10 state: "paused" (error: none)
info: ---------------------------------
info: [x264 encoder: 'simple_video_stream'] preset: veryfast
info: [x264 encoder: 'simple_video_stream'] settings:
	rate_control: CBR
	bitrate:      2500
	buffer size:  2500
	crf:          23
	fps_num:      60
	fps_den:      1
	width:        1280
	height:       720
	keyint:       250

info: ---------------------------------
info: [FFmpeg aac encoder: 'simple_aac'] bitrate: 160, channels: 2, channel_layout: stereo

离线

#10 2022-11-13 21:35:34

matrikslee
会员
注册时间: 2017-04-21
帖子: 353
个人网站

Re: obs捕捉不到屏幕,如何解决?

你有使用pipewire-media-session或者wireplumber吗?

pipewire录屏需要上面中的一个(他们本身也是互相替代的关系)

最近编辑记录 matrikslee (2022-11-13 21:36:02)

离线

#11 2022-11-14 10:59:46

chen05_20
会员
注册时间: 2021-04-02
帖子: 107

Re: obs捕捉不到屏幕,如何解决?

matrikslee 说:

你有使用pipewire-media-session或者wireplumber吗?

pipewire录屏需要上面中的一个(他们本身也是互相替代的关系)

yay 搜了下,只装了pipewire,只要装了pipewire-media-session 这个包就可以了吗?

离线

#12 2022-11-14 20:27:49

matrikslee
会员
注册时间: 2017-04-21
帖子: 353
个人网站

Re: obs捕捉不到屏幕,如何解决?

chen05_20 说:
matrikslee 说:

你有使用pipewire-media-session或者wireplumber吗?

pipewire录屏需要上面中的一个(他们本身也是互相替代的关系)

yay 搜了下,只装了pipewire,只要装了pipewire-media-session 这个包就可以了吗?

要启用,虽然默认自动启用,但是也有例外情况,你最好确认一下,另外,pipewire-media-session会接管你的audio 服务,如果你之前使用的PulseAudio可能会冲突,要注意处理

离线

#13 2022-11-18 23:17:25

nibazshab
会员
注册时间: 2022-02-04
帖子: 124

Re: obs捕捉不到屏幕,如何解决?

pipewire 采集屏幕也是黑的?看一下 gst-plugins-good 和 gst-plugin-pipewire 有没有安装

另外说一句题外话,是不是nvidia显卡?

离线

页脚