obsproject / obs-studio

OBS Studio - Free and open source software for live streaming and screen recording
https://obsproject.com
GNU General Public License v2.0
58.82k stars 7.83k forks source link

The Linux build is now functional, but there is still no Linux instructions #105

Closed iirelu closed 4 years ago

iirelu commented 10 years ago

INSTALL has no Linux instructions because at the time it was written the Linux build didn't work, but now that it's pretty much fully functional it's probably time to list Linux dependencies and instructions.

iirelu commented 10 years ago
sudo apt-get install libpulse-dev qtbase5-dev libqt5x11extras5-dev libavcodec-dev libavformat-dev libswscale-dev libx264-dev libswresample-dev libfdk-aac-dev libxinerama-dev libxcomposite-dev libxrandr-dev
cmake CMakeLists.txt
make
sudo make install

Just to help anyone who finds this while looking for Linux build instructions.

kkartaltepe commented 10 years ago

Similarly for Arch I needed

sudo pacman -S cmake libpulse qt5-base qt5-x11extras ffmpeg libfdk-aac libxinerama libxcomposite libxrandr
cmake CMakeLists.txt
make
sudo make install

Note: I didn't have cmake, and ffmpeg covers the variety of video libraries but may not be the best option (I couldn't find equivalents for all the variety of video libraries)

Kazunekit commented 10 years ago

Actually, Arch has AUR package for obs-studio You can find it here https://aur.archlinux.org/packages/obs-studio-git/

mcat95 commented 10 years ago

I can't get cmake to work. I keep getting this error: CMake Error at /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:108 (message): Could NOT find CXX11 (missing: CXX11_FLAGS) Call Stack (most recent call first): /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:315 (_FPHSA_FAILURE_MESSAGE) cmake/Modules/FindCXX11.cmake:67 (find_package_handle_standard_args) CMakeLists.txt:24 (find_package)

trapped commented 10 years ago

@mcat95: do you have a working C++11 compiler (such as gcc/g++) installed?

mcat95 commented 10 years ago

I have gcc installed in it's lastest version, which says that supost C++11 but it's not enabled by default

admalledd commented 10 years ago

I recently updated (doing a in-place update) to LM17 so I can no longer test this script in respect to QT5, but for semi-automating ffmpeg and making launching scripts that include LD_LIBRARY_PATH and such its very useful still (or at least as a reference)

https://gist.github.com/admalledd/22096af58ee1eaa301d7

For ffmpeg this follows (mostly) https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu with the needed changes for a custom compile/install path

For QT5 I found the minimum .tar.gz files needed to get it working (since I could not find any way to automate the normal installer, ugh)

Also at least tells you what the CMAKE environment vars/options are for changing install and build paths.

Includes in-line launcher script that helps by setting the needed LD_LIBRARY_PATH if you use a custom install path like I prefer to use.

@iirelu what linux exactly is the apt-get for? (I assume something ubuntu 14.04 based with PPAs?) Its important to include such information, eg 13.10 doesn't have libqt5x11extras5-dev (more accurately it has a very broken qt5) and IIRC on almost all *buntu (debian?) based distros by default ship with libav instead of ffmpeg (using the same package names of course, to make it more painful).

jacobmischka commented 10 years ago

@iirelu's commands worked for me on Ubuntu 14.04 with Severinsson's ffmpeg ppa

admalledd commented 10 years ago

@Jacob-Mischka thanks, just wanting to make sure we get all the relevant info in here.

What kind of details should we be looking for in the INSTALL instructions? Do we just want a temporary update for the current state of compiling and operating on linux (basically post the info apt-get info here and the ffmpeg PPA)? From what I read (partially from commit messages/closed issues and others from reading between the lines) it seems likely that some implementation details on how linux compiles might be changing a bit in the future (@jp9000 talked about libav compatibility shims for debian users, slightly different GL code for mesa users, and others). Just wondering if we want a INSTALL/COMPILING file that will likely be broken again quickly due to how fast things are still evolving (although things a little more stable so far) or wait a bit longer.

Personally I vote for including the info we have collected here with 14.04 being the target compile OS using a custom ffmpeg of some sort. Reason being that although very new still it is a LTS release so we should have decent compatibility and stability going forward for quite a while until the dust settles on how new this project still is.

(side note: anyone know anything about setting up our own PPA for obs in the near future?)

jacobmischka commented 10 years ago

@BtbN created one that I've been using for a while and works fine.

It also requires the ffmpeg ppa I mentioned in my previous comment, by the way.

iirelu commented 10 years ago

