diff --git a/CMakeLists.txt b/CMakeLists.txt index ef616e9..f6cb6c2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,6 +2,8 @@ cmake_minimum_required (VERSION 2.8.0) enable_language(C) project(libftl) +SET(FTL_VERSION "0.5.0") + option(DISABLE_AUTO_INGEST "Set to TRUE to disable auto ingest feature which removes curl and jansson dependancies" FALSE) MESSAGE(STATUS "FTL DISABLE_AUTO_INGEST: " ${DISABLE_AUTO_INGEST}) @@ -11,7 +13,9 @@ MESSAGE(STATUS "FTL DISABLE_FTL_APP: " ${DISABLE_FTL_APP}) option(FTL_STATIC_COMPILE "Set to TRUE if you want ftl to be compiled as a static lib. If TRUE, the program will want to statically link to the ftl cmake object." FALSE) MESSAGE(STATUS "FTL FTL_STATIC_COMPILE: " ${FTL_STATIC_COMPILE}) +include(GNUInstallDirs) find_package(Threads REQUIRED) +find_package(PkgConfig) set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) @@ -39,15 +43,18 @@ if (NOT CURL_FOUND AND NOT DISABLE_AUTO_INGEST) endif() # We will only try to include lib jansson if auto ingest is enabled. -SET(JANSSON_LIBRARIES "") -if (NOT DISABLE_AUTO_INGEST) +if (PKG_CONFIG_FOUND AND NOT DISABLE_AUTO_INGEST) + pkg_check_modules(JANSSON jansson) +endif() +if (NOT JANSSON_FOUND AND NOT DISABLE_AUTO_INGEST) SET(JANSSON_BUILD_DOCS OFF CACHE BOOL "Jansson docs off") SET(JANSSON_WITHOUT_TESTS ON CACHE BOOL "Jansson build without tests") SET(JANSSON_EXAMPLES OFF CACHE BOOL "Jansson disable examples") SET(USE_WINDOWS_CRYPTOAPI off) add_subdirectory(libjansson) - include_directories(${CMAKE_CURRENT_BINARY_DIR}/libjansson/include) + SET(JANSSON_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR}/libjansson/include) SET(JANSSON_LIBRARIES jansson) + include_directories(${JANSSON_INCLUDE_DIRS}) endif() if (WIN32) @@ -95,7 +102,7 @@ add_library(ftl ${FTL_LIB_TYPE} libftl/hmac/hmac.c ${FTLSDK_PLATFORM_FILES}) include_directories(libftl libftl/gettimeofday) -set_target_properties(ftl PROPERTIES VERSION "0.5.0") +set_target_properties(ftl PROPERTIES VERSION ${FTL_VERSION}) set_target_properties(ftl PROPERTIES SOVERSION 0) target_link_libraries(ftl ${CURL_LIBRARIES} ${JANSSON_LIBRARIES}) @@ -129,5 +136,11 @@ if (NOT DISABLE_FTL_APP) target_include_directories(ftl_app PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/ftl_app) endif() +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libftl.pc.in + ${CMAKE_CURRENT_BINARY_DIR}/libftl.pc @ONLY) + # Install rules -install(TARGETS ftl DESTINATION lib) \ No newline at end of file +install(TARGETS ftl DESTINATION ${CMAKE_INSTALL_LIBDIR}) +install(FILES libftl/ftl.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libftl) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libftl.pc + DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) diff --git a/README.md b/README.md index 4c9359a..e92e81e 100644 --- a/README.md +++ b/README.md @@ -15,10 +15,14 @@ Due to the nature of WebRTC the following audio and video formats are required #### Audio - Opus at 48khz -#### video +`ffmpeg -i input-video.avi -vn -c:a libopus -b:a 160K -ac 2 output-audio.opus` + +#### Video - H.264 (most profiles are supported including baseline, main and high) - for the lowest delay B Frames should be disabled +`ffmpeg -i input-video.avi -an -c:v libx264 -b:v 5000K -tune zerolatency --no-psy output-video.h264` + ### Building Prerequisites: @@ -55,13 +59,8 @@ msbuild /p:Configuration=Release ALL_BUILD.vcxproj OR open libftl.sln in Visual ### Running Test Application -download the following test files: - - - sintel.h264: https://www.dropbox.com/s/ruijibs0lgjnq51/sintel.h264 - - sintel.opus: https://www.dropbox.com/s/s2r6lggopt9ftw5/sintel.opus - In the directory containing ftl_app ``` -ftl_app -i auto -s "" -v path\to\sintel.h264 -a path\to\sintel.opus -f 24 +ftl_app -i auto -s "" -v output-video.h264 -a output-audio.opus -f 24 ``` diff --git a/ftl_app/main.c b/ftl_app/main.c index 7750e50..e90bf66 100644 --- a/ftl_app/main.c +++ b/ftl_app/main.c @@ -53,7 +53,7 @@ void log_test(ftl_log_severity_t log_level, const char *message) void usage() { - printf("Usage: ftl_app -i -s - v -a \n"); + printf("Usage: ftl_app -i -s -v -a \n"); exit(0); } diff --git a/libftl.pc.in b/libftl.pc.in new file mode 100644 index 0000000..106ffc8 --- /dev/null +++ b/libftl.pc.in @@ -0,0 +1,11 @@ +prefix=@CMAKE_INSTALL_PREFIX@ +exec_prefix=${prefix} +libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@ +includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@/libftl + +Name: FTL +Description: Library for Mixer's FTL Protocol +Version: @FTL_VERSION@ +Requires.private: libcurl jansson +Libs: -L${libdir} -lftl +Cflags: -I${includedir}