Code Monkey home page Code Monkey logo

Comments (29)

Vilsol avatar Vilsol commented on May 18, 2024 1

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.

from obs-studio.

admalledd avatar admalledd commented on May 18, 2024 1

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

from obs-studio.

iirelu avatar iirelu commented on May 18, 2024
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.

from obs-studio.

kkartaltepe avatar kkartaltepe commented on May 18, 2024

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)

from obs-studio.

Kazunekit avatar Kazunekit commented on May 18, 2024

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

from obs-studio.

mcat95 avatar mcat95 commented on May 18, 2024

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)

from obs-studio.

trapped avatar trapped commented on May 18, 2024

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

from obs-studio.

mcat95 avatar mcat95 commented on May 18, 2024

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

from obs-studio.

admalledd avatar admalledd commented on May 18, 2024

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).

from obs-studio.

jacobmischka avatar jacobmischka commented on May 18, 2024

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

from obs-studio.

admalledd avatar admalledd commented on May 18, 2024

@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?)

from obs-studio.

jacobmischka avatar jacobmischka commented on May 18, 2024

@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.

from obs-studio.

iirelu avatar iirelu commented on May 18, 2024

@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.

from obs-studio.

BtbN avatar BtbN commented on May 18, 2024

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.

from obs-studio.

BtbN avatar BtbN commented on May 18, 2024

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.

from obs-studio.

mcat95 avatar mcat95 commented on May 18, 2024

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

from obs-studio.

LiamDawe avatar LiamDawe commented on May 18, 2024

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.

from obs-studio.

BtbN avatar BtbN commented on May 18, 2024

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.

from obs-studio.

LiamDawe avatar LiamDawe commented on May 18, 2024

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.

from obs-studio.

BtbN avatar BtbN commented on May 18, 2024

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

from obs-studio.

BtbN avatar BtbN commented on May 18, 2024

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.

from obs-studio.

ubuntuaddicted avatar ubuntuaddicted commented on May 18, 2024

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.

from obs-studio.

Vilsol avatar Vilsol commented on May 18, 2024

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

from obs-studio.

BtbN avatar BtbN commented on May 18, 2024

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

from obs-studio.

jp9000 avatar jp9000 commented on May 18, 2024

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.

from obs-studio.

AngryPenguinPL avatar AngryPenguinPL commented on May 18, 2024

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?

from obs-studio.

jp9000 avatar jp9000 commented on May 18, 2024

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.

from obs-studio.

iirelu avatar iirelu commented on May 18, 2024

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

from obs-studio.

jp9000 avatar jp9000 commented on May 18, 2024

Valid point.

from obs-studio.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.