Description
I'm trying to add this library to my iOS project using pod, My project needs two pod libraries:
pod 'MobileVLCKit', '3.3.0'
pod 'mobile-ffmpeg-full-gpl', '4.2.2'
FFMPEG seems to work well when I remove pod 'MobileVLCKit', '3.3.0' from my project. However, as soon as I add it, everything fails even simple code such as print(MobileFFmpeg.version()). This print 0 when I add pod 'MobileVLCKit', '3.3.0' to my project.
Mobile VLC library doesn't seem to be affected by adding FFMPEG. It works well with or without FFMPEG.
Expected behavior
I expect pod 'mobile-ffmpeg-min' to install the library without issues.
Current behavior
FFMPEG seems to fail when adding pod 'MobileVLCKit', '3.3.0' to my project.
Screenshots
https://i.postimg.cc/bvb94hZy/Screen-Shot-2019-08-29-at-2-56-12-PM.png
https://i.postimg.cc/hjB1B5m9/Screen-Shot-2019-08-29-at-2-56-31-PM.png
https://i.postimg.cc/13bKWt57/Screen-Shot-2019-08-29-at-2-56-47-PM.png
Logs
Log can be found here:
https://pastebin.com/F7AqParb
Environment
Other
I tried different packages, including full-gpl and min and all have the same issue.
Any help is appreciated.
Your logs show that MobileVLCKit already includes an FFmpeg implementation. Adding MobileFFmpeg makes it two FFmpeg implementations in the same application. But applications can not load different versions of the same library and this is why MobileFFmpeg fails. You need to ignore/exclude one of the FFmpeg implementations.
OTHER_LDFLAGS flag in Pods-<Your App>.debug.xcconfig file of your project defines linked libraries for your application. You can change the order in which libraries are loaded or delete unwanted libraries by editing OTHER_LDFLAGS.
You can force MobileVLCKit to use MobileFFmpegs FFmpeg libraries or force MobileFFmpeg to use MobileVLCKits FFmpeg libraries by editing OTHER_LDFLAGS. Unfortunately I can not guarantee that it will work. You need to test and see it yourself.
Thank you very much!
I checked Pods-<Your App>.debug.xcconfig and rearranged the libraries, and it worked!
For future readers who would like to use both VLC and FFMPEG together in iOS. This is what you need to solve the conflicting issue.
1) Open Pods-<Your App>.debug.xcconfig
My file looks like the following:
CLANG_CXX_LANGUAGE_STANDARD = c++11
CLANG_CXX_LIBRARY = libc++
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/MobileVLCKit" "${PODS_ROOT}/mobile-ffmpeg-min"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
OTHER_LDFLAGS = $(inherited) -ObjC -l"bz2" -l"c++" -l"iconv" -l"xml2" -l"z" -framework "AVFoundation" -framework "AudioToolbox" -framework "CFNetwork" -framework "CoreGraphics" -framework "CoreMedia" -framework "CoreText" -framework "MobileVLCKit" -framework "OpenGLES" -framework "QuartzCore" -framework "Security" -framework "VideoToolbox" -framework "libavcodec" -framework "libavdevice" -framework "libavfilter" -framework "libavformat" -framework "libavutil" -framework "libswresample" -framework "libswscale" -framework "mobileffmpeg"
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
PODS_ROOT = ${SRCROOT}/Pods
2) Move this framework -framework "MobileVLCKit" which located inside OTHER_LDFLAGS to the end of the frameworks.
Final results should look like this:
CLANG_CXX_LANGUAGE_STANDARD = c++11
CLANG_CXX_LIBRARY = libc++
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/MobileVLCKit" "${PODS_ROOT}/mobile-ffmpeg-min"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
OTHER_LDFLAGS = $(inherited) -ObjC -l"bz2" -l"c++" -l"iconv" -l"xml2" -l"z" -framework "AVFoundation" -framework "AudioToolbox" -framework "CFNetwork" -framework "CoreGraphics" -framework "CoreMedia" -framework "CoreText" -framework "OpenGLES" -framework "QuartzCore" -framework "Security" -framework "VideoToolbox" -framework "libavcodec" -framework "libavdevice" -framework "libavfilter" -framework "libavformat" -framework "libavutil" -framework "libswresample" -framework "libswscale" -framework "mobileffmpeg" -framework "MobileVLCKit"
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
PODS_ROOT = ${SRCROOT}/Pods
and it should work. Thank you @tanersener.
I just added a new wiki page about Using Multiple FFmpeg Implementations In The Same iOS Application. I hope it clarifies the solution used here.
Awesome, thanks!
Most helpful comment
Thank you very much!
I checked
Pods-<Your App>.debug.xcconfigand rearranged the libraries, and it worked!For future readers who would like to use both
VLCandFFMPEGtogether in iOS. This is what you need to solve the conflicting issue.1) Open
Pods-<Your App>.debug.xcconfigMy file looks like the following:
2) Move this framework
-framework "MobileVLCKit"which located insideOTHER_LDFLAGSto the end of the frameworks.Final results should look like this:
and it should work. Thank you @tanersener.