2016年4月20日星期三

编译obs和 niginx_rtmp_module

nignx https支持


brew link openssl --force

--with-ld-opt="-L /usr/local/lib"


编译 obs 需要的patch

JIANFU-M-63ED:bld jeromy$ git diff
diff --git a/libobs/CMakeLists.txt b/libobs/CMakeLists.txt
index 3cf6bd8..fcfaa79 100644
--- a/libobs/CMakeLists.txt
+++ b/libobs/CMakeLists.txt
@@ -72,6 +72,8 @@ if(WIN32)
                w32-pthreads)
        endif()
 elseif(APPLE)
+        link_directories(/usr/local/lib)
+
        set(libobs_PLATFORM_SOURCES
                obs-cocoa.c
                util/threading-posix.c
@@ -102,11 +104,26 @@ elseif(APPLE)
        mark_as_advanced(CARBON)
        include_directories(${CARBON})

+        find_library(SECURITY Security)
+        find_library(COREVIDEO CoreVideo)
+        find_library(COREAUDIO CoreAudio)
+       find_library(COREMEDIA CoreMedia)
+        find_library(AUDIOTOOLBOX AudioToolbox)
+        find_library(VIDEOTOOLBOX VideoToolbox)
+        find_library(VDA VideoDecodeAcceleration)
+
        set(libobs_PLATFORM_DEPS
                ${COCOA}
                ${APPKIT}
                ${IOKIT}
-               ${CARBON})
+               ${CARBON}
+                ${SECURITY}
+                ${COREVIDEO}
+                ${COREAUDIO}
+                ${AUDIOTOOLBOX}
+                ${VIDEOTOOLBOX}
+                ${VDA}
+                ${COREMEDIA})
 elseif(UNIX)
        set(libobs_PLATFORM_SOURCES
                obs-nix.c
@@ -371,6 +388,20 @@ target_link_libraries(libobs
                ${OBS_JANSSON_IMPORT}
                ${FFMPEG_LIBRARIES}
                ${ZLIB_LIBRARIES}
+                fdk-aac
+                iconv
+                x264
+                xvidcore
+                vpx
+                vorbis
+                vorbisenc
+                theora
+                theoraenc
+                opus
+                tiff
+                mp3lame
+                lzma
+                bz2
        PUBLIC
                ${THREADS_LIBRARIES})

diff --git a/obs/CMakeLists.txt b/obs/CMakeLists.txt
index c98b9bc..965c488 100644
--- a/obs/CMakeLists.txt
+++ b/obs/CMakeLists.txt
@@ -72,6 +72,8 @@ elseif(APPLE)
                add_definitions(-DUPDATE_SPARKLE=1)
        endif()

+        link_directories(/usr/local/lib)
+
 elseif(UNIX)
         find_package(Qt5X11Extras REQUIRED)

@@ -219,6 +221,14 @@ target_link_libraries(obs
        libobs
        libff
        Qt5::Widgets
+        freetype
+        sdl
+        ass
+        postproc
+        "-framework AVFoundation"
+        "-framework CoreMedia"
+        "-framework CoreVideo"
+        "-framework QTKit"
        ${LIBCURL_LIBRARIES}
        ${obs_PLATFORM_LIBRARIES})

diff --git a/plugins/obs-ffmpeg/CMakeLists.txt b/plugins/obs-ffmpeg/CMakeLists.txt
index 511431d..26e888e 100644
--- a/plugins/obs-ffmpeg/CMakeLists.txt
+++ b/plugins/obs-ffmpeg/CMakeLists.txt
@@ -8,6 +8,7 @@ endif()
 find_package(FFmpeg REQUIRED
        COMPONENTS avcodec avfilter avdevice avutil swscale avformat swresample)
 include_directories(${FFMPEG_INCLUDE_DIRS})
+link_directories(/usr/local/lib)

 set(obs-ffmpeg_HEADERS
        obs-ffmpeg-formats.h
@@ -26,6 +27,17 @@ add_library(obs-ffmpeg MODULE
 target_link_libraries(obs-ffmpeg
        libobs
        libff
+        freetype
+        sdl
+        ass
+        postproc
+        "-framework Foundation"
+        "-framework QTKit"
+        "-framework AVFoundation"
+        "-framework CoreMedia"
+        "-framework CoreVideo"
+        "-framework CoreGraphics"
+        "-framework CoreFoundation"
        ${obs-ffmpeg_PLATFORM_DEPS}
        ${FFMPEG_LIBRARIES})

diff --git a/plugins/obs-ffmpeg/ffmpeg-mux/CMakeLists.txt b/plugins/obs-ffmpeg/ffmpeg-mux/CMakeLists.txt
index 8c564d8..7abb84e 100644
--- a/plugins/obs-ffmpeg/ffmpeg-mux/CMakeLists.txt
+++ b/plugins/obs-ffmpeg/ffmpeg-mux/CMakeLists.txt
@@ -3,6 +3,7 @@ project(ffmpeg-mux)
 find_package(FFmpeg REQUIRED
        COMPONENTS avcodec avutil avformat)
 include_directories(${FFMPEG_INCLUDE_DIRS})
+link_directories(/usr/local/lib)

 set(ffmpeg-mux_SOURCES
        ffmpeg-mux.c)
@@ -14,7 +15,34 @@ add_executable(ffmpeg-mux
        ${ffmpeg-mux_SOURCES}
        ${ffmpeg-mux_HEADERS})

+
 target_link_libraries(ffmpeg-mux
+        fdk-aac
+        iconv
+        x264
+        xvidcore
+        vpx
+        vorbis
+        vorbisenc
+        theora
+        theoraenc
+        opus
+        tiff
+        mp3lame
+        lzma
+        swresample
+        bz2
+        z
+        "-framework Foundation"
+        "-framework Security"
+        "-framework AudioToolbox"
+        "-framework VideoToolbox"
+        "-framework VideoDecodeAcceleration"
+        "-framework AVFoundation"
+        "-framework CoreMedia"
+        "-framework CoreVideo"
+        "-framework CoreGraphics"
+        "-framework CoreFoundation"
        ${FFMPEG_LIBRARIES})

 if(WIN32)





opencv patch

JIANFU-M-63ED:opencv jeromy$ git diff
diff --git a/modules/videoio/CMakeLists.txt b/modules/videoio/CMakeLists.txt
index 41b0691..b958457 100644
--- a/modules/videoio/CMakeLists.txt
+++ b/modules/videoio/CMakeLists.txt
@@ -147,7 +147,7 @@ if(HAVE_FFMPEG)
     list(APPEND VIDEOIO_LIBRARIES ${BZIP2_LIBRARIES})
   endif()
   if(APPLE)
-    list(APPEND VIDEOIO_LIBRARIES "-framework VideoDecodeAcceleration" bz2)
+    list(APPEND VIDEOIO_LIBRARIES "-framework Security" "-framework CoreMedia" "-framework CoreVideo" "-framework AudioToolbox" "-framework VideoToolbox" "-framework VideoDecodeAcceleration" bz2)
   endif()
 endif(HAVE_FFMPEG)