Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Mar 25, 2008, 04:44 PM   #1
RossOliver
macrumors regular
 
Join Date: Nov 2006
Request for PPC owner to compile ffmpeg

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-ch...apshot.tar.bz2

And lame here:

http://sourceforge.net/project/downl...ar.gz&30044240

All I need is for lame to be compiled:

Code:
cd to/lame/folder
./configure
make
sudo make install
Then ffmpeg with lame support:

Code:
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.
RossOliver is offline   0 Reply With Quote
Old Mar 25, 2008, 05:35 PM   #2
iSaint
macrumors 603
 
iSaint's Avatar
 
Join Date: May 2004
Location: South Mississippi y'all, near the water!
Send a message via AIM to iSaint
If I had any idea of what you're talking about I might help you. Code is above my head, however.
__________________
Not Applicable
iSaint is offline   0 Reply With Quote
Old Mar 25, 2008, 06:31 PM   #3
CaptainZap
macrumors regular
 
Join Date: Jan 2007
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.
__________________
CaptainZap is offline   0 Reply With Quote
Old Mar 25, 2008, 06:36 PM   #4
RossOliver
Thread Starter
macrumors regular
 
Join Date: Nov 2006
Quote:
Originally Posted by CaptainZap View Post
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
RossOliver is offline   0 Reply With Quote
Old Mar 26, 2008, 11:13 AM   #5
zippyfly
macrumors regular
 
Join Date: Mar 2008
Xcode can compile to PPC and x86 targets, no?

You can get Xcode free on your install DVD (OS X) or download from Apple iPhone SDK.
zippyfly is offline   0 Reply With Quote
Old Mar 26, 2008, 11:26 AM   #6
RossOliver
Thread Starter
macrumors regular
 
Join Date: Nov 2006
Quote:
Originally Posted by zippyfly View Post
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...
RossOliver is offline   0 Reply With Quote
Old Mar 26, 2008, 11:44 AM   #7
ChrisA
macrumors G4
 
Join Date: Jan 2006
Location: Redondo Beach, California
Quote:
Originally Posted by RossOliver View Post
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.
ChrisA is offline   0 Reply With Quote
Old Mar 26, 2008, 01:23 PM   #8
RossOliver
Thread Starter
macrumors regular
 
Join Date: Nov 2006
Quote:
Originally Posted by ChrisA View Post
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....
RossOliver is offline   0 Reply With Quote
Old Mar 26, 2008, 01:36 PM   #9
kainjow
Moderator emeritus
 
kainjow's Avatar
 
Join Date: Jun 2000
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.
kainjow is offline   0 Reply With Quote
Old Mar 26, 2008, 01:39 PM   #10
RossOliver
Thread Starter
macrumors regular
 
Join Date: Nov 2006
Quote:
Originally Posted by kainjow View Post
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
RossOliver is offline   0 Reply With Quote
Old Mar 26, 2008, 03:54 PM   #11
CaptainZap
macrumors regular
 
Join Date: Jan 2007
/sigh... Sorry mate, I can't use sudo since the account isn't an administrator.
__________________
CaptainZap is offline   0 Reply With Quote
Old Mar 26, 2008, 03:58 PM   #12
RossOliver
Thread Starter
macrumors regular
 
Join Date: Nov 2006
Quote:
Originally Posted by CaptainZap View Post
/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...
RossOliver is offline   0 Reply With Quote
Old Mar 26, 2008, 04:05 PM   #13
SC68Cal
macrumors 68000
 
Join Date: Feb 2006
There should be cross compiling options in the configuration files.

Last edited by SC68Cal; Mar 26, 2008 at 04:20 PM.
SC68Cal is offline   0 Reply With Quote
Old Mar 26, 2008, 04:21 PM   #14
RossOliver
Thread Starter
macrumors regular
 
Join Date: Nov 2006
Quote:
Originally Posted by SC68Cal View Post
You can designate a target architecture in the configure file for ffmpeg.

Code:
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:

Code:
--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...
RossOliver is offline   0 Reply With Quote
Old Mar 26, 2008, 05:03 PM   #15
SC68Cal
macrumors 68000
 
Join Date: Feb 2006
Yeah I didn't have much luck either. Total bummer.
SC68Cal is offline   0 Reply With Quote
Old Mar 27, 2008, 09:59 AM   #16
kainjow
Moderator emeritus
 
kainjow's Avatar
 
Join Date: Jun 2000
I am able to get lame to compile for PPC using this method:

1. Configure via
Code:
export CFLAGS="-arch ppc"; ./configure --build=ppc
2. Edit the config.h file and change two lines:

Code:
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.

Last edited by kainjow; Mar 27, 2008 at 10:15 AM.
kainjow is offline   0 Reply With Quote
Old Mar 27, 2008, 05:37 PM   #17
Maury
macrumors 6502
 
Join Date: Mar 2008
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/opensourc...universal.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
Maury is offline   0 Reply With Quote
Old Mar 27, 2008, 07:38 PM   #18
CaptainZap
macrumors regular
 
Join Date: Jan 2007
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.
__________________
CaptainZap is offline   0 Reply With Quote
Old Mar 28, 2008, 12:54 PM   #19
RossOliver
Thread Starter
macrumors regular
 
Join Date: Nov 2006
Quote:
Originally Posted by Maury View Post
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/opensourc...universal.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
RossOliver is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Someone tried to compile Android SDK for PPC? Franchute13 PowerPC Macs 4 Apr 11, 2014 02:34 PM
Resolved: ffmpeg, dvdauthor starikarp OS X 10.8 Mountain Lion 1 Jul 10, 2013 06:36 PM
General: Evasi0n, PPC/No, VPC on PPC/No, Linux on PB/No, OS X on AppleTv/No justperry Jailbreaks and iOS Hacks 7 Feb 19, 2013 12:35 AM
lose of sync ffmpeg wattmaster Digital Video 2 Feb 2, 2013 08:15 PM
really simple request to 2012 13" MBA 1.8GHz i5 128SSD 8gb ram owner hemagoku MacBook Air 6 Jun 22, 2012 05:07 PM

Forum Jump

All times are GMT -5. The time now is 01:17 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC