PDA

View Full Version : Request for PPC owner to compile ffmpeg




RossOliver
Mar 25, 2008, 04:44 PM
Hey,

I need a universal binary of ffmpeg with lame support for a program I am writing. I have an intel version compiled, but I can't get a PPC version to compile on my intel mac.

I'm looking for someone who has access to a PPC mac that wouldn't mind taking a few minutes to compile ffmpeg for me so I can join the two versions with lipo.

You can grab ffmpeg here:

http://ffmpeg.mplayerhq.hu/ffmpeg-checkout-snapshot.tar.bz2

And lame here:

http://sourceforge.net/project/downloading.php?group_id=290&use_mirror=surfnet&filename=lame-3.98b6.tar.gz&30044240

All I need is for lame to be compiled:


cd to/lame/folder
./configure
make
sudo make install


Then ffmpeg with lame support:


cd to/ffmpeg/folder
./configure --enable-libmp3lame --disable-vhook --enable-shared --disable-mmx
make
<no need to make install>


If you could then email the resulting ffmpeg folder in its entirety to mail at developersdigest dot org I would be grateful :)

Thanks for your time.



iSaint
Mar 25, 2008, 05:35 PM
If I had any idea of what you're talking about I might help you. Code is above my head, however.

CaptainZap
Mar 25, 2008, 06:31 PM
If no one beats me to it or finds a way without a PPC, I'll do it for you tomorrow when I'm at school.

RossOliver
Mar 25, 2008, 06:36 PM
If no one beats me to it or finds a way without a PPC, I'll do it for you tomorrow when I'm at school.

Great, appreciate it :)

zippyfly
Mar 26, 2008, 11:13 AM
You can get Xcode free on your install DVD (OS X) or download from Apple iPhone SDK.

RossOliver
Mar 26, 2008, 11:26 AM
You can get Xcode free on your install DVD (OS X) or download from Apple iPhone SDK.

Yes XCode can cross-compile, but it doesn't seem to agree with FFMpeg - even compiling it for one architecture in XCode throws numerous errors for me...

ChrisA
Mar 26, 2008, 11:44 AM
Yes XCode can cross-compile, but it doesn't seem to agree with FFMpeg - even compiling it for one architecture in XCode throws numerous errors for me...

I would not be at all surprized if ffmpeg was sensitive to the specific version of gcc used. I've got a later version of gcc installed (in addtion to the one that ships with xcode) just for this reason. I've got a Sun SPARC here at the office with three C compilers installed on it. Sounds stupid but with 500,000 lines of code, I'm not fixing it.

RossOliver
Mar 26, 2008, 01:23 PM
I would not be at all surprized if ffmpeg was sensitive to the specific version of gcc used. I've got a later version of gcc installed (in addtion to the one that ships with xcode) just for this reason. I've got a Sun SPARC here at the office with three C compilers installed on it. Sounds stupid but with 500,000 lines of code, I'm not fixing it.

I don't think the reason it doesn't compile in XCode is the GCC version - I compiled it successfully by manually using the same version of GCC that XCode uses... but I'm an XCode rookie so I wouldn't know how to sort XCode to compile it successfully....

kainjow
Mar 26, 2008, 01:36 PM
I have compiled ffmpeg many times but my PPC is not working right now :(

If you're going to be distributing ffmpeg inside another application, you will need to build ffmpeg so it's not using shared libraries of lame. So I think when you build lame you need to add in something like --disabled-shared and the same for ffmpeg. I did this when I installed libfaac and libfaad2 and I was able to successfully run ffmpeg on other computers.

RossOliver
Mar 26, 2008, 01:39 PM
I have compiled ffmpeg many times but my PPC is not working right now :(

If you're going to be distributing ffmpeg inside another application, you will need to build ffmpeg so it's not using shared libraries of lame. So I think when you build lame you need to add in something like --disabled-shared and the same for ffmpeg. I did this when I installed libfaac and libfaad2 and I was able to successfully run ffmpeg on other computers.

It's just a project right now, but if it does turn into something others might find useful I will bear that in mind :)

CaptainZap
Mar 26, 2008, 03:54 PM
/sigh... Sorry mate, I can't use sudo since the account isn't an administrator.

RossOliver
Mar 26, 2008, 03:58 PM
/sigh... Sorry mate, I can't use sudo since the account isn't an administrator.

Ah, I feared that might be the case - never mind, thanks for giving it a go...

SC68Cal
Mar 26, 2008, 04:05 PM
There should be cross compiling options in the configuration files.

RossOliver
Mar 26, 2008, 04:21 PM
You can designate a target architecture in the configure file for ffmpeg.


configure --arch=ppc


While ffmpeg supports this flag, unfortunately lame doesn't. It does have --build and --host flags, but neither of these seem to support ppc as an option. I've also tried compiling ffmpeg without lame using the flags:


--arch=ppc --extra-ldflags="-isysroot /Xcode2.5/SDKs/MacOSX10.4u.sdk -arch ppc" --extra-cflags="-isysroot /Xcode2.5/SDKs/MacOSX10.4u.sdk -arch ppc"


But that just returns a load of errors...

SC68Cal
Mar 26, 2008, 05:03 PM
Yeah I didn't have much luck either. Total bummer.

kainjow
Mar 27, 2008, 09:59 AM
I am able to get lame to compile for PPC using this method:

1. Configure via export CFLAGS="-arch ppc"; ./configure --build=ppc

2. Edit the config.h file and change two lines:

Old: /* #undef HAVE_NASM */
New: #undef HAVE_NASM

Old: #define HAVE_XMMINTRIN_H 1
New: #undef HAVE_XMMINTRIN_H

Save changes.

3. Make normally via "make"

It seems to do the trick. The editing of config.h is required because somehow when you tell it to build for PPC it still thinks NASM exists, which is the x86 assembler. --disable-nasm didn't work to disable that.

If anyone has any tips to improve this, it'd be great.

Maury
Mar 27, 2008, 05:37 PM
Ross, I am curious how you are using ffmpeg within XCode. I have a small project that would make good use of ffmpeg, but I am finding it difficult to bring the code into a Cocoa application. Perhaps you have some pointers?

I can build ffmpeg with ease from the command line, and have had some success using the instructions here:

http://developer.apple.com/opensource/buildingopensourceuniversal.html

to built a x-platform version (I have no idea if it actually works though :-) There are some modifications you have to make to the sequence, but nothing too annoying.

Dragging avcodec, avformat and avutil into my Cocoa project seems to do something useful as well. I then brought in the same headers, but compiling causes complaints in the libavutil header that it wants more headers... which doesn't seem to make sense. Am I misunderstanding the dependancies here? What precisely did you have to include to bring the code into Cocoa?

My real goal is to put the libraries into a framework, simply to make it easier to bring them into a Cocoa application. Have you had any success along these lines?

Maury

CaptainZap
Mar 27, 2008, 07:38 PM
Dunno if this goes against the terms of iSquint or whatever but there is a ffmpeg in its resources that might be PPC but it might not have LAME.

RossOliver
Mar 28, 2008, 12:54 PM
Ross, I am curious how you are using ffmpeg within XCode. I have a small project that would make good use of ffmpeg, but I am finding it difficult to bring the code into a Cocoa application. Perhaps you have some pointers?

I can build ffmpeg with ease from the command line, and have had some success using the instructions here:

http://developer.apple.com/opensource/buildingopensourceuniversal.html

to built a x-platform version (I have no idea if it actually works though :-) There are some modifications you have to make to the sequence, but nothing too annoying.

Dragging avcodec, avformat and avutil into my Cocoa project seems to do something useful as well. I then brought in the same headers, but compiling causes complaints in the libavutil header that it wants more headers... which doesn't seem to make sense. Am I misunderstanding the dependancies here? What precisely did you have to include to bring the code into Cocoa?

My real goal is to put the libraries into a framework, simply to make it easier to bring them into a Cocoa application. Have you had any success along these lines?

Maury

I think I'm going to give up on this project - falling at the first hurdle is a bit of a discouragement...

As for getting FFMPEG into XCode, I also had some issues, but the process is:

Compile FFMPEG (preferably as a universal binary or you will get errors, unless you set your project to be i386 only...)
Create a new group in your project, something like 'FFMPEG', then right click on the group and add existing files.

The files you want to add are (presuming you want to use static libs):

ffmpeg/libavcodec/libavcodec.a
ffmpeg/libavformat/libavformat.a
ffmpeg/libavutil/libavutil.a

Then you have two choices. The one I would take is to right click on FFMPEG group again and add existing files, navigate to /usr/local/include/ffmpeg and add all the headers.

Alternatively, if you sudo make install ffmpeg on your machine, you can add a header path pointing to /usr/local/include and check the recursive chechbox.

You can check it worked by importing avcodec.h into main.c and adding av_register_all(); to your main method. It should compile with one error moaning about not being able to find av_register_all() for PPC, which is expected... to get rid of the error go to your project properties and set the build architecture to i386 only...

Hope that makes sense :confused: