snapcrafters / obs-studio

This is a community-supported modified build of OBS Studio.
https://snapcraft.io/obs-studio
111 stars 37 forks source link

[Bug]: Background removal crashes OBS #156

Closed QazCetelic closed 8 months ago

QazCetelic commented 2 years ago

What happened?

The app crashed when I added the background removal filter to a video camera source

What should have happened?

It shouldn't crash.

Output of snap info $snap_name

name:      obs-studio
summary:   Free and open source software for live streaming and screen recording
publisher: Snapcrafters
store-url: https://snapcraft.io/obs-studio
contact:   https://github.com/snapcrafters/obs-studio/issues
license:   GPL-2.0
description: |
  OBS Studio is software designed for capturing, compositing, encoding, recording, and streaming
  video content, efficiently. _This is a community-supported modified build of OBS Studio; please
  file issues on the Snapcrafters GitHub:_ https://github.com/snapcrafters/obs-studio/issues

  **Batteries included**

  The snap of OBS studio comes pre-loaded with some extra features:

    * Supports **nvenc (NVIDIA) and VA-API (AMD & Intel) accelerated video encoding**.
    * **Advanced Scene Switcher** plugin; an automated scene switcher
    * **Browser** plugin; CEF-based OBS Studio browser plugin
    * **Directory Watch Media** plugin; filter you can add to a media source to load the oldest or
    newest file in a directory.
    * **Dynamic Delay** plugin; filter for dynamic delaying a video source.
    * **Freeze Filter** plugin; freeze a source using a filter.
    * **gPhoto** plugin; connect DSLR cameras with obs-studio via gPhoto.
    * **GStreamer** plugins; feed GStreamer launch pipelines into OBS Studio and use GStreamer
    encoder elements.
    * **Move Transition** plugin; move sources to a new position during a scene transition.
    * **NDI** plugin; Network A/V via NewTek's NDI.
    * **NvFBC** plugin; screen capture via NVIDIA FBC API. Requires NvFBC patches for Nvidia drivers
    for consumer-grade GPUs.
    * **RGB Levels** plugin; simple filter to adjust RGB levels.
    * **Source Switcher** plugin; to switch between a list of sources.
    * **Spectralizer** plugin; audio visualization using fftw.
    * **StreamFX** plugin; collection modern effects filters and transitions.
    * **Text Pango** plugin; Provides a text source rendered using Pango with multi-language
    support, emoji support, vertical rendering and RTL support.
    * **Transition Matrix** plugin; customize Any -> One or One -> One scene transitions.
    * **VNC Source** plugin; VNC viewer that works as a source.
    * **Websockets** plugin; remote-control OBS Studio through WebSockets.

  **Connecting Interfaces**

  For the best experience, you'll want to connect the following interfaces.

     sudo snap connect obs-studio:alsa
     sudo snap connect obs-studio:audio-record
     sudo snap connect obs-studio:avahi-control
     sudo snap connect obs-studio:camera
     sudo snap connect obs-studio:jack1
     sudo snap connect obs-studio:kernel-module-observe

  **NDI**

  If you want to use the NDI plugin you'll need to connect the Avahi Control interface.

     snap connect obs-studio:avahi-control

  **Virtual Camera**

  Starting with OBS 26.1.0, Virtual Camera support is integrated. Here's how to install and
  configure `v4l2loopback`:

     sudo snap connect obs-studio:kernel-module-observe
     sudo apt -y install v4l2loopback-dkms v4l2loopback-utils
     echo "options v4l2loopback devices=1 video_nr=13 card_label='OBS Virtual Camera'   
     exclusive_caps=1" | sudo tee /etc/modprobe.d/v4l2loopback.conf
     echo "v4l2loopback" | sudo tee /etc/modules-load.d/v4l2loopback.conf
     sudo modprobe -r v4l2loopback
     sudo modprobe v4l2loopback devices=1 video_nr=13 card_label='OBS Virtual Camera'
     exclusive_caps=1

  **NOTE!** Using `video_nr` greater than 64 will not work.

  **Removable Storage**

  To access content on external storage, connect to the removable-media plug:

     snap connect obs-studio:removable-media

  **gPhoto**

  The gPhoto plugin allows some DSLR cameras to be connected via USB. You'll need to connect the Raw
  USB interface.

     snap connect obs-studio:raw-usb

  **3rd Party plugins**

  To install pre-compiled plugins, download and extract the plugin to
  `~/snap/obs-studio/current/.config/obs-studio/plugins/`.

  This is how the Input Overlay plugin looks when correctly installed:

     /home/username/snap/obs-studio/current/.config/obs-studio/plugins/
     └── input-overlay
         ├── bin
         │   └── 64bit
         │       └── input-overlay.so
         └── data
             └── locale
                 ├── de-DE.ini
                 ├── en-US.ini
                 └── ru-RU.ini

  If you want to use the Input Overlay plugin, you'll also need to connect the joystick interface:

     snap connect obs-studio:joystick
commands:
  - obs-studio.eglinfo
  - obs-studio.ffmpeg
  - obs-studio.ffplay
  - obs-studio.ffprobe
  - obs-studio.glxinfo
  - obs-studio
  - obs-studio.srt-ffplay
  - obs-studio.srt-file-transmit
  - obs-studio.srt-live-transmit
  - obs-studio.srt-tunnel
  - obs-studio.vainfo
  - obs-studio.vdpauinfo
  - obs-studio.vulkaninfo
snap-id:      6uLU2MJmBURfLNz4rmL4WT2CmtVULE2u
tracking:     latest/stable
refresh-date: today at 13:48 CET
channels:
  latest/stable:    27.1.3 2021-12-20 (1284) 418MB -
  latest/candidate: ↑                              
  latest/beta:      ↑                              
  latest/edge:      27.1.3 2021-12-26 (1286) 418MB -
installed:          27.1.3            (1284) 418MB -

Output of snap connections $snap_name

Interface                 Plug                                 Slot                            Notes
alsa                      obs-studio:alsa                      :alsa                           manual
audio-playback            obs-studio:audio-playback            :audio-playback                 -
audio-record              obs-studio:audio-record              :audio-record                   -
avahi-control             obs-studio:avahi-control             :avahi-control                  manual
browser-support           obs-studio:browser-support           :browser-support                -
camera                    obs-studio:camera                    :camera                         -
content[gtk-3-themes]     obs-studio:gtk-3-themes              gtk-common-themes:gtk-3-themes  -
content[icon-themes]      obs-studio:icon-themes               gtk-common-themes:icon-themes   -
content[sound-themes]     obs-studio:sound-themes              gtk-common-themes:sound-themes  -
desktop                   obs-studio:desktop                   :desktop                        -
desktop-legacy            obs-studio:desktop-legacy            :desktop-legacy                 -
gsettings                 obs-studio:gsettings                 :gsettings                      -
hardware-observe          obs-studio:hardware-observe          -                               -
home                      obs-studio:home                      :home                           -
jack1                     obs-studio:jack1                     :jack1                          manual
joystick                  obs-studio:joystick                  -                               -
kernel-module-observe     obs-studio:kernel-module-observe     :kernel-module-observe          manual
network                   obs-studio:network                   :network                        -
network-bind              obs-studio:network-bind              :network-bind                   -
opengl                    obs-studio:opengl                    :opengl                         -
password-manager-service  obs-studio:password-manager-service  -                               -
process-control           obs-studio:process-control           -                               -
pulseaudio                obs-studio:pulseaudio                :pulseaudio                     -
raw-usb                   obs-studio:raw-usb                   -                               -
removable-media           obs-studio:removable-media           -                               -
screen-inhibit-control    obs-studio:screen-inhibit-control    :screen-inhibit-control         -
screencast-legacy         obs-studio:screencast-legacy         -                               -
system-observe            obs-studio:system-observe            -                               -
unity7                    obs-studio:unity7                    :unity7                         -
upower-observe            obs-studio:upower-observe            :upower-observe                 -
wayland                   obs-studio:wayland                   :wayland                        -
x11                       obs-studio:x11                       :x11                            -

Output of snap version

snap    2.54.2-1.fc34
snapd   2.54.2-1.fc34
series  16
fedora  34
kernel  5.16.9-100.fc34.x86_64

Relevant log output

Attempted path: share/obs/obs-studio/images/overflow.png
Attempted path: /usr/share/obs/obs-studio/images/overflow.png
info: [obs-websocket] WSServer::start: Not locked to IPv4 bindings
info: [obs-websocket] server started successfully on port 4444
info: [obs-websocket] IO thread started.
info: [obs-backgroundremoval] Destroy scalers.
error: [obs-backgroundremoval] /onnxruntime_src/onnxruntime/core/platform/posix/env.cc:183 onnxruntime::{anonymous}::PosixThread::PosixThread(const char*, int, unsigned int (*)(int, Eigen::ThreadPoolInterface*), Eigen::ThreadPoolInterface*, const onnxruntime::ThreadOptions&) pthread_setaffinity_np failed, error code: 2 error msg: No such file or directory

info: User added filter 'Background Removal' (background_removal) to source 'Video Capture Device (V4L2)'
Segmentation fault (core dumped)

Teminal output of app