@admalledd The instructions are for 14.04, yes. Building it on 13.10 is difficult at best, thanks to the mentioned Qt5 issues.

I got that list of packages from the buildlog of ppa:btbn/obs-studio, which is done on Ubuntu 14.04 with ppa:jon-severinsson/ffmpeg.

BtbN commented 10 years ago

The main issue with Ubuntu is libav, before 14.04 the version they used is so outdated that it's impossible to make obs compatible without huge changes. 14.04 finally uses a version that can be replaced with ffmpeg in compatibility mode.

BtbN commented 10 years ago

Libav does not have swresample, you need ffmpeg from the semi-official ppa. Also, your cmake is simply too old, you need 2.8.12.

mcat95 commented 10 years ago

I've up to date 2.8.12 cmake and Jon Severinsson but still missing Libswresample, any idea? Im on Ubuntu 14.04

LiamDawe commented 10 years ago

I annoyingly followed the second comment in here to see if the github was more up to date than the PPA and that by itself is dangerous it turned my entire /usr/local to root only so be warned.

BtbN commented 10 years ago

It does not "turn /usr/local" into root. It just installs obs-studio with that prefix. Never do make install except with a DESTDIR, and especialy never do it as root. cmake does not have make uninstall, so you'll have to manualy remove all files it installed.

The ppa is automaticaly updated once a day by Jenkins.

LiamDawe commented 10 years ago

That's my point though for anyone blindly coming into here and running those commands, they aren't safe by themselves. The second comment didn't have a destdir and said do it as root.

BtbN commented 10 years ago

You're either not on amd64 or x86, which are the only archs launchpad supports publicly, or you did not propperly add the ppa. Use add-apt-repository ppa:btbn/obs-studio

BtbN commented 10 years ago

Launchpad manages itself, it just push to code there and it does the rest. It works fine on my test machine, so you must be doing something wrong.

ubuntuaddicted commented 10 years ago

is it possible to update the INSTALL file with the procedure you want new users to follow in order to install obs-studio in linux? Maybe instructions for Arch and Ubuntu? Those seem to be the most popular. Just a thought.

Vilsol commented 10 years ago

I am getting an error when trying to compile on Ubuntu 14.04:

vilsol@skynet:~/Software/obs-studio/obs-studio$ make
[  1%] Built target glad
[  8%] Built target jansson
Linking C shared library libobs.so
/usr/bin/ld: /usr/local/lib/libavcodec.a(avpacket.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libavcodec.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make[2]: *** [libobs/libobs.so.0] Error 1
make[1]: *** [libobs/CMakeFiles/libobs.dir/all] Error 2
make: *** [all] Error 2

I have the latest ffmpeg drivers, and I already tried changing the CMakeList.txt to add -fPIC but nothing changed.

admalledd commented 10 years ago

That issue is complaining about ffmpeg itself not being built to support shared linking, recompile ffmpeg (or find a prebuilt) with --enable-shared

Vilsol commented 10 years ago

Compiled from source with --enable-shared, didn't fix it.

BtbN commented 10 years ago

Just use the PPA to get ffmpeg. It's what the launchpad builds also does it and works fine.

jp9000 commented 10 years ago

I will update the manual build instructions for people who want a development environment, though it'll have to wait until after I restructure the repo.

AngryPenguinPL commented 10 years ago

Hi. Im trying build this on my Linux Mageia 4 x64 but I have small issue.

[x@localhost obs-studio (master)]$ cmake CMakeLists.txt -- Jansson >=2.5 not found, building bundled version CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:108 (message): Could NOT find Libswscale (missing: SWSCALE_LIB FFMPEG_INCLUDE_DIR) Call Stack (most recent call first): /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:315 (_FPHSA_FAILURE_MESSAGE) cmake/Modules/FindLibswscale.cmake:37 (find_package_handle_standard_args) libobs/CMakeLists.txt:3 (find_package)

-- Configuring incomplete, errors occurred! See also "/home/x/obs-studio/CMakeFiles/CMakeOutput.log". See also "/home/x/obs-studio/CMakeFiles/CMakeError.log". [x@localhost obs-studio (master)]$

I have installed latest ffmpeg 2.3.1 and this libswscaler2 and lib64swscaler2... but still not working. Any know how fix this?

jp9000 commented 10 years ago

Everyone* okay with the new linux build instructions? Because each distribution has different names for specific sets of packages, there's no "one size fits all" set of instructions that can really work for linux.

iirelu commented 10 years ago

Having instructions for one or two major distros is fine, as users of obscure ones can usually figure the rest by themselves.

jp9000 commented 10 years ago

Valid point.