kounoike / obs-virtualbg

An OBS plugin for Zoom/Meet-like virtual background feature.
MIT License
287 stars 33 forks source link

On Pop_os! filter does not show up for Video Capture Device (V4L) or Media Source #95

Open charlesritchea opened 1 year ago

charlesritchea commented 1 year ago

First off, the .deb installed into /usr/lib locations, but I could not get the plugin to load until I moved to ~/.config/obs-studio/plugins

After moving the plugin and locale files into the expected paths, the plugin loads as shown in the logs, but it does not come up as a a Filter option

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/themes/Dark.qss
Attempted path: /usr/share/obs/obs-studio/themes/Dark.qss
info: CPU Name: AMD Ryzen 7 3800X 8-Core Processor
info: CPU Speed: 4268.871MHz
info: Physical Cores: 8, Logical Cores: 16
info: Physical Memory: 64204MB Total, 39112MB Free
info: Kernel Version: Linux 6.2.6-76060206-generic
info: Distribution: "Pop!_OS" "22.04"
info: Session Type: x11
info: Window System: X11.0, Vendor: The X.Org Foundation, Version: 1.21.1
info: Qt Version: 5.15.3 (runtime), 5.15.2 (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
QMetaObject::connectSlotsByName: No matching signal for on_tbar_position_valueChanged(int)
QMetaObject::connectSlotsByName: No matching signal for on_actionShowTransitionProperties_triggered()
QMetaObject::connectSlotsByName: No matching signal for on_actionHideTransitionProperties_triggered()
info: OBS 27.2.3+dfsg1-1 (linux)
info: ---------------------------------
info: ---------------------------------
info: audio settings reset:
    samples per sec: 48000
    speakers:        2
info: ---------------------------------
info: Initializing OpenGL...
info: Loading up OpenGL on adapter NVIDIA Corporation NVIDIA GeForce RTX 3070/PCIe/SSE2
info: OpenGL loaded successfully, version 3.3.0 NVIDIA 525.105.17, shading language 3.30 NVIDIA via Cg compiler
info: ---------------------------------
info: video settings reset:
    base resolution:   1920x1080
    output resolution: 1920x1080
    downscale filter:  Bicubic
    fps:               30/1
    format:            NV12
    YUV mode:          709/Partial
info: NV12 texture support not available
info: Audio monitoring device:
    name: Default
    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-ouput-ui.so'
libDeckLinkAPI.so: cannot open shared object file: No such file or directory
warning: A DeckLink iterator could not be created.  The DeckLink drivers may not be installed
info: No blackmagic support
info: NVENC supported
info: FFMPEG VAAPI supported
info: [vlc-video]: VLC 3.0.16 Vetinari found, VLC video source enabled
info: [OBS Virtual BG plugin] obs_module_load. version=v1.2.0
warning: obs_register_source: Tried to register obs_source_info with size 400 which is more than libobs currently supports (392)
warning: obs_register_source: Tried to register obs_source_info with size 400 which is more than libobs currently supports (392)
info: ---------------------------------
info:   Loaded Modules:
info:     obs-virtualbg.so
info:     droidcam-obs.so
info:     vlc-video.so
info:     text-freetype2.so
info:     rtmp-services.so
info:     obs-x264.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-jack.so
info:     linux-decklink.so
info:     linux-capture.so
info:     linux-alsa.so
info:     image-source.so
info:     frontend-tools.so
info:     decklink-ouput-ui.so
info:     decklink-captions.so
info: ---------------------------------
info: ==== Startup complete ===============================================
info: All scene data cleared
info: ------------------------------------------------
info: pulse-input: Server name: 'PulseAudio (on PipeWire 0.3.71) 15.0.0'
info: pulse-input: Audio format: s16le, 48000 Hz, 2 channels
info: pulse-input: Started recording from 'alsa_output.usb-Dell_Dell_AC511_USB_SoundBar-00.analog-stereo.monitor'
info: [Loaded global audio device]: 'Desktop Audio'
info: pulse-input: Server name: 'PulseAudio (on PipeWire 0.3.71) 15.0.0'
info: pulse-input: Audio format: s16le, 48000 Hz, 1 channels
info: pulse-input: Started recording from 'alsa_input.usb-Microsoft_Microsoft___LifeCam_Studio_TM_-02.mono-fallback'
info: [Loaded global audio device]: 'Mic/Aux'
info: [DroidCamOBS] Source: "DroidCam OBS" - 210
info: [DroidCamOBS] checking adb
warning: [DroidCamOBS] "adb version" exit value 2
info: [DroidCamOBS] checking /usr/local/bin/adb
info: [DroidCamOBS] checking /usr/bin/adb
info: [DroidCamOBS] checking /bin/adb
warning: [DroidCamOBS] adb not found
info: [DroidCamOBS] PATH=/home/novaterata/.nvm/versions/node/v18.16.0/bin:/home/novaterata/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/novaterata/.local/share/JetBrains/Toolbox/scripts
info: [DroidCamOBS] activated=0, deactivateWNS=0, is_showing=0, enable_audio=0
info: [DroidCamOBS] video_format=avc video_resolution=640x480
info: [DroidCamOBS] video_thread start
info: [DroidCamOBS] video_decode_thread start
info: [DroidCamOBS] audio_thread start
info: Switched to scene 'Scene'
info: ------------------------------------------------
info: Loaded scenes:
info: - scene 'Scene':
info:     - source: 'DroidCam OBS' (droidcam_obs)
info: ------------------------------------------------
Attempted path: share/obs/obs-studio/images/overflow.png
Attempted path: /usr/share/obs/obs-studio/images/overflow.png
info: adding 42 milliseconds of audio buffering, total audio buffering is now 42 milliseconds (source: Desktop Audio)

info: User Removed source 'DroidCam OBS' (droidcam_obs) from scene 'Scene'
info: [DroidCamOBS] destroy: "DroidCam OBS"
info: [DroidCamOBS] stopping
info: [DroidCamOBS] video_decode_thread end
info: [DroidCamOBS] video_thread end
info: [DroidCamOBS] audio_thread end
info: [DroidCamOBS] cleanup
info: v4l2-input: Start capture from
error: v4l2-input: Unable to open device
error: v4l2-input: Initialization failed
info: User added source 'Video Capture Device (V4L2)' (v4l2_input) to scene 'Scene'
info: v4l2-input: /dev/video1 seems to not support video capture
info: v4l2-input: Found device 'Microsoft® LifeCam Studio(TM):' at /dev/video0
info: v4l2-input: Found input 'Input 1' (Index 0)
info: v4l2-controls: setting default for Power Line Frequency to 2
info: v4l2-controls: setting default for Auto Exposure to 3
info: v4l2-input: Pixelformat: YUYV 4:2:2 (available)
info: v4l2-input: Pixelformat: Motion-JPEG (available)
info: v4l2-input: Pixelformat: YUV 4:2:0 (M420) (unavailable)
info: v4l2-input: Pixelformat: RGB3 (Emulated) (unavailable)
info: v4l2-input: Pixelformat: BGR3 (Emulated) (available)
info: v4l2-input: Pixelformat: YU12 (Emulated) (available)
info: v4l2-input: Pixelformat: YV12 (Emulated) (available)
info: v4l2-input: Stepwise and Continuous framesizes are currently hardcoded
info: v4l2-input: Stepwise and Continuous framerates are currently hardcoded
info: v4l2-input: Pixelformat: YUYV 4:2:2 (available)
info: v4l2-input: Pixelformat: Motion-JPEG (available)
info: v4l2-input: Pixelformat: YUV 4:2:0 (M420) (unavailable)
info: v4l2-input: Pixelformat: RGB3 (Emulated) (unavailable)
info: v4l2-input: Pixelformat: BGR3 (Emulated) (available)
info: v4l2-input: Pixelformat: YU12 (Emulated) (available)
info: v4l2-input: Pixelformat: YV12 (Emulated) (available)
info: v4l2-input: Stepwise and Continuous framesizes are currently hardcoded
info: v4l2-input: Stepwise and Continuous framerates are currently hardcoded
info: v4l2-input: Stepwise and Continuous framerates are currently hardcoded
info: v4l2-input: Start capture from /dev/video0
info: v4l2-input: Input: 0
info: v4l2-input: Resolution: 800x448
info: v4l2-input: Pixelformat: YUYV
info: v4l2-input: Linesize: 1600 Bytes
info: v4l2-input: Framerate: 30.00 fps
info: v4l2-input: /dev/video0: select timeout set to 166666 (5x frame periods)
error: v4l2-input: /dev/video0: select timed out
error: v4l2-input: /dev/video0: failed to log status
error: v4l2-input: /dev/video0: select timed out
error: v4l2-input: /dev/video0: failed to log status
info: v4l2-input: /dev/video0: Stopped capture after 54 frames
info: v4l2-input: Start capture from /dev/video0
info: v4l2-input: Input: 0
info: v4l2-input: Resolution: 800x448
info: v4l2-input: Pixelformat: YUYV
info: v4l2-input: Linesize: 1600 Bytes
info: v4l2-input: Framerate: 30.00 fps
info: v4l2-input: /dev/video0: select timeout set to 166666 (5x frame periods)
error: v4l2-input: /dev/video0: select timed out
error: v4l2-input: /dev/video0: failed to log status
error: v4l2-input: /dev/video0: select timed out
error: v4l2-input: /dev/video0: failed to log status
info: User added source 'Image' (image_source) to scene 'Scene'
[swscaler @ 0x7fb424b269c0] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x7fb424b2ea00] deprecated pixel format used, make sure you did set range correctly
Error executing command as another user: Request dismissed
info: [Media Source 'Media Source']: settings:
    input:
    input_format:            (null)
    speed:                   100
    is_looping:              no
    is_linear_alpha:         no
    is_hw_decoding:          no
    is_clear_on_media_end:   yes
    restart_on_activate:     yes
    close_when_inactive:     no