Attempted path: share/obs/obs-studio/images/overflow.png
Attempted path: /usr/share/obs/obs-studio/images/overflow.png
info: [obs-websocket] WSServer::start: Not locked to IPv4 bindings
info: [obs-websocket] server started successfully on port 4444
info: [obs-websocket] IO thread started.
info: [obs-backgroundremoval] Destroy scalers.
error: [obs-backgroundremoval] /onnxruntime_src/onnxruntime/core/platform/posix/env.cc:183 onnxruntime::{anonymous}::PosixThread::PosixThread(const char*, int, unsigned int (*)(int, Eigen::ThreadPoolInterface*), Eigen::ThreadPoolInterface*, const onnxruntime::ThreadOptions&) pthread_setaffinity_np failed, error code: 2 error msg: No such file or directory

info: User added filter 'Background Removal' (background_removal) to source 'Video Capture Device (V4L2)'
Segmentation fault (core dumped)
abidkhansocial199 commented 1 year ago

Is there ETA??

nealian commented 1 year ago

This appears to still be an issue in latest/edge == 27.2.1 (2022-02-24).

felamachado commented 1 year ago

Same issue here. Linux Mint 20.3 una

richardnpaul commented 1 year ago

I'll include that this also affects Ubuntu 22.04

snap    2.57.6
snapd   2.57.6
series  16
ubuntu  22.04
kernel  5.17.0-1020-oem
darkery101 commented 1 year ago

I am having the same issue but I notice that the plugin only appears under Audio Filters and not Effect Filters in the filters menu, so I assume this is why this is happening.

richardnpaul commented 1 year ago

I am having the same issue but I notice that the plugin only appears under Audio Filters and not Effect Filters in the filters menu, so I assume this is why this is happening.

Actually in my version the title is Audio/Video filters which makes sense.

percybolmer commented 1 year ago

Any solutions to this?

I've tried Installing OBS manually, no success , flatpak, no success...

Then I saw this snap craft and was so thankful, only to have it crash when I applied it.

I really want that plugin xD

Synthetase commented 1 year ago

Still experiencing this directly after standard snap install, log entry before crash when loading plugin:

09:37:23.531: [obs-backgroundremoval] Destroy scalers.
09:37:23.535: [obs-backgroundremoval] /onnxruntime_src/onnxruntime/core/platform/posix/env.cc:183 onnxruntime::{anonymous}::PosixThread::PosixThread(const char*, int, unsigned int (*)(int, Eigen::ThreadPoolInterface*), Eigen::ThreadPoolInterface*, const onnxruntime::ThreadOptions&) pthread_setaffinity_np failed, error code: 11 error msg: Resource temporarily unavailable
09:37:23.535: 
09:37:23.535: User added filter 'Background Removal' (background_removal) to source 'Kiyo'

Basic info:

OBS 27.1.3-modified (linux) log file uploaded at 2023-03-09, 09:37:38

09:28:46.956: User enabled --multi flag and is now running multiple instances of OBS.
09:28:46.956: Command Line Arguments: --multi
09:28:46.976: CPU Name: Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz
09:28:46.976: CPU Speed: 2600.000MHz
09:28:46.976: Physical Cores: 6, Logical Cores: 12
09:28:46.976: Physical Memory: 31770MB Total, 1391MB Free
09:28:46.976: Kernel Version: Linux 5.14.0-1058-oem
09:28:46.976: Distribution: "Ubuntu Core" "20"
09:28:46.976: Session Type: x11
09:28:46.976: Window System: X11.0, Vendor: The X.Org Foundation, Version: 1.20.13
09:28:46.982: Portable mode: false
09:28:47.039: OBS 27.1.3-modified (linux)
09:28:47.040: ---------------------------------
09:28:47.040: ---------------------------------
09:28:47.040: audio settings reset:
09:28:47.040:   samples per sec: 48000
09:28:47.040:   speakers:        2
09:28:47.052: ---------------------------------
09:28:47.052: Initializing OpenGL...
09:28:47.196: Loading up OpenGL on adapter NVIDIA Corporation NVIDIA GeForce RTX 3090 Ti/PCIe/SSE2
09:28:47.196: OpenGL loaded successfully, version 3.3.0 NVIDIA 530.30.02, shading language 3.30 NVIDIA via Cg compiler
09:28:47.223: ---------------------------------
09:28:47.223: video settings reset:
09:28:47.223:   base resolution:   1920x1080
09:28:47.223:   output resolution: 1280x720
09:28:47.223:   downscale filter:  Bicubic
09:28:47.223:   fps:               30/1
09:28:47.223:   format:            NV12
09:28:47.223:   YUV mode:          709/Partial
09:28:47.223: NV12 texture support not available
09:28:47.257: Audio monitoring device:
09:28:47.257:   name: Default
09:28:47.257:   id: default
09:28:47.257: ---------------------------------
codenissi commented 1 year ago

I encounter the same issue in Ubuntu 22.04, while adding the background removal will crash or close the OBS app.

phisolani commented 9 months ago

Same issue here! Ubuntu 20.04.

flexiondotorg commented 8 months ago

Closed via #172, which removes the background removal plugin.