caffeinetv / libcaffeine

A library for broadcasting to Caffeine.tv
https://www.caffeine.tv
GNU General Public License v2.0
16 stars 5 forks source link

Build for Linux #39

Open cogwheel opened 5 years ago

cogwheel commented 5 years ago

This might be close to working: https://github.com/caffeinetv/libcaffeine/tree/linux

It builds, but tests fail.

jpietek commented 4 years ago

Any progress on linux builds? I've tried to compile it on linux. Succeeded to get the .so library (tests failing), but got stuck with undefined symbols in the example app. I've got webrtc build out of libcaffeine branch (last commit: Jun11/2019) and there are still some undefined symbols in the webrtc namespace.

g++  -o main main.o   -lpthread -ldl -lX11 -lexpat /usr/local/lib/libcaffeine.so -lcurl libwebrtc_full.a libcaffeine-static.a
/usr/local/lib/libcaffeine.so: undefined reference to `x264_encoder_close'
/usr/local/lib/libcaffeine.so: undefined reference to `x264_encoder_encode'
/usr/local/lib/libcaffeine.so: undefined reference to `x264_picture_clean'
/usr/local/lib/libcaffeine.so: undefined reference to `webrtc::H264::ProfileLevelIdToString(webrtc::H264::ProfileLevelId const&)'
/usr/local/lib/libcaffeine.so: undefined reference to `x264_encoder_reconfig'
/usr/local/lib/libcaffeine.so: undefined reference to `rtc::Thread::SetName(std::string const&, void const*)'
/usr/local/lib/libcaffeine.so: undefined reference to `rtc::ToString(bool)'
/usr/local/lib/libcaffeine.so: undefined reference to `x264_encoder_parameters'
/usr/local/lib/libcaffeine.so: undefined reference to `x264_param_apply_profile'
/usr/local/lib/libcaffeine.so: undefined reference to `rtc::LogSink::OnLogMessage(std::string const&, rtc::LoggingSeverity, char const*)'
/usr/local/lib/libcaffeine.so: undefined reference to `webrtc::CreateSessionDescription(webrtc::SdpType, std::string const&, webrtc::SdpParseError*)'
/usr/local/lib/libcaffeine.so: undefined reference to `rtc::CreateRandomUuid()'
/usr/local/lib/libcaffeine.so: undefined reference to `x264_encoder_open_157'
/usr/local/lib/libcaffeine.so: undefined reference to `x264_picture_alloc'
/usr/local/lib/libcaffeine.so: undefined reference to `x264_param_default_preset'
/usr/local/lib/libcaffeine.so: undefined reference to `webrtc::StatsReport::Value::string_val() const'
/usr/local/lib/libcaffeine.so: undefined reference to `cricket::Codec::GetParam(std::string const&, std::string*) const'
/usr/local/lib/libcaffeine.so: undefined reference to `rtc::ToString(int)'
/usr/local/lib/libcaffeine.so: undefined reference to `webrtc::SdpVideoFormat::SdpVideoFormat(std::string const&, std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > > const&)'
/usr/local/lib/libcaffeine.so: undefined reference to `webrtc::metrics::HistogramFactoryGetEnumeration(std::string const&, int)'
collect2: error: ld returned 1 exit status

Plus the undefined symbols in failing tests:

unit-serialization.cpp:(.text+0xced): undefined reference to `webrtc::StatsReport::NewTypedId(webrtc::StatsReport::StatsType, std::string const&)'
unit-serialization.cpp:(.text+0xdda): undefined reference to `webrtc::StatsReport::NewTypedId(webrtc::StatsReport::StatsType, std::string const&)'

During cmake build:

You have called ADD_LIBRARY for library libcaffeine-objlib without any source files. This typically indicates a problem with your CMakeLists.txt file

Xaymar commented 4 years ago

For the x264 related errors, do you have x264 development packages installed?

jpietek commented 4 years ago

I got the x264 fixed by compiling the latest videolan sources and modyfing the CMake with additional Linux includes. Still no luck with webrtc references. I've compiled RTC multiple times with the following source https://github.com/caffeinetv/webrtc/commits/libcaffeine..The WebRTC tag 0.70.2 seems to match the libcaffeine version, but still I get those linker errors. I'm including the webrtc_full.a library to libcaffeine CMake, tried both Release and Debug. Tried to inspect the librtc with objdump, the missing methods are there, for ex: rtc::LogSink::OnLogMessage(std::string const&, rtc::LoggingSeverity, char const*)

Thought the 'override' keyword in some methods might be missing, not sure about that. Generally speaking I'm trying to integrate Caffeine into Tellyo.com - streaming/editing platform, alongside with Twitch, YT, FB, TW and other social medias. All our transcoders are AWS/Linux based, so the library not working under *nix is unfortunately a showstopper for us :(