info: User added source 'Media Source' (ffmpeg_source) to scene 'Scene'
info: [Media Source 'Media Source']: settings:
    input:                   /home/novaterata/Downloads/vecteezy_klepon-is-indonesian-popular-traditional-snack-made-from_16172485_432.mp4
    input_format:            (null)
    speed:                   100
    is_looping:              no
    is_linear_alpha:         no
    is_hw_decoding:          yes
    is_clear_on_media_end:   yes
    restart_on_activate:     yes
    close_when_inactive:     no
[AVHWDeviceContext @ 0x7fb44000e980] libva: vaGetDriverNameByIndex() failed with unknown libva error, driver_name = (null)
[AVHWDeviceContext @ 0x7fb44000e980] Failed to initialise VAAPI connection: -1 (unknown libva error).
info: [Media Source 'Media Source']: settings:
    input:                   /home/novaterata/Downloads/vecteezy_klepon-is-indonesian-popular-traditional-snack-made-from_16172485_432.mp4
    input_format:            (null)
    speed:                   100
    is_looping:              yes
    is_linear_alpha:   
iam-TJ commented 1 year ago

I found this problem on Debian 12 Bookworm amd64 too.

Solution to the first problem of the plugin not being found is to sym-link it into the correct location for Debian/Ubuntu and derivative distros expected location as dictated by the obs-studio package itself.

$ sudo ln -s /usr/lib/obs-plugins/obs-virtualbg.so /usr/lib/x86_64-linux-gnu/obs-plugins/

(the Debian .deb package should install to this location).

OBS now sees the plugin and can add it to a source as a Filter but as soon as we try to add the Effect by pressing on the Effects + button OBS crashes with:

...
info:   Loaded Modules:
...
info:     obs-virtualbg.so  
...
info: [Virtual BG detector] detecter_create version:v1.2.0
info: User added filter 'Virtual Background Detector' (virtualbg) to source 'HD PTZ Cam (Inside-Out)'
info: [Virtual BG detector] frame size or format change detected
info: [Virtual BG detector] video_scaler_create success. 1920x1080 -> 256x144
Illegal instruction (core dumped)
charlesritchea commented 1 year ago

Thanks!

On Sat, Jul 22, 2023, 3:00 AM TJ @.***> wrote:

I found this problem on Debian 12 Bookworm amd64 too.

Solution to the first problem of the plugin not being found is to sym-link it into the correct location for Debian/Ubuntu and derivative distros expected location as dictated by the obs-studio package itself.

$ sudo ln -s /usr/lib/obs-plugins/obs-virtualbg.so /usr/lib/x86_64-linux-gnu/obs-plugins/

(the Debian .deb package should install to this location).

