Coder Social home page Coder Social logo

Comments (5)

royshil avatar royshil commented on July 20, 2024 1

btw i added support for all accepted color spaces in OBS:

enum video_format {
        VIDEO_FORMAT_NONE,

        /* planar 420 format */
        VIDEO_FORMAT_I420, /* three-plane */
        VIDEO_FORMAT_NV12, /* two-plane, luma and packed chroma */

        /* packed 422 formats */
        VIDEO_FORMAT_YVYU,
        VIDEO_FORMAT_YUY2, /* YUYV */
        VIDEO_FORMAT_UYVY,

        /* packed uncompressed formats */
        VIDEO_FORMAT_RGBA,
        VIDEO_FORMAT_BGRA,
        VIDEO_FORMAT_BGRX,
        VIDEO_FORMAT_Y800, /* grayscale */

        /* planar 4:4:4 */
        VIDEO_FORMAT_I444,
};

from obs-backgroundremoval.

royshil avatar royshil commented on July 20, 2024

yep seems like the output format of your camera YU12 is not YUV422_UYVY like the filter expects...

i havn't yet had time fork the code so it finds the right input pixel format... working on it! :D

from obs-backgroundremoval.

HenkKalkwater avatar HenkKalkwater commented on July 20, 2024

Ah, that would make sense. I noticed I had my v4l2-siource set to YUV12 instead of YUV422. Setting it didn't make the plugin crash. Thank you!

from obs-backgroundremoval.

royshil avatar royshil commented on July 20, 2024

@HenkKalkwater can you please share your build steps on linux? e.g. did you apt or yum something, and how did you build? just cmake .. && cmake --build .?

from obs-backgroundremoval.

HenkKalkwater avatar HenkKalkwater commented on July 20, 2024

I had to change the declaration order in the obs_source_info-struct to match the declaration order of OBS, to avoid a critical compiler warning with GCC:

diff --git a/src/background-filter.cpp b/src/background-filter.cpp
index bf534a8..5b26276 100644
--- a/src/background-filter.cpp
+++ b/src/background-filter.cpp
@@ -288,9 +288,9 @@ struct obs_source_info test_filter = {
        .output_flags = OBS_SOURCE_VIDEO | OBS_SOURCE_ASYNC,
        .get_name = filter_getname,
        .create = filter_create,
-       .update = filter_update,
        .destroy = filter_destroy,
-       .filter_video = filter_render,
-       .get_properties = filter_properties,
        .get_defaults = filter_defaults,
+       .get_properties = filter_properties,
+       .update = filter_update,
+       .filter_video = filter_render,
 };

On OpenSUSE, I needed to install obs-studio-devel opencv-devel using zypper and I installed onnx-runtime by downloading the tarball from https://github.com/microsoft/onnxruntime/releases/tag/v1.7.0 and moving the contents to /usr/local like this:

/usr/local
├── include
│   └── onnxruntime
│       └── core
│           ├── providers
│           │   └── cpu
│           │       └── cpu_provider_factory.h
│           └── session
│               ├── cuda_provider_factory.h
│               ├── onnxruntime_c_api.h
│               ├── onnxruntime_cxx_api.h
│               ├── onnxruntime_cxx_inline.h
│               └── onnxruntime_session_options_config_keys.h
└── lib
    ├── libonnxruntime.so
    └── libonnxruntime.so.1.7.0 -> libonnxruntime.so

I couldn't find working OpenSUSE packages for onnxruntime, neither in the official repo's or in the Open Build System.
I'm aware the cuda_provider_factory.h is in the wrong location, but I have no idea where to put it exactly.

After that, cmake .. && cmake build as you described and afterwards moving the files like this:

~/.config/obs-studio
└── plugins
    └── obs-backgroundremoval
        ├── bin
        │   └── 64bit
        │       └── obs-backgroundremoval.so
        └── data
            ├── locale
            │   └── en-US.ini
            └── SINet_Softmax.onnx

from obs-backgroundremoval.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.