Skip to content
This repository was archived by the owner on Mar 15, 2021. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,25 +30,25 @@ issue #17][vcam#17].

## Build

- Install QT
- Install QT + dev packages

Ubuntu/Debian:
```
sudo apt install qtbase5-dev
sudo apt install qtbase5-dev libobs-dev
```

- Get obs-studio source code

Fedora 32:
```
git clone --recursive https://github.com/obsproject/obs-studio.git
sudo dnf install obs-studio-libs qt5-qtbase-devel
```

- Build plugins
- Build plugin:

```
git clone https://github.com/CatxFish/obs-v4l2sink.git
cd obs-v4l2sink
mkdir build && cd build
cmake -DLIBOBS_INCLUDE_DIR="../../obs-studio/libobs" -DCMAKE_INSTALL_PREFIX=/usr ..
cmake ..
Copy link

@scottlinux scottlinux May 5, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to specify the make install prefix as well like:

-DCMAKE_INSTALL_PREFIX=/usr

Otherwise the make install puts the plugin in /usr/local/lib/obs-plugins/v4l2sink.so which obs does not see on Fedora.

obs on Fedora appears to expect:

/usr/lib64/obs-plugins/v4l2sink.so

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

798adea

added it back in ^^

make -j4
sudo make install
```
30 changes: 9 additions & 21 deletions external/FindLibObs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,6 @@ if(DEFINED CMAKE_BUILD_TYPE)
endif()
endif()

find_path(LIBOBS_INCLUDE_DIR
NAMES obs.h
HINTS
ENV obsPath${_lib_suffix}
ENV obsPath
${obsPath}
PATHS
/usr/include /usr/local/include /opt/local/include /sw/include
PATH_SUFFIXES
libobs
)

function(find_obs_lib base_name repo_build_path lib_name)
string(TOUPPER "${base_name}" base_name_u)

Expand Down Expand Up @@ -79,29 +67,29 @@ find_obs_lib(LIBOBS libobs obs)
if(MSVC)
find_obs_lib(W32_PTHREADS deps/w32-pthreads w32-pthreads)
endif()

set(LIBOBS_CMAKE_PATH ${LibObs_DIR}/LibObsConfig.cmake)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Libobs DEFAULT_MSG LIBOBS_LIB LIBOBS_INCLUDE_DIR)
mark_as_advanced(LIBOBS_INCLUDE_DIR LIBOBS_LIB)
find_package_handle_standard_args(Libobs DEFAULT_MSG LIBOBS_LIB LIBOBS_CMAKE_PATH)
mark_as_advanced(LIBOBS_CMAKE_PATH LIBOBS_LIB)

if(LIBOBS_FOUND)
include(${LIBOBS_CMAKE_PATH})
if(MSVC)
if (NOT DEFINED W32_PTHREADS_LIB)
message(FATAL_ERROR "Could not find the w32-pthreads library" )
endif()

set(W32_PTHREADS_INCLUDE_DIR ${LIBOBS_INCLUDE_DIR}/../deps/w32-pthreads)
endif()

set(LIBOBS_INCLUDE_DIRS ${LIBOBS_INCLUDE_DIR} ${W32_PTHREADS_INCLUDE_DIR})
set(LIBOBS_INCLUDE_DIRS ${LIBOBS_INCLUDE_DIRS} ${W32_PTHREADS_INCLUDE_DIR})
set(LIBOBS_LIBRARIES ${LIBOBS_LIB} ${W32_PTHREADS_LIB})
include(${LIBOBS_INCLUDE_DIR}/../cmake/external/ObsPluginHelpers.cmake)

# allows external plugins to easily use/share common dependencies that are often included with libobs (such as FFmpeg)
if(NOT DEFINED INCLUDED_LIBOBS_CMAKE_MODULES)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${LIBOBS_INCLUDE_DIR}/../cmake/Modules/")
if(DEFINED LIBOBS_CMAKE_MODULES)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${LIBOBS_CMAKE_MODULES}/cmake/Modules/")
set(INCLUDED_LIBOBS_CMAKE_MODULES true)
endif()
else()
message(FATAL_ERROR "Could not find the libobs library" )
message(FATAL_ERROR "Could not find the libobs library ${LIBOBS_CMAKE_PATH}" )
endif()