Building CasparCG as a .so

Hi to all,
Iam trying to build casparcg under ubuntu 18.04 as a library. My idea is to create a c# server app that startup CasparCG as a external so.

I have been able to build the standard casparCG but when i try to switch it in libcasparcg, building it as .so,i got this errors.

cc1plus: error: /home/daniele/Downloads/casparcg-server-master/build/common/common_pch/stdafx.h.gch/.c++: created and used with different settings of -fpie [-Werror]

Seems that precompiled header doesnt’ want to get fpic that i set for all solution using the cmake option

Use “-fPIC” / “-fPIE” for all targets by default, including static libs

set(CMAKE_POSITION_INDEPENDENT_CODE ON)

Any suggestion?
Regards
Daniele

CasparCG is not designed to be built as a library like this. Even if you do manage to make it build, it will not expose enough of an api to be useful.
A much better and simpler way to achieve what you want will be to simply run the standard casparcg binary as a child process. You can easily monitor the health of that process and restart it or whatever.

There is already a windows only c# launcher you could use as reference https://github.com/rrebuffo/CasparLauncher/ or a nodejs one https://github.com/nrkno/tv-automation-casparcg-launcher

Hi Julusian,
I know that it do not expose enough api, my plan was to add the calls that i need further. But i need to make it a .so at first.

The bad thing is that i have to make caspar in-bound to my app. I would like then to create a Memory producer and consumer in order to integrate caspar in an broadcast automation software. I already have an playout software that need a graphic engine to be bound to it and Caspar was my answer.
Regards
Daniele

Wouldn’t it be easier to use plain CEF instead?

Why can it not just run Caspar? There are a lot of automation software’s that do that. Be aware, that if you integrate CasparCG into your code it could be a breaking of the GPL. If you simply run it side by side, that is not a problem. Or you could also open source your final product, but that is probably not what you want :slight_smile:

Hi didikunz,
I need to run caspar cg in a single app, It will a part of a pipeline and due to performance reason , i need to have only in - process comunication.
Regards
Daniele

Sorry Balte , what do you mean with using plain CEF?
Regards
Daniele

CEF is what CasparCG uses internally to generate HTML graphics: https://en.wikipedia.org/wiki/Chromium_Embedded_Framework

If you are only looking to add graphics and don’t need the other bits of CasparCG it might be easier to use just CEF.