Extract Boost, FFmpeg and CEF from the docker images via sudo ./tools/linux/extract-deps-from-docker. Alternatively these can be prepared manually by following the steps laid out in each Dockerfile
mkdir build && cd build
When we tried to run the build we got an error message.missing “ErrNo.”
We included the follwoing to resolve the error.
In Casparcg server master folder inside src>tools there is a bin2c.cpp file.There we have added
From staging folder we were able to start CasparCG 2.2 linux server successfully
Hey @Syscaspar - thank you for putting this info up here. I have struggled with getting things working on Linux and the official documentation seems to be lacking a bit. (I’m looking at submitting some changes once I’ve got everything running correctly!)
A few questions, if you don’t mind:
Do you have any updates to this method or is this still working well for you?
Is this running on Ubuntu Desktop or Server?
Are you using this on a headless server or with a GUI/desktop on the Caspar box?
And so it looks like I might be able to somehow manually link CasparCG to the correct drivers and also to use an “OpenGL context”, as per the Nvidia blog, but I will need a bit of help to join up those dots (if indeed that is the correct path to go down).
Not really, no. I’m hoping to take another bash at it one evening this week. Current thoughts are to implement VirtualGL as it seems to do what’s needed, plus it has a very short guide specifically for Nvidia Headless Servers which seems to fit the bill.
I’ll post my findings in here, but let me know if you get a chance to try this out before me. Would be good to pool our knowledge on here.
I’ve got to say, I’m slightly relieved to hear that I’m not alone in this struggle, although I’m finding it hard to believe that we’re trailblazers! Surely others in this community have already solved this problem. If anyone has any specific pointers, or knows of others who are running CasparCG headless on Linux, please shout! I’m keen to get a detailed how-to guide together.
@Julusian - has CPU Mixer development been abandoned? I always thought this sounded promising, especially for cloud stuff where GPU is still a bit of a novelty and often difficult to configure
VirtualGL looks interesting. Not 100% sure if it will just work though, as caspar expects an x server to get the opengl context from, so it might still require running one manually. But VirtualGL looks like it could still be useful to provide access to an xserver/opengl over ssh.
has CPU Mixer development been abandoned?
All I know is that it has been removed from 2.2 as it was a burden and to allow some abstractions to be removed.
Personally I agree that it has its uses. Cloud instances is a good example, or even caspar channels which dont need any compositing. (eg a channel being a simple html -> decklink)
I don’t fully understand but I was thinking the same… I did find this on StackOverflow about creating an OpenGL context without an X server.
NVIDIA recently published an article detailing how to use OpenGL on headless systems, which is a very similar use case as the question describes.
Link to libOpenGL.so and libEGL.so instead of libGL.so. (Your linker options should therefore be -lOpenGL -lEGL
Call eglGetDisplay, then eglInitialize to initialize EGL.
Call eglChooseConfig with the config attribute EGL_SURFACE_TYPE followed with EGL_PBUFFER_BIT.
Call eglCreatePbufferSurface, then eglBindApi(EGL_OPENGL_API);, then eglCreateContext and eglMakeCurrent.
From that point on, do your OpenGL rendering as usual, and you can blit your pixel buffer surface wherever you like. This supplementary article from NVIDIA includes a basic example and an example for multiple GPUs. The PBuffer surface can also be replaced with a window surface or pixmap surface, according to the application needs.
The linked source URL (in my previous post) gives an example, the following snippet compiles an application with support for both EGL and GLX contexts.
I don’t fully understand but I was thinking the same…
What I was trying to say is that Caspar needs an X server to setup OpenGL. But even with X running, it is not easily possible to run caspar over ssh, but VirtualGL looks like it might resolve that ssh problem.
Does anybody have any progress on the front of running CasparCG on a linux server?
I have one running VNC (for headless streaming with VLC) and tried running CasparCG, but I got the message that I do not have a GPU.
I’d love to look into some light use of Caspar for Video Mixing and Overlaying, with a maximum of 1080p (but even 720p would be fine with me).
Looking forward to hearing and learning more.
Hi trying to get going on Ubuntu 18.045 and CasparCG 2.2 as described in at the top of this post as I cannot find any other guide. Maybe I should be using a newer guide/ versions? If so, can someone please point me in the direction?
Followed the guide above, all looked good until the end, got these errors:
Hi, I would recommend building with Docker using this guide: server/BUILDING.md at master · CasparCG/server · GitHub If your situation requires building without the use of Docker, troubleshooting might take longer, but the problem that it is encountering according to the log you posted is likely missing libsnappy1v5 and libopencore-amrnb0. You can install them via apt.
You will be able to run the server using run.sh script in the folder you build it in. For build extracted from docker, it will be in casparcg_server subfolder.
Ok thank you. I went through everything from the GitHub you linked, seems to have made it a little further…
Error still seems to be looking for lopencore-amrnb
[ 99%] Building CXX object shell/CMakeFiles/casparcg.dir/linux_specific.cpp.o
[100%] Linking CXX executable casparcg
/usr/bin/ld: cannot find -lopencore-amrnb
collect2: error: ld returned 1 exit status
shell/CMakeFiles/casparcg.dir/build.make:183: recipe for target ‘shell/casparcg’ failed
make: *** [shell/casparcg] Error 1
CMakeFiles/Makefile2:808: recipe for target ‘shell/CMakeFiles/casparcg.dir/all’ failed
make: *** [shell/CMakeFiles/casparcg.dir/all] Error 2
Makefile:83: recipe for target ‘all’ failed
make: *** [all] Error 2
I cannot find info on lopencore-amrnb…
Should I be looking for libopencore-amrnb0 and lopencore-amrnb is a typo or something?
If I do-
apt install libopencore-amrnb0
Reading package lists… Done
Building dependency tree
Reading state information… Done
libopencore-amrnb0 is already the newest version (0.1.3-2.1).
libopencore-amrnb0 set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 72 not upgraded.