Compiling Avidemux
From Avidemux2
This article contains information on generally compiling Avidemux, from the SVN repository or from tarballs, for your operating and some custom choices for the compilation. There are general guides, package descriptions and specific information for some Linux distributions that need specific compilation switches to successufully create the program from source.
Contents |
Information on the compilation
To compile Avidemux, you will need to have the necessary dependencies met. Namely, you will need to install (or have already installed) several development packages. Here is a list and brief description of the packages:
Mandatory packages
- SpiderMonkey: Needed for scripting (only for versions up to 2.3).
- GTK+: Avidemux 2.1-2.3 needs GTK+ 2.6 or newer. That includes also pkg-config, that might be a separate package. Avidemux 2.4 or newer can be built with GTK+, Qt 4 or commandline user interface. The GTK+ version needs GTK+ 2.10 or newer, including Cairo. Some older Linux distributions (e.g. Fedora Core 4) include older GTK+ versions, without Cairo.
- libxml2: XML library, version 2. Used for filter descriptions and ~/.avidemux/config.
- GCC: Source code compiler for Avidemux to be created with.
Optional packages
Audio:
- libmad: MAD is needed for MP3 and MP2 decoding.
- LAME: MP3 audio encoding.
- libvorbis: Vorbis audio encoding and decoding.
- FAAD: AAC audio decoder.
- FAAC: AAC audio encoding.
- a52dec: Audio decoding support for AC3 audio (DVDs & others).
- libdca: Audio decoding support for DTS (DVD and others).
Video:
- Xvid: MPEG-4 SP/ASP encoder.
- x264: MPEG-4 AVC (H.264) encoder.
Miscellaneous:
- FreeType: needed for the Subtitler filter.
- OSS: Open Sound System. Linux kernel 2.6 and newer uses ALSA with optional OSS emulation.
- ALSA: Advanced Linux Sound Architecture. Direct ALSA sound output can be set in Preferences.
- SDL: SDL can be used for audio and video output. Not needed on Linux and BSD.
- XVideo: Hardware display acceleration (overlay) during playback. Lower CPU usage.
- ESD: sound output daemon. Obsolete and not needed.
- aRts: KDE 3.x sound system daemon. Not needed in KDE 4, not recommended.
General compilation instructions
This guide has information on compiling in two ways. The method for both is basically the same, with only one command change at the beginning to download from where you want.
Choosing what to compile
You have two choices for where you can download files to compile.
- Download the latest stable tarball version from the download page. This is the stable version for those who want a program that is mostly bug free and stable.
svn://svn.berlios.de/avidemux/branches/avidemux_2.4_branch/
- Download the unstable source files for the latest versions of Avidemux from the SVN repository. The SVN version is usually the latest development version which can contain some bugfixes and also new features. It is classified as unstable or testing, though it really is quite stable in general. Regardless, we do not recommend using the SVN version to do any work you care about saving - use the stable version from the tarball on the website for that. You can download the source code from SVN using this command:
svn://svn.berlios.de/avidemux/tags/avidemux_2.5.1
Compilation commands
cd avidemux (enter the source code directory)
CMake build
The 2.4 branch uses CMake as its primary build method. You can build Avidemux 2.4 or later using these commands in the source code directory:
cmake .(the dot is required)make
For more information, see the Switch to CMAKE in progress thread in the Avidemux forum.
Old method (Avidemux 2.3 and older)
make -f Makefile.dist(this is needed if you compile the SVN version, not needed for the official release)./configure --with-jsapi-include=xxxx [--with-newfaad for Gentoo or Ubuntu](xxxx is the directory where SpiderMonkey is installed - you cannot compile Avidemux 2.3 or older without SpiderMonkey, version 2.4 does not require external SpiderMonkey anymore)make(compile Avidemux)make install(install Avidemux - you must be root, use thesucommand for that)
Using the 'locate jsapi.h' command will usually find the directory you need with the jsapi.h file. If the locate command does not find it, you should update the location database with the command 'updatedb' and then re-try 'locate jsapi.h' command.
Some people may not want to have all the feature for Avidemux compiled into their program. Here is a list of ./configure arguments to prevent features from being compiled:
Audio
- OSS: --without-oss
- aRts: --without-arts
- ESD: --without-esd
Video
- XV: --disable-xv
Linux distribution specific notes
Debian (3.0 and beyond)
Currently there is no explicit guide for compiling the latest version of Avidemux from Subversion (SVN) in Debian. However you can follow the Ubuntu/Kubuntu SVN Compile guide on this same page generally with no changes to the process and you should be able to compile just fine.
Deb packages of Avidemux for Debian here:
Gentoo
You can get the necessary ebuilds for compiling Avidemux from the 2.3 subversion branch from the Berkano Overlay (which includes a couple of other ebuilds that may be useful). For information on how to use third-party ebuilds read the HowTo on the Gentoo Wiki.
Some Gentoo systems need the --with-newfaad argument with the ./configure stage of the compilation.
Ubuntu/Kubuntu/Xubuntu
General downloads for Ubuntu
Enable the universe in your apt-source list. From a root console or via sudo use nano/vim/gedit or whatever text editor you like to open: /etc/apt/sources.list. You should either have the "universe" enabled on one of your repository lines.
After you have made sure the "universe" repository is enabled in your apt-sources file, from a root console or via sudo run this command:
sudo apt-get update
Next we will install the compile dependencies. Running this command line from the root console with either su or sudo will install many of the necessary dependencies for you to compile Avidemux with several extra features.
sudo apt-get install automake1.9 g++ gcc liba52-0.7.4 \ liba52-0.7.4-dev libfaac-dev libfaad-dev \ libstdc++6 libgtk2.0-dev libglib2.0-dev \ libsdl-console-dev libxv-dev pkg-config \ liblame-dev libmad0-dev libvorbis-dev \ libxml2-dev libxvidcore4-dev subversion
The libmad0 may not be needed anymore, since I think they just changed statically added it to the most recent SVN. Regardless, it cannot hurt.
Download & Compile
Go to the place on your system when you want to download the source files for Avidemux. Make sure that you have Subversion installed. If you followed the previous step, you should be fine. You can choose to use the stable 2.4 branch or the unstable developers 2.5 branch. Using a console as a normal user, run this command:
svn co svn://svn.berlios.de/avidemux/branches/avidemux_2.4_branch/
Now the source files for the latest version of Avidemux from the SVN repositories are on your system, in a directory usually called avidemux_2.x_branch (where 'x' is the specific version you chose to download) at your currect working directory. Move into that directory and create the configure script by running these commands:
cd avidemux_2.x_branch #where 'x' is the specific version you chose to download make -f Makefile.dist
After make is installed, from a run this command:
make
You now have a compiled executable file in avidemux_2.x_branch/avidemux called avidemux2. This is your new version of Avidemux. You may run it however you like or install it wherever you please.
Optional: make install
At this point you are done and all you need to do is from a console run this command:
sudo make install
Red Hat / Fedora
Red Hat follows the general procedures for compiling but if you run into problems during the ./configure command, try using this variable:
--with-jsapi-include=/usr/local/include/js
For Fedora Core 5 install js and js-devel using yum:
yum install js js-devel
Then run configure with
--with-jsapi-include=/usr/include
Compiling ThreadSafe SpiderMonkey
See the Compiling SpiderMonkey article.
JSAPI compile problems
If you have problems compiling jsapi SpiderMonkey with Fedora, try doing this before you run the ./configure command:
export LD_LIBRARY_PATH="/path/to/libjs.so"
Slackware
Slackware follows the general procedures for compiling but needs this in the ./configure command:
--with-jsapi-include=xxxx
where the xxxx should point to the Spidermonkey installation directory. The easiest way to get Spidermonkey installed on your system is to install the Mozilla Slackware package. This will install the appropriate js files to eg. /usr/lib/mozilla-1.7.13/
Additionally, the *js* files in Mozilla directory should be in your libpath (eg. /usr/lib), so simply symlink them to there. Done!
Some Slackware users have reported problems with GTK+ compiling. We suggest trying to this option when you are compiling. It seems to help
./configure --without-libsdl
In case you get the following error during 'make -f Makefile.dist' :
aclocal:configure.in:117: warning: macro `AM_GNU_GETTEXT' not found in library *** Creating configure configure.in:117: error: possibly undefined macro: AM_GNU_GETTEXT
you should install gettext-tools Slackware package.
In case of an error during the 'make install' :
/bin/sh @MKINSTALLDIRS@ /usr/local/share /bin/sh: @MKINSTALLDIRS@: No such file or directory
do the following:
to be filled in
SUSE
This information is specific to SUSE version 10.1, but may work for other versions as well. It was tested using kernel 2.6.16, but may work for other versions as well.
SUSE follows the general procedures for compiling but needs this in the ./configure command:
--with-jsapi-include=/usr/include/js
Be sure to install ALL developer RPMs (packagename-devel) of the libraries you want to use, specially spider monkey.
For 64-bit users, before you try to compile, you need to run to this command first:
export LDFLAGS="-L/usr/X11R6/lib64"
Microsoft Windows
This is a guide to building Avidemux from SVN in Microsoft Windows. It is intended for people who are familiar with compiling software but not necessarily using MinGW.
Prerequisites
Mandatory
- Archive utility that supports GZ, JAR, TAR and ZIP formats, e.g. WinZip
- 500MB free disk space (MSYS – 50MB, MinGW – 135MB, Avidemux – 315MB)
Optional
- Microsoft Visual C++ 6.0 with Service Pack 5
| Note: The following instructions are tailored specifically for Microsoft Visual C++ 6.0. If you wish to use a different version of Visual C++ you may need to rebuild the dependencies required by Avidemux. More information at: msdn.microsoft.com |
Build Environment
Download Components
These components are necessary to build Avidemux on Microsoft Windows.
| Program | Component(s) | Example Filename | URL |
|---|---|---|---|
| MinGW | binutils | binutils-2.16.91-20060119-1.tar.gz | MinGW website |
| gcc-core | gcc-core-3.4.2-20040916-1.tar.gz | ||
| gcc-g++ | gcc-g++-3.4.2-20040916-1.tar.gz | ||
| mingw-runtime | mingw-runtime-3.11.tar.gz | ||
| mingw-utils | mingw-utils-0.3.tar.gz | ||
| w32api | w32api-3.8.tar.gz | ||
| MSYS | MSYS-1.0.11-2004.04.30-1.exe | ||
| MSYS DTK | msysDTK-1.0.1.exe | ||
| Pkg-config | pkg-config-0.20.zip | Tor Lillqvist's GTK+ for Windows website | |
| TortoiseSVN | TortoiseSVN-1.4.1.7992-win32-svn-1.4.2.msi | TortoiseSVN website |
These components are only required if you wish to compile optional dependencies.
| Program | Component(s) | Example Filename | URL |
|---|---|---|---|
| Netwide Assembler | nasm | nasm-0.98.39-win32.zip | NASM website |
These components are only required if you wish to compile optional dependencies with Microsoft Visual C++.
| Program | Component(s) | Example Filename | URL |
|---|---|---|---|
| Microsoft Visual C++ 6 Processor Pack | vcpp5.exe | MSDN website |
Install Build Environment
To build Avidemux on a Microsoft Windows operating system you will require MSYS and MinGW. MSYS is a Unix style shell environment for Windows. MinGW is a collection of header files, import libraries and GNU toolsets for producing native Windows programs.
To download the Avidemux source code you will require TortoiseSVN, which is source control software. It is implemented as a Windows shell extension, which makes it integrate seamlessly into the Windows explorer.
MinGW
- Extract the contents of each MinGW tarball (binutils, gcc-core, gcc-g++, mingw-runtime, mingw-utils, w32api) to a folder on your hard-drive, e.g. C:\Dev\MinGW.
MSYS
- Run the MSYS installer (e.g. MSYS-1.0.11-2004.04.30-1.exe) and follow the install wizard. Choose an appropriate destination folder, e.g. C:\Dev\msys.
- Agree to the post install process.
- State that MinGW is installed.
- Enter the MinGW installation folder.
- Run the MSYS Developer Toolkit installer (e.g. msysDTK-1.0.1.exe) and follow the install wizard. Choose the MSYS folder for the destination folder.
Pkg-config
- Extract the contents of the Pkg-config zip file to the MinGW folder.
TortoiseSVN
- Run the Tortoise SVN installer and follow the install wizard.
Install Optional Build Environment
Microsoft Visual C++ 6 Processor Pack
Install the Processor Pack only if you wish to compile optional dependencies using Microsoft Visual C++.
- Run the Processor Pack installer and follow the install wizard.
Netwide Assembler
- Extract the contents of the NASM zip file to an appropriate folder, e.g. C:\Program Files\Nasm.
- Make a copy of nasmw.exe and rename it to nasm.exe in the Nasm folder. (The optional components expect the filename to be nasm.exe but the Win32 version of NASM has a filename of nasmw.exe)
- Copy nasm.exe to the MinGW bin folder.
Configure Build Environment
| 1. | Open the profile file in the MSYS etc folder with a text editor. | |
| 2. | Add the following lines to the end of the file:
| |
| 3. | Save file and close editor. |
If you’ve installed the Netwide Assembler and wish to use Microsoft Visual C++ to compile optional dependencies, also follow these steps:
- Start Microsoft Visual C++.
- Choose Options from the Tools menu.
- Choose the Directories tab.
- Select Executable Files from the Show Directories For dropdown box.
- Add the path for NASM, e.g. C:\Program Files\Nasm.
Downloading Source Code from SVN
The source code for Avidemux and some of its dependencies must be downloaded from subversion repositories. TortoiseSVN supports all subversion protocols. Follow these steps to download code from an SVN URL:
- Open Windows Explorer and click on the C: drive with the right mouse button.
- Choose SVN Checkout from the popup menu.
- Enter the URL of repository, e.g. svn://svn.berlios.de/avidemux/branches/avidemux_2.3_branch/.
- Enter a Checkout directory, e.g. c:\Dev\avidemux.
- Click OK to download the source code.
Avidemux Dependencies
Download Dependencies
These dependencies are necessary to successfully build Avidemux.
| Dependency | Component(s) | Example Filename | URL |
|---|---|---|---|
| Expat v1 | expat | Expat.zip | expat website |
| GTK+ | atk | atk-1.12.3.zip | Tor Lillqvist's GTK+ for Windows website |
| atk-dev | atk-dev-1.12.3.zip | ||
| cairo | cairo-1.2.6.zip | ||
| cairo-dev | cairo-dev-1.2.6.zip | ||
| fontconfig | fontconfig-2.3.2-tml-20060825.zip | ||
| fontconfig-dev | fontconfig-dev-2.3.2-tml-20060825.zip | ||
| freetype | freetype-2.1.10-bin.zip | ||
| freetype-lib | freetype-2.1.10-lib.zip | ||
| gettext | gettext-0.14.5.zip | ||
| gettext-dev | gettext-dev-0.14.5.zip | ||
| glib | glib-2.12.6.zip | ||
| glib-dev | glib-dev-2.12.6.zip | ||
| gtk+ | gtk+-2.10.6.zip | ||
| gtk+-dev | gtk+-dev-2.10.6.zip | ||
| libiconv | libiconv-1.9.1.bin.woe32.zip | ||
| libpng | libpng-1.2.8-bin.zip | ||
| libpng-lib | libpng-1.2.8-lib.zip | ||
| pango | pango-1.14.8.zip | ||
| pango-dev | pango-dev-1.14.8.zip | ||
| Libxml v2 | libxml2 | libxml2-2.6.27.win32.zip | Libxml website |
| Netscape Portable Runtime | nspr | nspr-4.4.1.zip | Mozilla NSPR FTP site |
| Pthreads-w32 v1 | pthread-win32 | pthreads-w32-1-11-0-release.exe | Pthreads website |
| Spidermonkey | js | js-1.5.tar.gz | Mozilla Spidermonkey website |
| Zlib | zlib | zlib123-dll.zip | zlib website |
These libraries are optional but enable Avidemux to have greater functionality.
| Library | Component(s) | Example Filename | URL |
|---|---|---|---|
| Aften | aften | aften-0.05-win32.zip | Aften website |
| FAAC | faac | faac-1.25.zip | Audiocoding website |
| FAAD | faad | faad2-2.5.zip | |
| LAME | mp3lame | lame-3.97.tar.gz | LAME website |
| Libdca | libdca | libdca-0.0.2.tar.gz | libdca website |
| Ogg Vorbis | libogg | libogg-1.1.3.zip | Vorbis website |
| libvorbis | libvorbis-1.1.2.zip | ||
| Simple DirectMedia Layer | libsdl | SDL-1.2.11.zip | SDL website |
| libsdl-dev | SDL-devel-1.2.11-VC6.zip | ||
| Xvid | xvid | xvidcore-1.1.2.tar.gz | Xvid website |
Install Dependencies
Expat
- Extract the files xmlparse.dll and xmltok.dll from the expat zip file to the MinGW bin folder.
- Copy xmlparse.dll as libexpat.dll.
GTK+
- Extract the contents of each zip file (atk, atk-dev, cairo, cairo-dev, fontconfig, fontconfig-dev, freetype, freetype-lib, gettext, gettext-dev, glib, glib-dev, gtk+, gtk+-dev, libiconv, libpng, libpng-lib, pango, pango-dev) to the MinGW folder.
Libxml2
- Extract the contents of the libxml2 zip file to a temporary folder.
- Move the libxml2 bin, include and lib folders to the corresponding MinGW folders.
Netscape Portable Runtime
- Extract the contents of the nspr zip file to a folder, e.g. C:\Dev.
- Copy libnspr4.dll from the NSPR lib folder to the MinGW bin folder.
Pthreads-w32 v1
- Run the Pthreads-w32 exe to extract required files to a temporary folder.
- Copy the contents of the Pre-built.1\include folder to the MinGW include folder.
- Copy all a and lib files from the Pre-built.1\lib folder to the MinGW lib folder.
- Copy all dll files from the Pre-built.1\lib folder to the MinGW bin folder.
Zlib
- Extract the contents of the zlib zip file to the MinGW folder.
- Copy zdll.lib in the MinGW lib folder as z.lib.
- Move zlib1.dll from the MinGW folder to the MinGW bin folder.
Spidermonkey
- Extract the contents of the tarball to a folder, e.g. C:\Dev.
- Build Spidermonkey using Microsoft Visual C++ or MinGW:
| Using Microsoft Visual C++ 6.0 | |||
| a. | Open the js.mak file in the Spridermonkey src folder with a text editor. | ||
| b. | Update the compiler options to refer to the Netscape Portable Runtime by replacing all occurrences of:
| ||
| c. | Update the linker options to refer to the Netscape Portable Runtime by replacing all occurrences of:
| ||
| d. | Save the file and close the editor. | ||
| e. | Start a command prompt and run VCVARS32.BAT from the Visual C++ bin folder.
| ||
| f. | Change directory to the Spidermonkey src folder.
| ||
| g. | Run NMAKE on js.mak using the jsshell – Win32 Release configuration.
| ||
| h. | Close the command prompt. | ||
| i. | Start MSYS. | ||
| j. | Change directory to the Spidermonkey src\Release folder.
| ||
| k. | Using pexports, create a module-definition file for the newly created js32.dll:
| ||
| l. | Use dlltool to produce a libjs import library.
| ||
| m. | Move js32.dll to the MinGW bin folder.
| ||
| n. | Close MSYS. | ||
| Using MinGW | |||
| a. | Create a text file named makefile in the Spidermonkey src/fdlibm folder. | ||
| b. | Paste the following script into makefile:
# Project: fdlibm CC = gcc.exe SRCDIR = /c/dev/js/src/fdlibm OBJECTS= \ $(SRCDIR)/w_sqrt.o \ $(SRCDIR)/e_pow.o \ $(SRCDIR)/e_sqrt.o \ $(SRCDIR)/k_standard.o \ $(SRCDIR)/s_atan.o \ $(SRCDIR)/s_finite.o \ $(SRCDIR)/s_isnan.o \ $(SRCDIR)/s_matherr.o \ $(SRCDIR)/s_rint.o \ $(SRCDIR)/s_scalbn.o \ $(SRCDIR)/w_atan2.o \ $(SRCDIR)/e_atan2.o \ $(SRCDIR)/s_fabs.o \ $(SRCDIR)/s_copysign.o \ $(SRCDIR)/w_pow.o \ $(SRCDIR)/s_lib_version.o LIBS = -llibm BIN = fdlibm.lib CFLAGS = -DJS_THREADSAFE -D_IEEE_LIBM -DWIN32 -D_WINDOWS -s .c.o: $(CC) -c $(CFLAGS) -o $@ $*.c $(BIN): $(OBJECTS) ar r $(BIN) $(OBJECTS) ranlib $(BIN) | ||
| c. | Make sure all indentations in the script are tabbed and not spaced. Also ensure SRCDIR is correctly set to the Spridermonkey src\fdlibm folder. | ||
| d. | Create a text file named makefile in the Spidermonkey src folder. | ||
| e. | Paste the following script into makefile:
# Project: js32
CC = gcc.exe
WINDRES = windres.exe
RES = js.res
SRCDIR = /c/dev/js/src
OBJECTS = \
$(SRCDIR)/jsapi.o \
$(SRCDIR)/jsarena.o \
$(SRCDIR)/jsarray.o \
$(SRCDIR)/jsatom.o \
$(SRCDIR)/jsbool.o \
$(SRCDIR)/jscntxt.o \
$(SRCDIR)/jsdate.o \
$(SRCDIR)/jsdbgapi.o \
$(SRCDIR)/jsdhash.o \
$(SRCDIR)/jsdtoa.o \
$(SRCDIR)/jsemit.o \
$(SRCDIR)/jsexn.o \
$(SRCDIR)/jsfun.o \
$(SRCDIR)/jsgc.o \
$(SRCDIR)/jshash.o \
$(SRCDIR)/jsinterp.o \
$(SRCDIR)/jslock.o \
$(SRCDIR)/jslog2.o \
$(SRCDIR)/jslong.o \
$(SRCDIR)/jsmath.o \
$(SRCDIR)/jsnum.o \
$(SRCDIR)/jsobj.o \
$(SRCDIR)/jsopcode.o \
$(SRCDIR)/jsparse.o \
$(SRCDIR)/jsprf.o \
$(SRCDIR)/jsregexp.o \
$(SRCDIR)/jsscan.o \
$(SRCDIR)/jsscope.o \
$(SRCDIR)/jsscript.o \
$(SRCDIR)/jsstr.o \
$(SRCDIR)/jsutil.o \
$(SRCDIR)/jsxdrapi.o \
$(SRCDIR)/prmjtime.o \
$(RES)
LIBS = --add-stdcall-alias -lfdlibm -lnspr4 -L./fdlibm -L/c/dev/nspr-4.4.1/lib
BIN = js.dll
CFLAGS = -I/dev/nspr-4.4.1/include -DJS_THREADSAFE -DXP_WIN \
-DEXPORT_JS_API -D_WINDOWS -DWIN32 -D_MINGW -s
DLLWRAP=dllwrap.exe
DEFFILE=libjs.def
STATICLIB=libjs.a
.c.o: $(CC) -c $(CFLAGS) -o $@ $*.c
$(BIN): $(OBJECTS)
$(CC) -shared -o $@ \
-Wl,--output-def,$(DEFFILE) \
-Wl,--out-implib,$(STATICLIB) \
$(OBJECTS) \
$(LIBS)
$(RES):
$(WINDRES) -i $(SRCDIR)/js3240.rc -I rc -o $(RES) -O coff
| ||
| f. | Make sure all indentations in the script are tabbed and not spaced. Also ensure LIBS and CFLAGS are correctly set to the appropriate Netscape Portable Runtime subdirectories and SRCDIR is correctly set to the Spridermonkey src folder. | ||
| g. | Start MSYS. | ||
| h. | Make the fdlibm library.
| ||
| i. | Make the Spidermonkey library.
| ||
| j. | Move js.dll to the MinGW bin folder and libjs.a to the MinGW lib folder.
| ||
| k. | Close MSYS. | ||
Install Optional Libraries
Aften
| 1. | Extract the contents of the Aften zip file to a temporary folder, e.g. C:\Dev. | |
| 2. | Move the Aften bin, include and lib subdirectories to the corresponding MinGW folders. | |
| 3. | Open the file aften.h in the MinGW include folder with a text editor. | |
| 4. | Fix the incorrect usage of a reserved word by replacing:
| |
| 5. | Save the file and close the editor. |
If you prefer to use a DLL rather than linking to a static library, also follow these steps:
| 1. | Start MSYS. | |
| 2. | Change directory to the MinGW lib folder.
| |
| 3. | Create aften.dll from the libaften.a static library.
| |
| 4. | Remove all unnecessary symbols from aften.dll.
| |
| 5. | Using pexports, create a module-definition file for the Aften runtime:
| |
| 6. | Use dlltool to produce a Aften import library.
| |
| 7. | Move aften.dll to the MinGW bin folder.
| |
| 8. | Close MSYS. |
FAAC
| 1. | Extract the contents of the faac zip file to a temporary folder, e.g. C:\Dev. | |
| 2. | Open the header files libfaac\frame.h and include\faac.h with a text editor. | |
| 3. | Replace the following line in both files:
| |
| 4. | Save both files and close the editor. | |
| 5. | Copy *.h in the FAAC include folder to the MinGW include folder. | |
| 6. | Build FAAC using Microsoft Visual C++ or MinGW: |
| Using Microsoft Visual C++ 6.0 | |||
| a. | Open the file libfaac_dll.dsw in the FAAC libfaac folder using Microsoft Visual C++ 6.0. | ||
| b. | Add Source Files that are missing from the project and remove Source File that no longer exist (add kiss_fft\ kiss_fft.c, kiss_fft\ kiss_fftr.c). | ||
| c. | Choose Set Active Configuration from the Build menu. | ||
| d. | Choose the libfaac_dll – Win32 Release project configuration. | ||
| e. | Choose Settings from the Project menu. | ||
| f. | Choose the C/C++ tab. | ||
| g. | Select Preprocessor from the Category dropdown box. | ||
| h. | Add ..\include to the Additional include directories. | ||
| i. | Click the OK button. | ||
| j. | Choose Build libfaac.dll from the Build menu. | ||
| k. | Close Microsoft Visual C++. | ||
| l. | Copy libfaac.dll in the FAAC libfaac\ReleaseDLL folder to the MinGW bin folder. | ||
| m. | Start MSYS. | ||
| n. | Using pexports, create a module-definition file for the FAAC runtime:
| ||
| o. | Use dlltool to produce a FAAC import library.
| ||
| p. | Close MSYS. | ||
| Using MinGW | |||
| a. | Start MSYS. | ||
| b. | Change directory to the FAAC libfaac folder.
| ||
| c. | Compile source code and link libfaac.dll.
| ||
| d. | Close MSYS. | ||
FAAD
| 1. | Extract the contents of the FAAD zip file to a temporary folder, e.g. C:\Dev. | |
| 2. | Copy *.h in the FAAD include folder to the MinGW include folder. | |
| 3. | Build FAAD using Microsoft Visual C++ or MinGW: |
| Using Microsoft Visual C++ 6.0 | |||
| a. | Open the file libfaad2_dll.dsw in the FAAD libfaad folder using Microsoft Visual C++ 6.0. | ||
| b. | Remove dither.c from the project as it no longer exists. | ||
| c. | Update libfaad2.def to the following:
LIBRARY libfaad2.dll EXPORTS ; ; libfaad exports ; NeAACDecOpen @1 NeAACDecGetCurrentConfiguration @2 NeAACDecSetConfiguration @3 NeAACDecInit @4 NeAACDecInit2 @5 NeAACDecDecode @6 NeAACDecClose @7 NeAACDecGetErrorMessage @8 NeAACDecAudioSpecificConfig @9 NeAACDecPostSeekReset @10 | ||
| d. | Choose Set Active Configuration from the Build menu. | ||
| e. | Choose the libfaad_dll – Win32 Release project configuration. | ||
| f. | Choose Build libfaad2.dll from the Build menu. | ||
| g. | Close Microsoft Visual C++. | ||
| h. | Copy libfaad2.dll in the FAAD libfaad\ReleaseDLL folder to the MinGW bin folder. | ||
| i. | Start MSYS. | ||
| j. | Using pexports, create a module-definition file for the FAAD runtime:
| ||
| k. | Use dlltool to produce a FAAD import library.
| ||
| l. | Close MSYS. | ||
| Using MinGW | |||
| a. | Start MSYS. | ||
| b. | Change directory to the FAAD libfaad folder.
| ||
| c. | Compile source code and link libfaad2.dll.
| ||
| d. | Close MSYS. | ||
LAME
| 1. | Extract the contents of the lame tarball to a temporary folder, e.g. C:\Dev. | |
| 2. | Start MSYS. | |
| 3. | Change directory to the lame folder.
| |
| 4. | Execute the following commands:
| |
| 5. | Remove all unnecessary symbols from libmp3lame-0.dll.
| |
| 6. | Close MSYS. |
Libdca
| 1. | Extract the contents of the libdca tarball to a temporary folder, e.g. C:\Dev. | |
| 2. | Start MSYS. | |
| 3. | Change directory to the libdca folder.
| |
| 4. | Execute the following commands:
| |
| 5. | Close MSYS. | |
| 6. | Copy dts_internal.h in the libdts folder to the MinGW include folder. |
If you prefer to use a DLL rather than linking to a static library, also follow these steps:
| 1. | Start MSYS. | |
| 2. | Change directory to the MinGW lib folder.
| |
| 3. | Create dts.dll from the libdts.a static library.
| |
| 4. | Remove all unnecessary symbols from dts.dll.
| |
| 5. | Using pexports, create a module-definition file for the dts runtime:
| |
| 6. | Use dlltool to produce a dts import library.
| |
| 7. | Move dts.dll to the MinGW bin folder.
| |
| 8. | Close MSYS. |
Ogg Vorbis
| 1. | Extract the contents of the Ogg and Vorbis zip files to the same temporary folder, e.g. C:\Dev. | |
| 2. | Build Ogg Vorbis using Microsoft Visual C++ or MinGW: |
| Using Microsoft Visual C++ 6.0 | |||
| a. | Rename the Ogg folder to ogg. | ||
| b. | Open the file ogg.dsw in the Ogg win32 folder using Microsoft Visual C++ 6.0. | ||
| c. | Choose Set Active Configuration from the Build menu. | ||
| d. | Choose the ogg_dynamic – Win32 Release project configuration. | ||
| e. | Choose Build ogg.dll from the Build menu. | ||
| f. | Close Microsoft Visual C++. | ||
| g. | Copy ogg.dll in the Ogg win32\Dynamic_Release folder to the MinGW bin folder. | ||
| h. | Copy the Ogg include\ogg folder to the MinGW include folder. | ||
| i. | Open the file vorbis.dsw in the Vorbis win32 folder using Microsoft Visual C++ 6.0. | ||
| j. | Choose Set Active Configuration from the Build menu. | ||
| k. | Choose the vorbis_dynamic – Win32 Release project configuration. | ||
| l. | Choose Build vorbis.dll from the Build menu. | ||
| m. | Repeat steps j – l to build vorbisenc.dll and vorbisfile.dll using the vorbisenc_dynamic – Win32 Release and vorbisfile_dynamic – Win32 Release project configurations. | ||
| n. | Close Microsoft Visual C++. | ||
| o. | Copy vorbis.dll in the Vorbis win32\Vorbis_Dynamic_Release folder to the MinGW bin folder. | ||
| p. | Copy vorbisenc.dll in the Vorbis win32\VorbisEnc_Dynamic_Release folder to the MinGW bin folder. | ||
| q. | Copy vorbisfile.dll in the Vorbis win32\VorbisFile_Dynamic_Release folder to the MinGW bin folder. | ||
| r. | Copy the Vorbis include\vorbis folder to the MinGW include folder. | ||
| s. | Start MSYS. | ||
| t. | Using pexports, create a module-definition file for the Ogg Vorbis runtimes:
| ||
| u. | Use dlltool to produce Ogg Vorbis import libraries.
| ||
| v. | Close MSYS. | ||
| Using MinGW | |||
| a. | Start MSYS. | ||
| b. | Change directory to the Ogg folder.
| ||
| c. | Execute the following commands:
| ||
| d. | Change directory to the Vorbis folder.
| ||
| e. | Execute the following commands:
| ||
| f. | Close MSYS. | ||
Simple DirectMedia Layer
| 1. | Extract the contents of the SDL zip file to a temporary folder, e.g. C:\Dev. | |
| 2. | Start MSYS. | |
| 3. | Change directory to the SDL folder.
| |
| 4. | Execute the following commands:
| |
| 5. | Close MSYS. | |
| 6. | If you prefer a Microsoft Visual C++ compiled runtime, extract SDL.dll in the SDL-dev zip file to the MinGW bin folder. Alternatively, compile the supplied SDL.dsw using Microsoft Visual C++ 6.0. |
x264
| 1. | Using Tortoise SVN, download the latest x264 source code from:
| |
| 2. | Open the file configure in the x264 folder with a text editor. | |
| 3. | Update the following lines:
if cc_check pthread.h -lpthread "pthread_create(0,0,0,0);" ; then
pthread="yes"
libpthread="-lpthread"
to: if cc_check pthread.h –lpthreadGC1 "pthread_create(0,0,0,0);" ; then
pthread="yes"
libpthread="-lpthreadGC1"
| |
| 4. | Save the file and close the editor. | |
| 5. | Open the file Makefile in the x264 folder with a text editor. | |
| 6. | Replace the following lines:
libx264.a: .depend $(OBJS) $(OBJASM) ar rc libx264.a $(OBJS) $(OBJASM) ranlib libx264.a $(SONAME): .depend $(OBJS) $(OBJASM) $(CC) -shared -o $@ $(OBJS) $(OBJASM) -Wl,-soname,$(SONAME) $(LDFLAGS) with: ifeq ($(SYS),MINGW) $(CC) -shared -Wl,--out-implib,libx264.a -o libx264.dll $(OBJS) $(OBJASM) $(LDFLAGS) else libx264.a: .depend $(OBJS) $(OBJASM) ar rc libx264.a $(OBJS) $(OBJASM) ranlib libx264.a $(SONAME): .depend $(OBJS) $(OBJASM) $(CC) -shared -o $@ $(OBJS) $(OBJASM) -Wl,-soname,$(SONAME) $(LDFLAGS) endif | |
| 7. | Save the file and close the editor. | |
| 8. | Start MSYS. | |
| 9. | Change directory to the x264 folder.
| |
| 10. | Execute the following commands:
| |
| 11. | Copy libx264.dll to the MinGW bin folder.
| |
| 12. | Close MSYS. |
Xvid
| 1. | Extract the contents of the Xvid tarball to a temporary folder, e.g. C:\Dev. | |
| 2. | Build Xvid using Microsoft Visual C++ or MinGW: |
| Using Microsoft Visual C++ 6.0 | |||
| a. | Open the file xvidcore.dsw in the Xvid build\Win32 folder using Microsoft Visual C++ 6.0. | ||
| b. | Choose Set Active Configuration from the Build menu. | ||
| c. | Choose the libxvidcore – Win32 Release project configuration. | ||
| d. | Choose Build xvidcore.dll from the Build menu. | ||
| e. | Close Microsoft Visual C++. | ||
| f. | Copy the xvidcore.dll file from the Xvid build\Win32\bin folder to the MinGW bin folder. | ||
| g. | Copy the xvidcore.dll.a file from the Xvid build\Win32\bin folder to the MinGW lib folder. | ||
| h. | Copy the xvid.h file from the Xvid src folder to the MinGW include folder. | ||
| Using MinGW | |||
| a. | Start MSYS. | ||
| b. | Change directory to the Xvid build\generic folder.
| ||
| c. | Execute the following commands:
| ||
| d. | Close MSYS. | ||
Build Avidemux
| 1. | Using Tortoise SVN, download the latest Avidemux source code. Alternatively, download and extract the latest Avidemux source code tarball. | |
| 2. | Start MSYS. | |
| 3. | Change directory to the Avidemux source code folder.
| |
| 4. | Execute the following command:
| |
| 5. | Run configure referencing the Spidermonkey src folder and then perform a make:
| |
| 6. | The make will fail. Run the make again but capture the output to a text file.
| |
| 7. | Open the dolink file in the Avidemux avidemux folder with a text editor. | |
| 8. | Remove all lines from the file apart from the one starting with:
| |
| 9. | Include .\xpm\adm.o in the list of library object files. This will add the avidemux icon to the resulting executable. | |
| 10. | Move all –l parameters to the end of the line. | |
| 11. | Add the following parameters to the end of the line:
| |
| 12. | The final result should look something like this:
/bin/sh ../libtool --silent --mode=link g++ -g -I.. -I../ADM_lavutil -IADM_library -I../ADM_library \ -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -g -O2 -mno-cygwin -mms-bitfields -O2 -falign-loops=16 \ -o avidemux2.exe \ -L/mingw/lib \ \ guiplay.o gui_savenew.o gui_navigate.o gtk_gui.o callbacks.o \ avilist.o main.o prefs.o ADM_guiBitrate.o ADM_pp.o ADM_memsupport.o \ gui_autodrive.o GUI_jobs.o ADM_dialog/DIA_quota.o \ ADM_lavcodec/libavcodec.a ADM_lavcodec/libpostproc/libpostproc.a \ ./ADM_script/libADM_script.a ./ADM_editor/libADM_editor.a \ ./ADM_library/libADM_library.a ./ADM_openDML/libADM_openDML.a \ ./oplug_ogm/liboplug_ogm.a ./ADM_audiocodec/libADM_audiocodec.a \ ./ADM_audio/libADM_audio.a ./oplug_avi/liboplug_avi.a \ ./oplug_mp4/liboplug_mp4.a ./oplug_mpeg/liboplug_mpeg.a \ ./oplug_mpegFF/liboplug_mpegFF.a ./ADM_mplex/libADM_mplex.a \ ./ADM_lavformat/libADM_lavformat.a ./ADM_lavutil/libADM_lavutil.a \ ./ADM_lvemux/libADM_lvemux.a ./ADM_filter/libADM_filter.a \ ./ADM_video/libADM_video.a ./ADM_encoder/libADM_encoder.a \ ./ADM_codecs/libADM_codecs.a ./ADM_vp32/libADM_vp32.a \ ./ADM_audiofilter/libADM_audiofilter.a ./libtoolame/liblibtoolame.a \ ./ADM_gui2/libADM_gui2.a ./ADM_libswscale/libswscale.a \ ./mpeg2enc/libmpeg2enc.a ./ADM_liba52/libADM_liba52.a \ ./ADM_libMad/libADM_mad.a ./ADM_inpics/libADM_inpics.a \ ./ADM_3gp/libADM_3gp.a ./ADM_avsproxy/libADM_avsproxy.a \ ./ADM_matroska/libADM_matroska.a ./ADM_asf/libADM_asf.a \ ./ADM_h263/libADM_h263.a ./ADM_nuv/libADM_nuv.a \ ./ADM_ogm/libADM_ogm.a ./ADM_audiodevice/libADM_audiodevice.a \ ./ADM_xvidratectl/libADM_xvidratectl.a ./ADM_requant/libADM_requant.a \ ./ADM_ocr/libADM_ocr.a ./ADM_mpegdemuxer/libADM_mpegdemuxer.a \ ./ADM_audio/libADM_audio.a ./ADM_toolkit/libADM_toolkit.a \ ./ADM_dialog/libADM_dialog.a ./libMpeg2Dec/liblibMpeg2Dec.a \ ./ADM_tray/libADM_tray.a ./ADM_colorspace/libADM_colorspace.a \ ADM_lavcodec/libavcodec.a ./ADM_lavutil/libADM_lavutil.a \ ./ADM_lavcodec/libpostproc/libpostproc.a ./ADM_library/libADM_library.a \ ./ADM_toolkit/libADM_toolkit.a ./libass/libass.a \ ./xpm/adm.o \ \ -luuid -ljs -lfontconfig -lmp3lame -lvorbis -lvorbisenc -lfaac -lfaad \ -ldts -lxvidcore -lpng -lx264 -laften -lmingw32 -lSDLmain -lSDL \ -mwindows -user32 -lpthreadGC1 -lgtk-win32-2.0 -lgdk-win32-2.0 -limm32 \ -lshell32 -lole32 -latk-1.0 -lgdk_pixbuf-2.0 -lpangowin32-1.0 -lgdi32 \ -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 \ -lglib-2.0 -lintl -liconv -lgthread-2.0 -lfreetype -lz -llibxml2 \ -lwinmm -lwsock32 | |
| 13. | Link Avidemux2.exe and strip all unnecessary symbols.
| |
| 14. | Run avidemux2.exe
|
