Trying To Build OBS Redux

dacoder

Member
Hello again, I have been trying to compile the dev version of OBS from this guide:
https://github.com/jp9000/obs-studio/blob/master/INSTALL
So am I doing it wrong, or is the rewrite not reached a stage of being able to be compiled?
I am building it with VS2013, the whole project, and I have compiled and added both QT5 and FFmpeg to my windows environment variables.
But: on trying to build I get numerous errors:
Code:
Error	1	error MSB6006: "cmd.exe" exited with code 3.	C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets	170	5	obs-studio
Error	2	error C1083: Cannot open include file: 'libavutil/opt.h': No such file or directory	d:\users\dacoder\downloads\obs-studio-master\obs-studio-master\libobs\media-io\audio-resampler-ffmpeg.c	21	1	libobs
Error	3	error LNK1104: cannot open file 'libobs.lib'	D:\Users\DaCoder\Downloads\obs-studio-master\obs-studio-master\vs\2013\wintest\LINK	wintest
Error	4	error LNK1104: cannot open file 'libobs.lib'	D:\Users\DaCoder\Downloads\obs-studio-master\obs-studio-master\vs\2013\libobs-d3d11\LINK	libobs-d3d11
Error	5	error LNK1104: cannot open file 'libobs.lib'	D:\Users\DaCoder\Downloads\obs-studio-master\obs-studio-master\vs\2013\libobs-opengl\LINK	libobs-opengl
Error	6	error C1083: Cannot open include file: 'libavformat/avformat.h': No such file or directory	d:\users\dacoder\downloads\obs-studio-master\obs-studio-master\plugins\obs-ffmpeg\obs-ffmpeg-output.h	24	1	obs-ffmpeg
Error	7	error LNK1104: cannot open file 'libobs.lib'	D:\Users\DaCoder\Downloads\obs-studio-master\obs-studio-master\vs\2013\test-input\LINK	test-input

So what have I done wrong, (I don't use Visual Studo, but I have done C++ and C) from this, it would seem, it is trying to include some things from FFmpeg, and OpenGL, but I have setup the paths correctly, so I am uncertain as to why this is happening.
 

Lain

Forum Admin
Lain
Forum Moderator
Developer
Well I'm not entirely sure what it is you're doing but you've definitely not set it up correctly. I'm pretty sure that's not the entire build command line either, I would have to see the entire thing to be able to tell you why.
 

dacoder

Member
Jim said:
Well I'm not entirely sure what it is you're doing but you've definitely not set it up correctly. I'm pretty sure that's not the entire build command line either, I would have to see the entire thing to be able to tell you why.

So post the whole build log? Alright, will do.
 

Lain

Forum Admin
Lain
Forum Moderator
Developer
Yea, please do. Make sure to attach it as a text file or use code tags as per usual.
 

ScarFace

New Member
Having the same cmd.exe error.
It says that is has to do with the custom build object, which probably means it has problems with Qt5. Don't know the solution though...

As far as the libobs, it probably means that ffmpeg is not found (it needs it to create libavutil/opt.h)

I managed to finish a build of ffmpeg through this

But i don't really understand what to do with Qt5... grab the pre-built, or compile? and when compiling i tried to follow this guide but i am getting some errors while using nmake.

Hope it helped a bit, and hopefully we can get some further info on using Qt5 here
 

Lain

Forum Admin
Lain
Forum Moderator
Developer
Building on windows right now is difficult. They don't provide VS2013-compatible binaries yet (I think that's late next month when they will), so it has to be built manually. I actually at this point would probably not recommend doing it if you're not experienced with this sort of thing, because it's going to be somewhat painful.

Download the Qt5 repo
Set up the Qt5 repo
Build the Qt5 repo (preferably with jom to utilize all your cores)

Building FFmpeg is a bit painful too. I would probably recommend downloading a prebuilt distribution somewhere if you can. Otherwise you'll have to follow the build instructions on their site. Make sure to build it with the correct architecture as well. After doing that, set the FFmpegPath environment variable to the ffmpeg path where you cloned the repo to.

It'll probably need x264 if using cmake as well, though you don't need to actually compile it. x264Path should be what you have to set for the clone dir.

I personally just use the VS project files on windows, I have it set up just the way I like right now
 

dacoder

Member
So is there a x64 architecture for the OBS build? I have compiled ffmpeg (actually for my livestream application for ubuntu) not qt5 yet. I suppose I should just get x32 for both qt5 and ffmpeg, even though I have a x64 pc.

I installed a x64 qt5 and a x64 ffmpeg, in the path areas should i place the path to qt5's tools for qtCreator, or just the 5.2.1 release, or the folder in that folder? "Installation folder" is a bit in-precise. Likewise: FFmpeg's builds are installed to a path with "bin" and etc. in it. Should the path for "FFmpegPath" be set to the bin? or the folder containing thereof?
 

dacoder

Member
dacoder said:
So is there a x64 architecture for the OBS build? I have compiled ffmpeg (actually for my livestream application for ubuntu) not qt5 yet. I suppose I should just get x32 for both qt5 and ffmpeg, even though I have a x64 pc.

I installed a x64 qt5 and a x64 ffmpeg, in the path areas should i place the path to qt5's tools for qtCreator, or just the 5.2.1 release, or the folder in that folder? "Installation folder" is a bit in-precise. Likewise: FFmpeg's builds are installed to a path with "bin" and etc. in it. Should the path for "FFmpegPath" be set to the bin? or the folder containing thereof?

I fixed the the issue, I went back and found that my lib32 and lib64 files (in the FFmpeg path area) did not have any .libs in 'em! Fixed and fixed man, will let you know what else comes up!

Fixed it, going with x32, since your project seems to want to stay in x32 mode? :/
Compile FFmpeg and Qt5(Until they release a binary VS2013 version).
They should both be compiled with VS2013.

Here is the issue I have been having, I need to compile this version sadly.

Getting errors on Qt5 compile, but that is irrelevant to this post.
After 3 hours or so trying to compile it, I decided to just wait for a 2013 release :P
Compiling is so much easier on Linux, man.
 

ScarFace

New Member
Found the problem with the cmd.exe error.

Seems when you pull the qt5 repository, it has a different folder layout as the programmer probably has.
The necessary "include" folder for qt5 is not in the qt5 root folder, but in "qt5/qtbase/".

So you should set the QTDIR environment variable to (example) "C:\qt5\qtbase".

Or like lazy me:

Cut the qtbase folder
Paste it up one directory
Throw the remaining qt5 folder away
Rename the qtbase folder to qt5

(for some reason the project still used the previous locations and cleaning the build didn't fix it for me)

You probably won't need the other files so i got rid of all excess stuff.

after adding some .dll files and the stuff from the build folder of obs-studio, i finally got it to work. But right now it is clear that it is still way before alpha release. So you will be better of waiting just a bit longer.
 

dacoder

Member
ScarFace said:
Found the problem with the cmd.exe error.

Seems when you pull the qt5 repository, it has a different folder layout as the programmer probably has.
The necessary "include" folder for qt5 is not in the qt5 root folder, but in "qt5/qtbase/".

So you should set the QTDIR environment variable to (example) "C:\qt5\qtbase".

Or like lazy me:

Cut the qtbase folder
Paste it up one directory
Throw the remaining qt5 folder away
Rename the qtbase folder to qt5

(for some reason the project still used the previous locations and cleaning the build didn't fix it for me)

You probably won't need the other files so i got rid of all excess stuff.

after adding some .dll files and the stuff from the build folder of obs-studio, i finally got it to work. But right now it is clear that it is still way before alpha release. So you will be better of waiting just a bit longer.

Oh I had the wrong version aswell, but glad you found another issue :D
 

dacoder

Member
Building on windows right now is difficult. They don't provide VS2013-compatible binaries yet (I think that's late next month when they will), so it has to be built manually. I actually at this point would probably not recommend doing it if you're not experienced with this sort of thing, because it's going to be somewhat painful.

Download the Qt5 repo
Set up the Qt5 repo
Build the Qt5 repo (preferably with jom to utilize all your cores)

Building FFmpeg is a bit painful too. I would probably recommend downloading a prebuilt distribution somewhere if you can. Otherwise you'll have to follow the build instructions on their site. Make sure to build it with the correct architecture as well. After doing that, set the FFmpegPath environment variable to the ffmpeg path where you cloned the repo to.

It'll probably need x264 if using cmake as well, though you don't need to actually compile it. x264Path should be what you have to set for the clone dir.

I personally just use the VS project files on windows, I have it set up just the way I like right now

I know this is an old post, but QT5 (i have just found out) have put out a VS2013 build. Now I am super close to finishing the compile for this :D

Here is the only problem i am having (i am trying to compile in x64...

And this error appears:
Error 14 error LNK1112: module machine type 'x64' conflicts with target machine type 'X86' D:\Users\DaCoder\Downloads\OBS STUDIO\obs-studio-master\obs-studio-master\vs\2013\obs-studio\Qt5Cored.lib(Qt5Cored.dll) obs-studio

Do I just have to compile in 32 bit? Qt5 + FFmpeg are both 64 bit

EDIT: Found it was just a VS2013 configuration bug, now im left with this sole error:
Error 1 error C1083: Cannot open include file: 'x264.h': No such file or directory D:\Users\DaCoder\Downloads\OBS STUDIO\obs-studio-master\obs-studio-master\plugins\obs-x264\obs-x264.c 21 1 obs-x264

EDITx2: Just didn't compile the x264 and it compiled correctly! :D still can't run obs-studio.exe, what are you supposed to do with the .exe and files after it compiles? I cannot seem to find any info on that...
 
Last edited:

Lain

Forum Admin
Lain
Forum Moderator
Developer
Currently if you build it bare on windows you can run it through visual studio. To make a fully modular version you need to include all the necessary qt5 dlls, which is incredibly annoying.
 

Stulander

New Member
Dacoder, did you ever get this compiled? Jim, what works in this version?

I'm looking to capture a full-screen video game and encode with VP8. From what I understand this should be possible with this version?
 

Lain

Forum Admin
Lain
Forum Moderator
Developer
It is possible, though I haven't added user interface for the FFmpeg output yet.

I'll update the compile instructions at some point, for all operating systems and a number of problematic distros.
 

dacoder

Member
Dacoder, did you ever get this compiled? Jim, what works in this version?

I'm looking to capture a full-screen video game and encode with VP8. From what I understand this should be possible with this version?

I did get it to compile, except for x264... it will not run in VB, just says it stopped working. Error code 03 (cmd error)

What does it take to get x264 to compile? I thought that OBS could run with out that library?

EDIT: The x264 must be compiled in new versions of OBS studio. Thanks again Jim!
 
Last edited:

mmlac

New Member
PLEASE tell me how on earth you got x264 to compile in 64bit on windows?

I can't find anything on the internet regarding how to build it so I actually have an include folder. Building it shared won't do sh***. I can build a static that gives me a libx264.lib file but cmake will neither recognize the lib by setting the env variable to the folder itself nor work if I manually select this as the LIB_X264 variable

Also libfdk needs manual building?


And yes, building this on windows atm is a massive pain in the back. I'd love to test and help out but I can't even get past the install notes :D
 

benklett

New Member
PLEASE tell me how on earth you got x264 to compile in 64bit on windows?

I can't find anything on the internet regarding how to build it so I actually have an include folder. Building it shared won't do sh***. I can build a static that gives me a libx264.lib file but cmake will neither recognize the lib by setting the env variable to the folder itself nor work if I manually select this as the LIB_X264 variable

Also libfdk needs manual building?


And yes, building this on windows atm is a massive pain in the back. I'd love to test and help out but I can't even get past the install notes :D

BtbN made some builds and shared a zip file which has basically every libary you would need except Qt as you can download Qt from their website. I do not know if he wants his link to be shared, but I quickly uploaded it to GDrive: https://drive.google.com/file/d/0B5aNGDV5-2TUaU1WX0Zlb2RxTkU/edit?usp=sharing .

libfdk is as far as I know optional and will, if not available, be replaced by ffmpegs AAC encoder. Though libfdk is also included in this zip.
 
Top