Using FFMPEG with JUCE


#1

Hi all,

I need to do to some transcoding, trimming and converting video files in my Mac/Windows Juce application. After reading a bunch of threads I’ve decided to use libavcodec and libavformat from the FFMPEG library. I’ve installed it on my Mac and it seems to be working well as I tested out trimming videos from the terminal and it works great. Now I need it to work with Juce.
As it turns out, I’m having a lot of library linking issues. All the methods I’ve tried pretty much lead to the same linking error and a warning before that saying:
"ignoring file /####/libavformat.a, file was built for archive which is not the architecture being linked (i386)"
I have a feeling it has something to do with the project settings and the way I’m including it in the project. Also, most of the threads I’ve followed so far seem to be for iOS devices. Maybe the build I have is for ARMv7 instead of i386. I’m not sure at all.

It seems that people have been using FFMPEG libraries with Juce. Could anyone please highlight the steps to setup an Introjucer xcode project with the FFMPEG library?

Thanks


#2

[quote=“govind678”]"ignoring file /####/libavformat.a, file was built for archive which is not the architecture being linked (i386)"
I have a feeling it has something to do with the project settings and the way I’m including it in the project. Also, most of the threads I’ve followed so far seem to be for iOS devices. Maybe the build I have is for ARMv7 instead of i386. I’m not sure at all.

It seems that people have been using FFMPEG libraries with Juce. Could anyone please highlight the steps to setup an Introjucer xcode project with the FFMPEG library?[/quote]

Just this: [attachment=0]linkerflags.tiff[/attachment]

On Mac, I also copy some ffmpeg dylibs into the app package - that’s another whole barrel of fun, but maybe not what you’re encountering.

But yes, you seem to have an non-native library. Is it that you have 64-bit ffmpeg binaries and you’re compiling a 32-bit application?

Bruce


#3

Thanks Bruce
I tried the linker flags but it was giving the same error.

You’re right, I used homebrew to install ffmpeg and since I was using Mountain Lion, it built a 64 bit version by default. I uninstalled it and re-downloaded FFMPEG with the option --universal, hoping it would build a 32 bit version. Its still showing up the same error.
How did you build/compile the library?

Thanks


#4

I’m not sure how/if you can make a universal version. I make a 64-bit version. Can’t you just make your app 64-bit? If you have the juce default, it will be universal, and if you select 64-bit only it won’t matter.

You’ll have to go to Google for a universal ffmpeg build. I have a suspicion it will involve compiling it twice and then packaging the two together with a command line tool, and won’t be trivial.

Bruce


#5

The hard part will be compiling ffmpeg. Packaging them together into an universal library can be done with the “lipo” command line tool which should be easy. Here is an example: