How to Build FFMpeg as iOS Framework - ios

I'm trying to build my own Player base on FFMpeg,
I succes to build FFMpeg as static library(*.a),
but its need to copy another header file to use,
I hope it can used like framework,
but even I add header file into framework (set as public)
My Demo App can not find .h file in FFMpeg.framework,
is there any suggestion or tutorial can help me to build it as real framework?
Thanks

Yes because there is proper procedure to setup FFMPEG in project.
Please follow procedure in below link.
Compile ffmpeg for iOS 6, support Simulator & armv7 & armv7s
1) First Download FFmpeg From github.
2) Then just copy folder in your project directory.
3) Then Add it into your project with Add file option in xcode.
Note:- Below library must be added in your Project.
and don't forget to set HEADER SEARCH PATH in Build Setting option.
Try to compile.
You will find example for FFMPEG in below link,
1) ffmpegc-demo
2) kxmovie (Best to use ffmpeg)
still you need to add ffmpeg in this demo also. else you will get error for headerfile missing or library missing or etc.

I've included several C libraries into an iOS project. The way to do it, I think is to add the .a file to the Build Phases > Link Binary With Library, and drag your .a file there. If you compiled ffmpeg from source, there should be a header file. For your .h file, make sure you update the Library Search Path in Build Settings.
Also, if you are using the ffmpeg api's, maybe getting the libavcodec, libavformat, and libavscale libraries, as these are what the main ffmpeg program uses.

Related

Error generating ipa in Swift 5 Xcode 11.2

My problem is the following:
I am working with an app A, which makes use of a Framework (Framework B) that I created and that Framework B uses WebP (Swift-WebP) using carthage.
link: https://github.com/ainame/Swift-WebP
In order to use framework B within my app A, I must create the following script in Build Phases:
/ usr / local / bin / carthage copy-frameworks
this is done to be able to use webp that is within Framework B in app A
My problem is that at the time of generating the .ipa, it does not mark error, but when I install my app A from the .ipa on an iphone, the application closes immediately that it tries to open.
The Packaging.log file brings me the following information and tells me some failures that I don't know because they occur:
SDK_HuBOX = Framework B
WebP inside in Framework B
Packaging.log
Packaging.log
The application works fine if I run it on the device, the problem is only when the .ipa is generated and installed on a device. even the .ipa is generated, it does not fail but in the registry I find those errors of the images
Frameworks, Libraries, and Embedded Content
Script in Build Phases
enter image description here
Link Binary With Libraries
I hope someone could help me.
Thank you!
Maybe I understand what's happing:
Try this:
Add to "Output files" the follow line: $(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/WebP.framework
Add manually(drag and drop) the lib WebP to your "Link Binary With Libraries"
you can see this the same information here but with a lot more details: https://github.com/Carthage/Carthage#if-youre-building-for-ios-tvos-or-watchos
A piece of information I hope to help you in the future, even if your lib(SDK_HuBOX) uses Carthage too, the other libraries will not be included inside your framework automatically, you should include the dependencies on "Link Binary With Libraries" manually as well =)
For example, if your app uses a lib like Moya.framework (my case), you should manually include the other dependencies like Alamofire.framework and Result.framework too because they both are not included on Moya.framework.
I hope this helps.

Library Files missing in PJSIP project and how to link library files?

I am using PjSIP for SIP calling. I have integrated PjSIP project as per the instruction on
https://code.google.com/p/siphon/wiki/Compilation & How To Build and Compile PJSIP for Xcode, Using sample code IPJSUA to test?.
But when I opened the project, I found so many library with .a extensions are missing. Please find the screenshot for the same.
Is there anything which is missed by me or do I need to make changes or update anything ?
Also, let me know if any other library available for SIP calling.
Thanks in Advance.
Aakil.
It shows that library files are missing for compiling the project. Either you wrongly build your Project or you had changed the path of the library file into another place it doesn't know to access the library files.
To Build Your PJSIP project, Follow the below link to build for iphone:
Source: https://trac.pjsip.org/repos/wiki/Getting-Started/iPhone
To Add the missed library files into your project, go to your project target and select the Build phases tab. Click "+" in Link Binary with Library option in that tab and add your missed library.
Follow below link:
Source: adding an external library to a project in XCode 4.3

How do I compile a library in Xcode using a makefile?

I need to compile a library written in C in Xcode. For this I need to use a make file. How can I include a make file in my project?
Any link for writing a make file or sample of a make file for running on the iOS simulator would be helpful.
Also if I use cmake, then what commands do I use in the terminal to create a static Library for iOS simulator?
Thanks
First, your project generator is either Xcode or Make. You can't have a makefile in Xcode.
If you want to generate an iOS library from C/C++ sources, take a look at this google project. The project wiki explains how to use the iOS CMake toolchain. This will give you a .xcodeproj file. You can build and then link to that library from other iOS projects. Also there's this fork available on Github which you could take a look at.
If the target system is exclusively iOS, you could alternatively create a new iOS library project from scratch (no CMake) and throw in your sources manually.

Any way to make bundle xcode project to include a static library xcode project?

I have a static library xcode project (.a) and a bundle xcode project (.bundle)
I added the (.a) as a sub project of (.bundle) and added to [Target Dependencies] and [Link Binary With Libraries].
After run the bulid the (.bundle) still not contain any binary file inside (.bundle).
It's work if I add the .c and .h files to under (.bundle) directly, but that make me need to handle two project files. Any way can make (.bundle) just build with the (.a) ?
This question same as what I asked, I tried to follow his 11 steps without the step 10 because he said lastly no need that step. But the generated (.bundle) still without contain any binary
Finally, I make it work.
The step 10 still important and below is corrected step 10.
create a dummy.c under (.bundle) project and the dummy.c can just totally empty. remove the setting for the library you want to link inside Link Binary With Libraries instead use -Wl,-force_load,$(CONFIGURATION_BUILD_DIR)/libYourLib.a or -all_load to Other Linker Flags
PS: And also can use sub-project instead of workspace. and use Target Dependencies instead of Edit Scheme to achieve the same effect.
The testing project

How do I add this C library to my iOS Xcode 4 project?

I'm trying to add the openjpeg library to my XCode 4 project so that I can compress images taken by the iPhone's camera to jpeg2000.
I built the static library (libopenjpeg.a) using Cmake on OS/X. (I'm guessing this may have been the first error, that it needs to be built by XCode so it's built for iPhone architecture and not OS X).
I have the library added in the Link Binary with Libraries of my target.
The project builds successfully but I can't seem to import any of the headers from the library into any of my Objective-C classes. I've tried manually adding the folder that contains the libopenjpeg header files to the User Header Search Path but that did not seem to do anything.
Any suggestions?
for the simplest solution
Import the head files to you project's source.
You can still build it on the command-line with CMake, you'd just have to modify the CMakeLists.txt file so the right flags are passed when compiling.
However as Gavin indicates, it may be simpler just to drag the header and source files from the library into your Xcode project, and forego the building of a static library.

Resources