Compile and run obs source code on wsl2
Trying to learn about video development, and found that obs is open-sourced.
This post details the process of compiling and run the source code on wsl2.
The wsl2 uses ubuntu24.04
Steps
- Install the prerequisites
- Install nvenc sudo apt install libffmpeg-nvenc-dev(This will resolve theCould NOT find FFnvcodecerror.-DENABLE_NATIVE_NVENC=OFFdoesn’t work)
- Generate build environment cmake -S . -B build -G Ninja -DENABLE_AJA=0 -DENABLE_PIPEWIRE=OFF -DENABLE_WEBRTC=0 -DQT_VERSION=6
- Run cmake --build build
- Run cmake --build build --target package
- Run sudo apt-mark hold obs-studio
- Run sudo apt install build/obs-studio-*.deb
- Run sudo ldconfig(This will resolveerror while loading shared libraries: libobs-frontend-api.so)
- Run obs
 This post is licensed under  CC BY 4.0  by the author.