OBS now sees the plugin and can add it to a source as a Filter but as soon as we try to add the Effect by pressing on the Effects + button OBS crashes with:

... info: Loaded Modules: ... info: obs-virtualbg.so ... info: [Virtual BG detector] detecter_create version:v1.2.0 info: User added filter 'Virtual Background Detector' (virtualbg) to source 'HD PTZ Cam (Inside-Out)' info: [Virtual BG detector] frame size or format change detected info: [Virtual BG detector] video_scaler_create success. 1920x1080 -> 256x144 Illegal instruction (core dumped)

— Reply to this email directly, view it on GitHub https://github.com/kounoike/obs-virtualbg/issues/95#issuecomment-1646510848, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMUMHNVV3MZEUNQ65KSSKDXRN3ALANCNFSM6AAAAAAYQK7ORI . You are receiving this because you authored the thread.Message ID: @.***>

thumbtak2 commented 1 year ago

https://github.com/kounoike/obs-virtualbg/issues/95#issuecomment-1646510848

As said above, or at the link. I find that the video render filter works, but not the detector filter. I also get a crash with OBS. I did have to create a shortcut to the *.so file.

thor171 commented 1 year ago

I found this problem on Debian 12 Bookworm amd64 too.

Solution to the first problem of the plugin not being found is to sym-link it into the correct location for Debian/Ubuntu and derivative distros expected location as dictated by the obs-studio package itself.

$ sudo ln -s /usr/lib/obs-plugins/obs-virtualbg.so /usr/lib/x86_64-linux-gnu/obs-plugins/

(the Debian .deb package should install to this location).

OBS now sees the plugin and can add it to a source as a Filter but as soon as we try to add the Effect by pressing on the Effects + button OBS crashes with:

...
info:   Loaded Modules:
...
info:     obs-virtualbg.so  
...
info: [Virtual BG detector] detecter_create version:v1.2.0
info: User added filter 'Virtual Background Detector' (virtualbg) to source 'HD PTZ Cam (Inside-Out)'
info: [Virtual BG detector] frame size or format change detected
info: [Virtual BG detector] video_scaler_create success. 1920x1080 -> 256x144
Illegal instruction (core dumped)

Tried that on LInux Mint 21.2. The plugin shows up in the terminal output when starting obs, but it doesn't show up in the filters.

`$ 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/de-DE.ini Attempted path: /usr/share/obs/obs-studio/locale/de-DE.ini info: Using preferred locale 'de-DE' Attempted path: share/obs/obs-studio/themes/Dark.qss Attempted path: /usr/share/obs/obs-studio/themes/Dark.qss info: CPU Name: AMD Ryzen 9 5900X 12-Core Processor info: CPU Speed: 2200.000MHz info: Physical Cores: 12, Logical Cores: 24 info: Physical Memory: 31995MB Total, 11084MB Free info: Kernel Version: Linux 5.15.0-78-generic info: Distribution: "Linux Mint" "21.2" info: Session Type: x11 info: Window System: X11.0, Vendor: The X.Org Foundation, Version: 1.21.1 info: Qt Version: 5.15.3 (runtime), 5.15.2 (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 QMetaObject::connectSlotsByName: No matching signal for on_tbar_position_valueChanged(int) QMetaObject::connectSlotsByName: No matching signal for on_actionShowTransitionProperties_triggered() QMetaObject::connectSlotsByName: No matching signal for on_actionHideTransitionProperties_triggered() info: OBS 27.2.3+dfsg1-1 (linux) info: --------------------------------- info: --------------------------------- info: audio settings reset: samples per sec: 48000 speakers: 2 info: --------------------------------- info: Initializing OpenGL... info: Loading up OpenGL on adapter NVIDIA Corporation NVIDIA GeForce RTX 3080/PCIe/SSE2 info: OpenGL loaded successfully, version 3.3.0 NVIDIA 535.86.05, shading language 3.30 NVIDIA via Cg compiler info: --------------------------------- info: video settings reset: base resolution: 1920x1080 output resolution: 1920x1080 downscale filter: Bicubic fps: 60/1 format: NV12 YUV mode: 709/Partial info: NV12 texture support not available info: Audio monitoring device: name: Standard 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-ouput-ui.so' libDeckLinkAPI.so: Kann die Shared-Object-Datei nicht öffnen: Datei oder Verzeichnis nicht gefunden warning: A DeckLink iterator could not be created. The DeckLink drivers may not be installed info: No blackmagic support info: NVENC supported info: FFMPEG VAAPI supported warning: Failed to load 'de-DE' text for module: 'obs-virtualbg.so' info: [OBS Virtual BG plugin] obs_module_load. version=v1.2.0 warning: obs_register_source: Tried to register obs_source_info with size 400 which is more than libobs currently supports (392) warning: obs_register_source: Tried to register obs_source_info with size 400 which is more than libobs currently supports (392) info: [vlc-video]: VLC 3.0.16 Vetinari found, VLC video source enabled info: --------------------------------- info: Loaded Modules: info: vlc-video.so info: text-freetype2.so info: rtmp-services.so info: obs-x264.so info: obs-virtualbg.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-jack.so info: linux-decklink.so info: linux-capture.so info: linux-alsa.so info: image-source.so info: frontend-tools.so info: decklink-ouput-ui.so info: decklink-captions.so info: --------------------------------- info: ==== Startup complete =============================================== info: All scene data cleared info: ------------------------------------------------ info: pulse-input: Server name: 'pulseaudio 15.99.1' info: pulse-input: Audio format: s16le, 44100 Hz, 2 channels info: pulse-input: Started recording from 'alsa_output.pci-0000_0a_00.4.analog-stereo.monitor' info: [Loaded global audio device]: 'Desktop-Audio' info: pulse-input: Server name: 'pulseaudio 15.99.1' info: pulse-input: Audio format: s16le, 48000 Hz, 1 channels info: pulse-input: Started recording from 'alsa_input.usb-046d_0825_5C21ACE0-02.mono-fallback' info: [Loaded global audio device]: 'Mikrofon-/AUX-Audio' info: v4l2-input: Start capture from /dev/video0 info: v4l2-input: Input: 0 info: v4l2-input: Resolution: 1280x720 info: v4l2-input: Pixelformat: MJPG info: v4l2-input: Linesize: 0 Bytes info: v4l2-input: Framerate: 30.00 fps info: v4l2-input: /dev/video0: select timeout set to 166666 (5x frame periods) info: Switched to scene 'Szene' info: ------------------------------------------------ info: Loaded scenes: info: - scene 'Szene': info: - source: 'Webcam' (v4l2_input) info: ------------------------------------------------ Attempted path: share/obs/obs-studio/images/overflow.png Attempted path: /usr/share/obs/obs-studio/images/overflow.png error: v4l2-input: /dev/video0: select timed out error: v4l2-input: /dev/video0: failed to log status error: v4l2-input: /dev/video0: select timed out error: v4l2-input: /dev/video0: failed to log status info: adding 21 milliseconds of audio buffering, total audio buffering is now 21 milliseconds (source: Desktop-Audio)

error: v4l2-input: /dev/video0: select timed out error: v4l2-input: /dev/video0: failed to log status error: v4l2-input: /dev/video0: select timed out error: v4l2-input: /dev/video0: failed to log status error: v4l2-input: /dev/video0: select timed out error: v4l2-input: /dev/video0: failed to log status error: v4l2-input: /dev/video0: select timed out error: v4l2-input: /dev/video0: failed to log status `