Using LAME encoder in an xcode project - xcode

Tasked with converting wav to mp3 in my mac program, I've downloaded and compiled the LAME encoder. I was wondering how I then use it in my xcode project? Previous 3rd party libraries have been in the form of a framework, but LAME just produces a dylib.
Thank you.

The use of a dynamic library is similar to a Framework Apple doc on dynamic libraries
The library will need to be in a known place
In the target build options set the header and library search paths. To use the library drag it into Xcode (These set the -I -L and -l options to the compiler)

Related

error: 'libavutil/internal.h' file not found

I'm using ffmpeg lib.
I try #include "libavutil/internal.h" but received error 'libavutil/internal.h' file not found.
What should I have to do?
FFmpeg is a C application (mainly). But still support some object orientation features like information hiding (Encapsulation).
You should stick with the exposed interface (API - libav). There is a good reason for this. The header and its functions as the name suggest is "internal". Not safe to use (may change, etc..).
Have you installed ffmpeg?
First, ffmpeg is a software, not a library. It contains several libraries such as libavutil.
Then, once ffmpeg is installed, look if it's in your library path.
I suppose you're trying to compile with gcc/g++, so, you can also try to add -I[dir_where_libavutil_is]
Of course, you need libavutil-dev installed in your system.

Using ffmpeg shared library in a commercial C/C++ application

We have a C++-based application that runs on Windows, Mac, and Linux. I now need to add h.264 and h.265 decoding within this application. It seems ffmpeg will do the trick.
As ours is a commercial application, we cannot disclose the source code to public. However, as I understand, FFMpeg is based on LGPL licensing requirements. Going through various articles on LGPL requirements, it seems I can use ffmpeg without disclosing our source code as long as:
I build ffmpeg as a shared libraries and make sure that I don't use "--enable-gpl" flag during configuration.
I acknowledge in our About dialog box that we are using ffmpeg shared libraries.
Can someone please verify if this more or less meets the requirements? Regards.
Note that I need ffmpeg only to decode and not to encode. Therefore, I don't have to use "--enable-libx264" and "--enable-libx265" flags.
As a FFmpeg developer, I would expect you to follow the considerations mentioned on our website:
Compile FFmpeg without "--enable-gpl" and without
"--enable-nonfree".
Use dynamic linking (on windows, this means
linking to dlls) for linking with FFmpeg libraries.
Distribute the
source code of FFmpeg, no matter if you modified it or not.
Make
sure the source code corresponds exactly to the library binaries you
are distributing.
Run the command "git diff > changes.diff" in the
root directory of the FFmpeg source code to create a file with only
the changes.
Explain how you compiled FFmpeg, for example the
configure line, in a text file added to the root directory of the
source code.
Use tarball or a zip file for distributing the source
code.
Host the FFmpeg source code on the same webserver as the
binary you are distributing.
Add "This software uses code of FFmpeg licensed under the LGPLv2.1 and its source can be downloaded here [where here is a link to the source code]" to every page in your website
where there is a download link to your application.
Mention "This
software uses libraries from the FFmpeg project under the LGPLv2.1"
in your program "about box".
Mention in your EULA that your program
uses FFmpeg under the LGPLv2.1.
If your EULA claims ownership over
the code, you have to explicitly mention that you do not own FFmpeg,
and where the relevant owners can be found.
Remove any prohibition
of reverse engineering from your EULA.
Apply the same changes to all
translations of your EULA.
Do not misspell FFmpeg (two capitals F
and lowercase "mpeg").
Do not rename FFmpeg dlls to some obfuscated
name, but adding a suffix or prefix is fine (renaming "avcodec.dll"
to "MyProgDec.dll" is not fine, but to "avcodec-MyProg.dll" is).
Go
through all the items again for any LGPL external library you
compiled into FFmpeg (for example LAME).
Make sure your program is
not using any GPL libraries (notably libx264).
From what you've said so far, I think you're doing only point 1-2, 9-11, 15-18. You need to make the source code (of FFmpeg) including modifications (3-5, 7-8) available along with your application, mention build instructions (6), remove ownership claims on FFmpeg, remove reverse engineering prohibitions (if any), and check your EULA (12-14).
Yes, with lgpl you can use it as a dll/shared lib and you won't need to make your source code available.
But you should be aware that it's not the licensing of the code is the issue for commercial use, but the patents around h.264/h.265 and you need license for that. AFAIK, even if you simply want to decode you'll still need to have license.
MPEGLA is the licensing body for h264 codec patent pool.

How to use Port Audio Libaray in XCode?

How to use libportaudio.a library in Xcode?
First of all when I build port audio library it's type is represented as document by the Finder. When I add libportaudio.a to my Xcode projects , How should I use it in Xcode ? Is libportaudio.a enogh for using it in Xcode?
How to Include and use it in Xcode without getting errors?
Anyone who used port audio library in XCode successfully could do me a big favour and save me from a lot of troubles.
Thanks
According to the docs you must include portaudio.h and libportaudio.a to use the portaudio api. When I built portaudio it placed these files in /usr/local/include/ and /usr/local/lib/ respectively. I got my project to build by adding these paths to the Header Search Paths field in the project Build Settings tab.

Using FreeImage with Xcode

I'm writing an application in which I want to use free image to load files. I am on MacOSX 10.8.2 and I am using the mac ports version of free image. I had it working, but when I tried putting it on another computer without the port, it wouldn't run because it didn't have the files. The macports version comes with a dylib, can I use that to run it without downloading the port? If I can how would I compile it with the project because I have tried linking it as a Binary Library, but I can't include the files. Any help would be appreciated, as I have bee at this for a few hours now.
Thanks
You can actually build the FreeImage library as a static library. Unfortunately, the downloadable source from the http://freeimage.sourceforge.net/download.html website uses makefiles that are expecting to use the older SDKs for Xcode3.
I actually updated the Makefile.osx to build with Xcode4 using the 10.7 SDK and posted the change to https://gist.github.com/AhiyaHiya/5105571
You should be able to run this make from Terminal.app and create your .dylib and .a files for your needs.

Linking Static Libraries in Xcode

I am trying to link the opengl image loading library Soil to my Xcode project, but I am finding this very difficult. I have tried to link the .a file but this does not work.
Any ideas?
Thanks
It looks like the supplied .a file isn't for Mac; you can instead make a new Xcode (BSD C library) project, include the source+ headers, and use this in a larger project.
If you're using Xcode 4, this link will help with the general approach to using / creating your own static libraries, and using them.

Resources