Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Looking for help to build under Windows #146

Closed
HuBandiT opened this issue Jan 22, 2024 · 3 comments
Closed

Looking for help to build under Windows #146

HuBandiT opened this issue Jan 22, 2024 · 3 comments

Comments

@HuBandiT
Copy link

HuBandiT commented Jan 22, 2024

Source/filter types
Face Tracker (source code)

Describe your problem
I would like to do some modifications to the plug-in (source code) and then compile it. I am on Windows. I have a working development environment for obs-studio, which successfully compiles and runs obs-studio itself.

Now I am looking for a way to do the same for obs-face-tracker.

Desktop (please complete the following information):

Additional context
I see the steps in the file .github/workflows/main.yml, but I don't know GitHub Workflows, and I am new to CMake as well, so I do not know, how to perform those steps on my local computer to generate a working build environment, including an .sln file for the development environment Visual Studio.

Thank you kindly in advance.

@HuBandiT HuBandiT changed the title Any help for building under Windows? Looking for help for building under Windows? Jan 22, 2024
@HuBandiT HuBandiT changed the title Looking for help for building under Windows? Looking for help for building under Windows Jan 22, 2024
@HuBandiT HuBandiT changed the title Looking for help for building under Windows Looking for help to build under Windows Jan 22, 2024
@norihiro
Copy link
Owner

norihiro commented Jan 22, 2024

At first, you need to have directory structure like below.

  • obs-studio
  • obs-face-tracker
    • dlib (If not found, please go to obs-face-tracker directory and run git submodule update --init, this directory will be created.)

And, also download model files from https://github.com/davisking/dlib-models; mmod_human_face_detector.dat.bz2 and shape_predictor_5_face_landmarks.dat.bz2.
Extract them. Place mmod_human_face_detector.dat and shape_predictor_5_face_landmarks.dat under obs-face-tracker/data/dlib_cnn_model and obs-face-tracker/data/dlib_face_landmark_model, respectively.

Then, go to the directory obs-face-tracker and follow the command below.

$CmakeArgs = @(
'-G', "${{ env.visualStudio }}"
'-DQT_VERSION=${{ steps.obsdeps.outputs.OBS_QT_VERSION_MAJOR }}'
'-DCMAKE_SYSTEM_VERSION=10.0.18363.657'
"-DCMAKE_INSTALL_PREFIX=$(Resolve-Path -Path "./obs-build-dependencies/plugin-deps-${{ matrix.arch }}")"
"-DCMAKE_PREFIX_PATH=$(Resolve-Path -Path "./obs-build-dependencies/plugin-deps-${{ matrix.arch }}")"
)
cmake -S . -B build @CmakeArgs
cmake --build build --config RelWithDebInfo -j 4
cmake --install build --config RelWithDebInfo --prefix "$(Resolve-Path -Path .)/release"

@CmakeArgs is a variable and you may extract the line 383 like make -S . -B build -G "Visual Studio 17 2022" -DQT_VERSION=6 -DCMAKE_SYSTEM_VERSION=10.0.18363.657
And also need to add the options starting with -DCMAKE_INSTALL_PREFIX= and -DCMAKE_PREFIX_PATH= so that make can find libobs configuration file but I don't know exactly how it should be configured.

Usually I don't use Windows. Above comment might not be insufficient.

@HuBandiT
Copy link
Author

Thank you, this just gave me the right amount of push.

I started with your cmake suggestion, and then kept adding directories for libraries cmake reported as not found, until finally this gave me no errors anymore:

cmake -S . -B build -G "Visual Studio 17 2022" -DQT_VERSION=6 -DLIBOBS_INCLUDE_DIR=$PWD/../obs-studio/libobs -DLIBOBS_LIB=$PWD/../obs-studio/libobs -Dlibobs_DIR=$PWD/../obs-studio/build_x64/libobs -Dw32-pthreads_DIR=$PWD/../obs-studio/build_x64/deps/w32-pthreads/ -Dobs-frontend-api_DIR=$PWD/../obs-studio/build_x64/UI/obs-frontend-api/ -DQt6_DIR=$PWD/../obs-studio/.deps/obs-deps-qt6-2023-11-03-x64/lib/cmake/Qt6/ -DQt6CoreTools_DIR=$PWD/../obs-studio/.deps/obs-deps-qt6-2023-11-03-x64/lib/cmake/Qt6CoreTools/ -DQt6GuiTools_DIR=$PWD/../obs-studio/.deps/obs-deps-qt6-2023-11-03-x64/lib/cmake/Qt6GuiTools/

I assume there is a better way, but I put it here for future reference for others who are similarly clueless about cmake as I am but might want to work on this.

@HuBandiT
Copy link
Author

HuBandiT commented Jan 24, 2024

and I needed do update libvisca after this to be able to do a Debug build:

cd libvisca
git pull origin HEAD

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants