obs-ios-camera-source icon indicating copy to clipboard operation
obs-ios-camera-source copied to clipboard

Is a Linux version on the Roadmap?

Open Matheus-de-Souza opened this issue 5 years ago • 18 comments

Hello, I've bought the iOS app, and it works very well with Windows. But, now I'm switching to Linux (Ubuntu Studio) and I would like to know if you have plans to make a Linux version for the obs plugin too.

Matheus-de-Souza avatar Jan 02 '20 15:01 Matheus-de-Souza

I actually ported the code to work on Linux last year, but you'll have to build it yourself. See my comment here:

https://github.com/wtsnz/obs-ios-camera-source/issues/26#issuecomment-522160053

EDIT 7/12/2020: I tried to put all the relevant information into a single location and help with branch confusion. My fork's master branch now contains the linux support changes, along with compilation/installation instructions in the README: https://github.com/dougg3/obs-ios-camera-source

dougg3 avatar Mar 27 '20 14:03 dougg3

Trying to get this working now - it keeps complaining about ffmpeg and cmake... we'll see.

harwoodr avatar Mar 29 '20 21:03 harwoodr

You may be missing various *-dev packages if you're using Ubuntu -- for example a commenter on the issue I linked said he needed to install libobs-dev and libavcodec-dev.

dougg3 avatar Mar 29 '20 21:03 dougg3

Nope... got them... there's no cmake file for ffmpeg... I changed a couple of things:

#find_package(FFmpeg REQUIRED COMPONENTS avcodec avutil)

find_ffmpeg_library(avcodec)

find_ffmpeg_library(avutil)

find_library( AVCODEC_LIBRARY avcodec ) find_library( AVUTIL_LIBRARY avutil )

include_directories( "${LIBOBS_INCLUDE_DIR}/../UI/obs-frontend-api" ${AVCODEC_INCLUDE_DIRS} ${AVUTIL_INCLUDE_DIRS} )

...and it seems to compile (just finished...)

harwoodr avatar Mar 29 '20 21:03 harwoodr

I'm currently on Windows and will be switching soon. I hope we could get official support, that would be awesome.

ghost avatar May 28 '20 15:05 ghost

@harwoodr (or anybody else who knows) I'm trying to compile for Arch Linux. I've got the built libs and includes for ffmpeg in a local folder, but I don't know how to incorporate the changes to CMakeLists.txt that you made (I'm assuming that's where you made the changes), so I still get the cmake errors, as your originally reported.

If I may ask, where in the CMakeLists.txt did you make the change and how [else] do I point to the ffmpeg includes?

UPDATE:

Never mind. I made the changes through trial and error. For others who wish to get over this hurdle:

#find_package(FFmpeg REQUIRED COMPONENTS avcodec avutil)
#find_ffmpeg_library(avcodec)
#find_ffmpeg_library(avutil)
find_library(AVCODEC_LIBRARY avcodec)
find_library(AVUTIL_LIBRARY avutil)

and then, further down the CMakeLists.txt:

#find_package(FFmpeg REQUIRED COMPONENTS avcodec avutil)

find_library(AVCODEC_LIBRARY avcodec)
find_library(AVUTIL_LIBRARY avutil)

# include_directories( 
# 	"${LIBOBS_INCLUDE_DIR}/../UI/obs-frontend-api"
# 	${FFMPEG_INCLUDE_DIRS}
# )
include_directories( 
	"${LIBOBS_INCLUDE_DIR}/../UI/obs-frontend-api"
	"/absolute/path/of/ffmpeg-git/pkg/ffmpeg-git/usr/include/avcodec"
	"/absolute/path/of/ffmpeg-git/pkg/ffmpeg-git/usr/include/avutil"
)

hpetrus avatar Jul 07 '20 12:07 hpetrus

Now, I get a build error, as follows:

[ 73%] Building CXX object CMakeFiles/portal.dir/deps/portal/src/Channel.cpp.o
In file included from /path/to/obs-ios-camera-source-master/deps/portal/src/Channel.hpp:22,
                 from /path/to/obs-ios-camera-source-master/deps/portal/src/Channel.cpp:19:
/path/to/obs-ios-camera-source-master/deps/portal/src/Channel.cpp: In destructor ‘virtual portal::Channel::~Channel()’:
/path/to/obs-ios-camera-source-master/deps/portal/src/logging.h:28:48: error: ‘stderr’ was not declared in this scope
   28 |     do { if (PORTAL_DEBUG_LOG_ENABLED) fprintf(stderr, "%s:%d:%s(): " format, __FILE__, __LINE__, __func__, ## __VA_ARGS__); } while (0)
      |                                                ^~~~~~
/path/to/obs-ios-camera-source-master/deps/portal/src/Channel.cpp:38:9: note: in expansion of macro ‘portal_log’
   38 |         portal_log("%s: Deallocating\n", __func__);
      |         ^~~~~~~~~~
/path/to/obs-ios-camera-source-master/deps/portal/src/Channel.cpp:20:1: note: ‘stderr’ is defined in header ‘<cstdio>’; did you forget to ‘#include <cstdio>’?
   19 | #include "Channel.hpp"
  +++ |+#include <cstdio>
   20 | 
In file included from /path/to/obs-ios-camera-source-master/deps/portal/src/Channel.hpp:22,
                 from /path/to/obs-ios-camera-source-master/deps/portal/src/Channel.cpp:19:
/path/to/obs-ios-camera-source-master/deps/portal/src/logging.h:28:40: error: ‘fprintf’ was not declared in this scope; did you mean ‘wprintf’?
   28 |     do { if (PORTAL_DEBUG_LOG_ENABLED) fprintf(stderr, "%s:%d:%s(): " format, __FILE__, __LINE__, __func__, ## __VA_ARGS__); } while (0)
      |                                        ^~~~~~~
/path/to/obs-ios-camera-source-master/deps/portal/src/Channel.cpp:38:9: note: in expansion of macro ‘portal_log’
   38 |         portal_log("%s: Deallocating\n", __func__);
      |         ^~~~~~~~~~
/path/to/obs-ios-camera-source-master/deps/portal/src/Channel.cpp: In member function ‘void portal::Channel::InternalThreadEntry()’:
/path/to/obs-ios-camera-source-master/deps/portal/src/logging.h:28:48: error: ‘stderr’ was not declared in this scope
   28 |     do { if (PORTAL_DEBUG_LOG_ENABLED) fprintf(stderr, "%s:%d:%s(): " format, __FILE__, __LINE__, __func__, ## __VA_ARGS__); } while (0)
      |                                                ^~~~~~
/path/to/obs-ios-camera-source-master/deps/portal/src/Channel.cpp:92:17: note: in expansion of macro ‘portal_log’
   92 |                 portal_log("There was an error receiving data");
      |                 ^~~~~~~~~~
/path/to/obs-ios-camera-source-master/deps/portal/src/logging.h:28:48: note: ‘stderr’ is defined in header ‘<cstdio>’; did you forget to ‘#include <cstdio>’?
   28 |     do { if (PORTAL_DEBUG_LOG_ENABLED) fprintf(stderr, "%s:%d:%s(): " format, __FILE__, __LINE__, __func__, ## __VA_ARGS__); } while (0)
      |                                                ^~~~~~
/path/to/obs-ios-camera-source-master/deps/portal/src/Channel.cpp:92:17: note: in expansion of macro ‘portal_log’
   92 |                 portal_log("There was an error receiving data");
      |                 ^~~~~~~~~~
/path/to/obs-ios-camera-source-master/deps/portal/src/logging.h:28:40: error: ‘fprintf’ was not declared in this scope; did you mean ‘wprintf’?
   28 |     do { if (PORTAL_DEBUG_LOG_ENABLED) fprintf(stderr, "%s:%d:%s(): " format, __FILE__, __LINE__, __func__, ## __VA_ARGS__); } while (0)
      |                                        ^~~~~~~
/path/to/obs-ios-camera-source-master/deps/portal/src/Channel.cpp:92:17: note: in expansion of macro ‘portal_log’
   92 |                 portal_log("There was an error receiving data");
      |                 ^~~~~~~~~~
make[2]: *** [CMakeFiles/portal.dir/build.make:83: CMakeFiles/portal.dir/deps/portal/src/Channel.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:136: CMakeFiles/portal.dir/all] Error 2
make: *** [Makefile:104: all] Error 2

I'm using the latest obs-ios-camera-source-master. Again, I'm building on Arch Linux version current in all departments. Any help would be appreciated.

hpetrus avatar Jul 07 '20 12:07 hpetrus

@hpetrus you have to use my linux-support branch from last year -- it fixes several compile issues on Linux. I haven't checked out this project for a while...looks like there are some new commits I need to bring in soon. Anyway, this branch should build:

https://github.com/dougg3/obs-ios-camera-source/tree/linux-support

dougg3 avatar Jul 08 '20 00:07 dougg3

@dougg3 thanks for getting back to me on this issue. I'm super grateful that you've got this branch going in the first place. I'll compile your latest commit, but also look forward to whatever rebase you might bring from the original master. I'll be following closely!

Question: Will this version compile against the latest OBS Studio source, do you know? If not, what version of OBS source should I acquire and will the resulting build work on the latest OBS Studio build?

hpetrus avatar Jul 08 '20 00:07 hpetrus

@dougg3 unfortunately, I'm still getting the same make error with your last commit (see my previous post above with the error messages). What might this be because of?

When I regenerate my CMakeCache.txt, I get the following warning:

Configuring done
CMake Warning (dev) in CMakeLists.txt:
  AUTOGEN: No valid Qt version found for target obs-ios-camera-source.
  AUTOMOC and AUTOUIC disabled.  Consider adding:

    find_package(Qt<QTVERSION> COMPONENTS Widgets)

  to your CMakeLists.txt file.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) in CMakeLists.txt:
  AUTOGEN: No valid Qt version found for target portal.  AUTOMOC and AUTOUIC
  disabled.  Consider adding:

    find_package(Qt<QTVERSION> COMPONENTS Widgets)

  to your CMakeLists.txt file.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) in CMakeLists.txt:
  AUTOGEN: No valid Qt version found for target libusbmuxd.  AUTOMOC and
  AUTOUIC disabled.  Consider adding:

    find_package(Qt<QTVERSION> COMPONENTS Widgets)

  to your CMakeLists.txt file.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) in CMakeLists.txt:
  AUTOGEN: No valid Qt version found for target libplist.  AUTOMOC and
  AUTOUIC disabled.  Consider adding:

    find_package(Qt<QTVERSION> COMPONENTS Widgets)

  to your CMakeLists.txt file.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) in CMakeLists.txt:
  AUTOGEN: No valid Qt version found for target libcnary.  AUTOMOC and
  AUTOUIC disabled.  Consider adding:

    find_package(Qt<QTVERSION> COMPONENTS Widgets)

  to your CMakeLists.txt file.
This warning is for project developers.  Use -Wno-dev to suppress it.

Generating done

hpetrus avatar Jul 08 '20 00:07 hpetrus

@hpetrus As of the last time I tried it, the current OBS Studio source worked fine.

On the compile error: I'm not sure, I've never seen those issues before. I wonder if Arch has some newer GCC or libstdc++ that adds additional checks. I know it works in Ubuntu 18.04. You could try adding #include <cstdio> in deps/portal/src/logging.h since that seems to be what the error is about.

I'm also not sure about the CMakeLists.txt warnings. Maybe make sure you're starting again from a clean build directory after you switched to my branch? It's weird because I don't see any Qt dependencies.

dougg3 avatar Jul 08 '20 02:07 dougg3

Just a heads up for future people who are trying to build the Linux version, I rearranged things a bit to help streamline the Linux build process and put all the relevant documentation in a single place. My fork's master branch now has the Linux fixes, along with an updated README.md with build/install instructions:

https://github.com/dougg3/obs-ios-camera-source

dougg3 avatar Jul 12 '20 18:07 dougg3

@dougg3 Building with your patches and instructions works for me.

Thank you so much for enabling an ubuntu 20.04 linux build of what looks like a truly awesome plugin/app by @wtsnz.

As the whole apple ecosystem, as well as ubuntu are new to me, will give this and the iphone a setup and test in the morning, so I can have a whole day to enjoy what needs to be done to get it up and running.

dithotxgh avatar Jul 14 '20 06:07 dithotxgh

replying to self: https://github.com/wtsnz/obs-ios-camera-source/issues/31#issuecomment-657993013, which was a reply to https://github.com/wtsnz/obs-ios-camera-source/issues/31#issuecomment-657256633

Wow. As the ozzies would say, a thing of beauty, a joy forever.

dithotxgh avatar Jul 14 '20 14:07 dithotxgh

@dougg3 thanks for updating!

I got it to compile on Arch with some modifications to your CMakeLists.txt and some Arch-specific deps handling. I think it would be best to share my solution, which you helped me find. Should I post it under a new thread, or post it all here?

hpetrus avatar Jul 15 '20 00:07 hpetrus

I'm glad it's working for you guys! @hpetrus I would recommend posting an issue about it over at my repository. Maybe we can figure out a way to make it compatible with both Ubuntu and Arch.

dougg3 avatar Jul 15 '20 02:07 dougg3

Is there any update on upstream Linux support?

dginovker avatar Nov 29 '22 19:11 dginovker

@dougg3 Thanks, man! It's working perfectly. I installed it in a couple of minutes on Ubuntu 22.

Shahzainali avatar Mar 27 '24 01:03 Shahzainali