How to buid ffmpeg with faac support in VLC - Windows OS ??

For questions and discussion that is NOT (I repeat NOT) specific to a certain Operating System.
_ole_
Blank Cone
Blank Cone
Posts: 10
Joined: 20 Jan 2004 23:29
Location: West Conshohocken, USA

How to buid ffmpeg with faac support in VLC - Windows OS ??

Postby _ole_ » 23 Jan 2004 15:13

ffmpeg needs to be built with gcc. Don't even hope to compile it with VC++. Once you have ffmpeg compiled it should be possible to link the ffmpeg module compiled with VC++ to it. This may require nasty hacks (like linking with libgcc) but should be possible (Xbox media player does it)

Please tell us if/how you manage(d) to do it
yeah...I downloaded most recent ffmpeg source code from their site (ffmpeg.sourceforge.net) and followed their documentation in order to build it – installed MinGW and MSYS…it took some efforts to get through though…finally I was able to build it. After that – I linked plugin_ffmpeg (VC 7) to newly-build libraries and compiled it.

Now – I’m trying to rebuild ffmpeg with faac support!!! Didn’t succeed yet. I took ffmpeg-20040103 snapshot, took care of #ifdef CONFIG_FAAC things in some files and try to build by MinGW and MSYS … when I run ‘make’, it finds faac.c, but cannot find its headers – where should I put faac headers and/or include files??? Can you guys provide more detailed information how to enable faac support in VLC (VC 7) ??
transferring this question from some other thread, to make it more visible

if anyone knows how to build ffmpeg with faac on Windows (VC 7), please help

:roll:

The DJ
Cone Master
Cone Master
Posts: 5987
Joined: 22 Nov 2003 21:52
VLC version: git
Operating System: Mac OS X
Location: Enschede, Holland
Contact:

Postby The DJ » 23 Jan 2004 16:33

i think the ffmpeg mailinglist or something might be a better place.
Don't use PMs for support questions.

User avatar
hans-jürgen
Blank Cone
Blank Cone
Posts: 85
Joined: 15 Jan 2004 11:50
VLC version: 3.0.18
Operating System: Windows 10 Home
Location: Hamburg, Germany
Contact:

Postby hans-jürgen » 23 Jan 2004 21:58

I don't know why, but this forum software doesn't like my answers to this thread, so I posted it in the forum of Audiocoding.com instead... :evil:

http://www.audiocoding.com/phorum/read. ... 617&t=4617
ZZee ya, Hans-Jürgen
BLUEZZ BASTARDZZ - "That lil' ol' ZZ Top cover band from Hamburg..."
INDIGO ROCKS - "Down home rockin' blues. Tasty as strudel."

_ole_
Blank Cone
Blank Cone
Posts: 10
Joined: 20 Jan 2004 23:29
Location: West Conshohocken, USA

Postby _ole_ » 28 Jan 2004 01:36

I don't know why, but this forum software doesn't like my answers to this thread, so I posted it in the forum of Audiocoding.com instead... :evil:

http://www.audiocoding.com/phorum/read. ... 617&t=4617
How to build ffmpeg with faac support in VLC
Author: hans-jürgen
Date: 01-23-04 21:47

_ole_ wrote in viewtopic.php?t=885:

> Now – I’m trying to rebuild ffmpeg with faac support!!! Didn’t succeed
> yet. I took ffmpeg-20040103 snapshot, took care of #ifdef CONFIG_FAAC
> things in some files and try to build by MinGW and MSYS … when I
> run ‘make’, it finds faac.c, but cannot find its headers – where should I
> put faac headers and/or include files??? Can you guys provide more
> detailed information how to enable faac support in VLC (VC 7) ??
>
> if anyone knows how to build ffmpeg with faac on Windows (VC 7),
> please help.

You didn't mention if you also downloaded and installed FAAC on your system, because this is also necessary, since the new file faac.c in ffmpeg is only the frontend, nothing more. You can get a weekly snapshot of the FAAC source code here:

http://www.audiocoding.com/download.php

Doing a search for faac.c in the SourceForge ffmpeg mailing list will lead you to the following thread where Gildas Bazin (Gibalou, is that you?) posted the related patch for including FAAC in ffmpeg:

http://sourceforge.net/mailarchive/mess ... id=6198686

I don't know if this is enough information for a successful Windows compile though. And keep in mind that the FAAC source code also contained another file named faac.c (alternative frontend without -w switch) that has been deleted on Jan 12, 2004. But if you use the weekly snapshot from Jan 19, 2004, you won't get any conflicts with ffmpeg's faac.c probably.

____________________
ZZee ya, Hans-Jürgen




Reply To This Message


Re: How to build ffmpeg with faac support in VLC
Author: hans-jürgen
Date: 01-25-04 11:57

hans-jürgen wrote:

> I don't know if this is enough information for a successful
> Windows compile though. And keep in mind that the FAAC source
> code also contained another file named faac.c (alternative
> frontend without -w switch) that has been deleted on Jan 12,
> 2004. But if you use the weekly snapshot from Jan 19, 2004, you
> won't get any conflicts with ffmpeg's faac.c probably.

By the way, a nightly Windows binary of VLC is automatically compiled and available from the following site, but without FAAC support at the moment (AAC and MP4 playback should work though):

http://vthr.via.ecp.fr/~videolan/build/win32/?M=D

____________________
ZZee ya, Hans-Jürgen

_ole_
Blank Cone
Blank Cone
Posts: 10
Joined: 20 Jan 2004 23:29
Location: West Conshohocken, USA

Postby _ole_ » 28 Jan 2004 01:45


You didn't mention if you also downloaded and installed FAAC on your system, because this is also necessary, since the new file faac.c in ffmpeg is only the frontend, nothing more. You can get a weekly snapshot of the FAAC source code here:

http://www.audiocoding.com/download.php

Doing a search for faac.c in the SourceForge ffmpeg mailing list will lead you to the following thread where Gildas Bazin (Gibalou, is that you?) posted the related patch for including FAAC in ffmpeg:

http://sourceforge.net/mailarchive/mess ... id=6198686

I don't know if this is enough information for a successful Windows compile though. And keep in mind that the FAAC source code also contained another file named faac.c (alternative frontend without -w switch) that has been deleted on Jan 12, 2004. But if you use the weekly snapshot from Jan 19, 2004, you won't get any conflicts with ffmpeg's faac.c probably.

___________________
ZZee ya, Hans-Jürgen
sure, I downloaded the faac source code and installed it in 'faac' sub-folder inside the libavcodec folder of Ffmpeg. Also, I changed something inside the Make file to comprehend faac's includes...still - it doesn't build
:(

User avatar
hans-jürgen
Blank Cone
Blank Cone
Posts: 85
Joined: 15 Jan 2004 11:50
VLC version: 3.0.18
Operating System: Windows 10 Home
Location: Hamburg, Germany
Contact:

Postby hans-jürgen » 28 Jan 2004 08:35

sure, I downloaded the faac source code and installed it in 'faac' sub-folder inside the libavcodec folder of Ffmpeg. Also, I changed something inside the Make file to comprehend faac's includes...still - it doesn't build :(
So you already can't build the ffmpeg library with FAAC, or do you have problems building VLC with the extended ffmpeg library? I found a message with Goggle where another necessary VLC compile parameter is mentioned, something like --with ffmpeg-faac if I remember correctly.
ZZee ya, Hans-Jürgen
BLUEZZ BASTARDZZ - "That lil' ol' ZZ Top cover band from Hamburg..."
INDIGO ROCKS - "Down home rockin' blues. Tasty as strudel."

Gibalou
Big Cone-huna
Big Cone-huna
Posts: 608
Joined: 26 Nov 2003 10:59

Postby Gibalou » 28 Jan 2004 09:17

Sorry not to have answered this earlier...

To build ffmpeg with faac support you first have to build and install libfaac. I usually do a ./configure --disable-shared --prefix=/usr/win32 to endup just with the .a and not shared libraries as well which are kind of useless on windows (you should end-up with faac.h in /usr/win32/include and libfaac.a in /usr/win32/lib).
You might have other switches to add depending on the platform you are building on (eg. with cygwin: CC="gcc -mno-cygwin" ./configure --disable-shared --blabla).

Once libfaac is built and installed, you need to build ffmpeg with faac support, which is done by adding the --enable-faac option at configure time. You will have to add --extra-cflags=-I/usr/win32/include and --extra-ldflags=-L/usr/win32/lib as well so ffmpeg knows where libfaac was installed.

When ffmpeg is built, just build vlc normally but don't forget to add the --with-ffmpeg-faac option to ./configure so vlc knows ffmpeg was built with faac support.

That should be it.

_ole_
Blank Cone
Blank Cone
Posts: 10
Joined: 20 Jan 2004 23:29
Location: West Conshohocken, USA

Postby _ole_ » 28 Jan 2004 17:12

Sorry not to have answered this earlier...

To build ffmpeg with faac support you first have to build and install libfaac. I usually do a ./configure --disable-shared --prefix=/usr/win32 to endup just with the .a and not shared libraries as well which are kind of useless on windows (you should end-up with faac.h in /usr/win32/include and libfaac.a in /usr/win32/lib).
You might have other switches to add depending on the platform you are building on (eg. with cygwin: CC="gcc -mno-cygwin" ./configure --disable-shared --blabla).

Once libfaac is built and installed, you need to build ffmpeg with faac support, which is done by adding the --enable-faac option at configure time. You will have to add --extra-cflags=-I/usr/win32/include and --extra-ldflags=-L/usr/win32/lib as well so ffmpeg knows where libfaac was installed.

When ffmpeg is built, just build vlc normally but don't forget to add the --with-ffmpeg-faac option to ./configure so vlc knows ffmpeg was built with faac support.

That should be it.
Thank you for stepping in, hopefully with your help we can get to the point finally. Let me start over - to get things organized...

My goal is to build the VLC with ffmpeg plug-in (with faac) on Windows OS. I already know how to build VLC itself (using VC++ 7) and ffmpeg - using MinGW and MSYS. But this faac thing still escapes me. Now I'm going to start creating the detailed instruction, to help all not-too-much-Unix/Linux-concept-comfortable-developers (like myself) to understand how to

_BUILD VLC WITH FFMPEG/FAAC PLUG-IN ON WINDOWS OS_

• prerequisites: in order to build ffmpeg on Windows OS we will follow ffmpeg-team recommendations and use MinGW/ MSYS. Install the current versions of MSYS and MinGW from http://www.mingw.org/. , see their FAQ and the download section in case of questions

1. Download VLC source code from videolan.com, uncompress it to …let’s say…
C:\VideoLAN\vlc-0.7.0
(or C:\VideoLAN\vlc-snapshot-20040109 if using snapshots)

2. Download ffmpeg-20040103 snapshot from http://www.videolan.org/vlc/download-sources.html, uncompress it to
C:\ffmpeg-20040103
3. Download faac source code, uncompress it to
C:\ffmpeg-20040103\faac
(?? – first question – is this the right place, inside the ffmpeg-20040103 folder ??).
4. Now we have to perform Step 1 – build libfaac. Uncompressed faac source code doesn’t have the ‘configure’, it has ‘configure.in’ file – I think that’s because it was meant to be build by CygWin – am I right? – so, to perform a procedure suggested by Gibalou, rename configure.in to configure.
Start MSYS – it will start MinGW32, which acts as a gcc emulator for Windows.
Change (in MinGW32 console) to the C:\ffmpeg-20040103\faac and type in
./configure --disable-shared --prefix=/usr/win32
Hit enter.
Observe errors in the console window:
./configure: line 1: syntax error near unexpected token `AC_PREREQ(2.50)'
./configure: line 1: `AC_PREREQ(2.50)'

If I open this configure file, I can see that it’s not like other configure/make files – for ffmpeg, liveMedia and so on. This one has different syntax and all.

So – the questions are:

Q1: is it possible to build the faac library using MSYS/ MinGW (worked perfectly for ffmpeg) or it’s only good with CygWin (which I personally don’t like due to its unnecessary complexity and general awkwardness)??

Q2: faac source code includes faac\project\mingw32 folder and some make file in it…I was not be able to get anything useful out of it – does anybody know how to use this stuff?

Q3: faac source code has MS VC++ solution/workspace files. If I would be able to build it using MS VC 7, and, let’s say – I want to use MS-build libraries – what name should I use, libfaac.dll or – rename it to libfaac or something else? Where should I put it – in what folder? Do I need any files else to build ffmpeg? What exactly to change in ffmpeg configure/make files to get it build with faac?

it may seem stupid, but the more detailed an instruction is, the more people will understand it
Any help would be greatly appreciated

Gibalou
Big Cone-huna
Big Cone-huna
Posts: 608
Joined: 26 Nov 2003 10:59

Postby Gibalou » 28 Jan 2004 21:00

My goal is to build the VLC with ffmpeg plug-in (with faac) on Windows OS. I already know how to build VLC itself (using VC++ 7) and ffmpeg - using MinGW and MSYS. But this faac thing still escapes me. Now I'm going to start creating the detailed instruction, to help all not-too-much-Unix/Linux-concept-comfortable-developers (like myself) to understand how to

_BUILD VLC WITH FFMPEG/FAAC PLUG-IN ON WINDOWS OS_

• prerequisites: in order to build ffmpeg on Windows OS we will follow ffmpeg-team recommendations and use MinGW/ MSYS. Install the current versions of MSYS and MinGW from http://www.mingw.org/. , see their FAQ and the download section in case of questions

1. Download VLC source code from videolan.com, uncompress it to …let’s say…
C:\VideoLAN\vlc-0.7.0
(or C:\VideoLAN\vlc-snapshot-20040109 if using snapshots)

2. Download ffmpeg-20040103 snapshot from http://www.videolan.org/vlc/download-sources.html, uncompress it to
C:\ffmpeg-20040103
3. Download faac source code, uncompress it to
C:\ffmpeg-20040103\faac
(?? – first question – is this the right place, inside the ffmpeg-20040103 folder ??).
No it isn't. The faac library has nothing to do with ffmpeg, it just happens that ffmpeg can make use of it, that's all (ffmpeg doesn't make use of the faac source code, just the final library/dll).
So it would be more proper to extract faac in it's own directory.
4. Now we have to perform Step 1 – build libfaac. Uncompressed faac source code doesn’t have the ‘configure’, it has ‘configure.in’ file – I think that’s because it was meant to be build by CygWin – am I right? – so, to perform a procedure suggested by Gibalou, rename configure.in to configure.
configure.in is not a configure script but it is used to generate it via the gnu autotools (automake, autoconf, etc...).
These autotools are unfortunately not part of MSYS by default (you need to install the MSYS-DTK) but are part of cygwin.

However, a tarball of the source code for a program should also contain the generated configure script so there was a mistake here. I'll upload a fixed faac tarball asap.
Start MSYS – it will start MinGW32, which acts as a gcc emulator for Windows.
Change (in MinGW32 console) to the C:\ffmpeg-20040103\faac and type in
./configure --disable-shared --prefix=/usr/win32
Hit enter.
Observe errors in the console window:
./configure: line 1: syntax error near unexpected token `AC_PREREQ(2.50)'
./configure: line 1: `AC_PREREQ(2.50)'

If I open this configure file, I can see that it’s not like other configure/make files – for ffmpeg, liveMedia and so on. This one has different syntax and all.

So – the questions are:

Q1: is it possible to build the faac library using MSYS/ MinGW (worked perfectly for ffmpeg) or it’s only good with CygWin (which I personally don’t like due to its unnecessary complexity and general awkwardness)??
MinGW should be enough although I didn't try myself.
Q2: faac source code includes faac\project\mingw32 folder and some make file in it…I was not be able to get anything useful out of it – does anybody know how to use this stuff?
Not me at least.
Q3: faac source code has MS VC++ solution/workspace files. If I would be able to build it using MS VC 7, and, let’s say – I want to use MS-build libraries – what name should I use, libfaac.dll or – rename it to libfaac or something else? Where should I put it – in what folder? Do I need any files else to build ffmpeg? What exactly to change in ffmpeg configure/make files to get it build with faac?
About using MS VC++ to build faac, I don't really have any idea although theoretically it should be possible to use a library created with MSVC++ with MinGW.

_ole_
Blank Cone
Blank Cone
Posts: 10
Joined: 20 Jan 2004 23:29
Location: West Conshohocken, USA

Postby _ole_ » 29 Jan 2004 15:33

Well...let's continue.

I uncompressed ffmpeg (snapshot) to C:\ffmpeg-20040103.
Then I uncompressed faac to C:\faac.
In C:\faac\libfaac I opened MS VC++ 7 ‘solution’ and finally build faac library (by VC++ 7). I made sure I had as an output result libfaac.a ( a static library), located in C:\faac\libfaac\releasedll . Also, I had faac.h in C:\faac\include.

Then I started MinGW32 and changed to the ffmpeg-20040103. Then I ran the following:

./configure --enable-shared --enable-faac --extra-cflags=-I/c/faac/include --extra-ldflags=-L/c/faac/libfaac/releasedll

it looked like on the building stage it was OK – gcc found faac’s include and had gone through fine. The output was:

gcc -Wall -I/c/faac/include -g -O3 -DHAVE_AV_CONFIG_H -I.. -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE -c -o faac.o faac.c
rm -f avcodec.lib…………..



But on the linking phase I got a problem – it could not find –lfaac

The output was:
gcc -shared -Wl,--output-def,avcodec.def -o avcodec.dll common.o utils.o mem.o allcodecs.o mpegvideo.o jrevdct.o jfdctfst.o jfdctint.o mpegaudio.o ac3enc.o mjpeg.o resample.o dsputil.o moti……….. i386/fft_sse.o -lm –lfaac

c:\mingw\bin\..\lib\gcc-lib\mingw32\3.2.3\..\..\..\..\mingw32\bin\ld.exe: cannot find -lfaac
make[1]: *** [avcodec.dll] Error 1


BTW, this ffmpeg-20040103 snapshot is not buildable as it is – it has problems with variable type declaration in some files - jfdctfst.c for example, `int_fast16_t' type is undeclared but used (its declaration in common.h is conditional, #ifdef EMULATE_FAST_INT…and if it will be defined – later on it will conflict with some MinGW include files on linking stage) So – I did some trics…

But anyway – it didn’t look like this thing

--extra-ldflags=-L/c/faac/libfaac/releasedll

has worked...

so I just copied libfaac.a into MinGW include directory – after that it finaly could find it…

but still – it didn’t work:

Cannot export .idata$4: symbol not found
Cannot export .idata$5: symbol not found
Cannot export .text: symbol not found
Cannot export libfaac_NULL_THUNK_DATA: symbol not found
make[1]: *** [avcodec.dll] Error 1


For me, it looks like MS VC-build library file is not good here, I will wait until I could build the faac by MinGW…

User avatar
hans-jürgen
Blank Cone
Blank Cone
Posts: 85
Joined: 15 Jan 2004 11:50
VLC version: 3.0.18
Operating System: Windows 10 Home
Location: Hamburg, Germany
Contact:

Postby hans-jürgen » 29 Jan 2004 15:54

Aaah... something's happening at last... 8) I'll try what I can contribute without ever having compiled anything anywhere anytime...
No it isn't. The faac library has nothing to do with ffmpeg, it just happens that ffmpeg can make use of it, that's all (ffmpeg doesn't make use of the faac source code, just the final library/dll).
So it would be more proper to extract faac in it's own directory.
So it seems that ffmpeg needs a compiled libfaac.dll, right? You can download a Windows binary of this DLL here (v1.23.5):

http://www.saunalahti.fi/~cse/files/?C=M;O=D

There is also faac.zip available which is the command line faac.exe program. Can the compiled libfaac.dll shorten this procedure somehow, or is it still necessary to do it your way, Gibalou? By the way, libfaac.dll normally is the output plugin for CDex, the open source CD ripper.
However, a tarball of the source code for a program should also contain the generated configure script so there was a mistake here. I'll upload a fixed faac tarball asap.
Do you mean a patch for the FAAC project or a tarball that you offer on your website?
MinGW should be enough although I didn't try myself.
I remember that knik (the FAAC developer) added some short comments in a separate readme some time ago, but I don't know if they are outdated in the meantime perhaps.
Q2: faac source code includes faac\project\mingw32 folder and some make file in it…I was not be able to get anything useful out of it – does anybody know how to use this stuff?
Maybe you should ask this at Audiocoding.com, because that's the home of FAAD2 and FAAC. I don't what a separate mingw32 folder is good for either...
About using MS VC++ to build faac, I don't really have any idea although theoretically it should be possible to use a library created with MSVC++ with MinGW.
Case, who provides libfaac.zip and faac.zip on his website and is a developer himself, always uses this Microsoft compiler, as far as I know.
ZZee ya, Hans-Jürgen
BLUEZZ BASTARDZZ - "That lil' ol' ZZ Top cover band from Hamburg..."
INDIGO ROCKS - "Down home rockin' blues. Tasty as strudel."

User avatar
hans-jürgen
Blank Cone
Blank Cone
Posts: 85
Joined: 15 Jan 2004 11:50
VLC version: 3.0.18
Operating System: Windows 10 Home
Location: Hamburg, Germany
Contact:

Postby hans-jürgen » 01 Feb 2004 09:05

so I just copied libfaac.a into MinGW include directory – after that it finaly could find it…

but still – it didn’t work:

Cannot export .idata$4: symbol not found
Cannot export .idata$5: symbol not found
Cannot export .text: symbol not found
Cannot export libfaac_NULL_THUNK_DATA: symbol not found
make[1]: *** [avcodec.dll] Error 1


For me, it looks like MS VC-build library file is not good here, I will wait until I could build the faac by MinGW…
Hmm, I remember that there was a thread about problems with the MSVC files and building libfaac.dll recently in the Audiocoding.com forum, and the cause was that they still looked for two obsolete files (joint.c and psychiso.c) that were deleted from the source some months ago, because they are not necessary anymore. The user changed the MSVC files accordingly and could compile libfaac afterwards. I don't know if your error message has anything to do with this though...
ZZee ya, Hans-Jürgen
BLUEZZ BASTARDZZ - "That lil' ol' ZZ Top cover band from Hamburg..."
INDIGO ROCKS - "Down home rockin' blues. Tasty as strudel."

rockdeman

Postby rockdeman » 29 Aug 2005 15:19

humm the audio coding forum is pretty much dead. I have been watching my topic for a while on How To build FAAD2 with MING32: http://www.audiocoding.com/modules/newb ... 18&forum=2

No replies at all. I want to build FAAD2 with Mingw32 b/c I want to build FFMPEG with maximum module support under Mingw32. I got almost everything working under MING32 (like zlib, xvid h264, lamemp3, etc) but not FAAD2 / FAAC ... for now I am more intrested in FAAD2 b/c of AAC decoding purposes.
I will post a complete HOWTO-BUILD-FFMPEG-UNDER-MING32-WITH-MAXIMUM-MODULE-SUPPORT on my weblog once done. I am sure this will benefit a lot of users.

So: any help on how to build FAAD2 (and FAAC later on) under MING32 is more than welcome!!!


Return to “General VLC media player Troubleshooting”

Who is online

Users browsing this forum: No registered users and 25 guests