Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > MPEG-4 AVC / H.264

Reply
 
Thread Tools Search this Thread Display Modes
Old 13th October 2005, 14:56   #161  |  Link
hpn
Registered User
 
Join Date: Jan 2005
Posts: 191
@celtic_druid, Sharktooth, bobOr and the others.

Probably no one will want to do this, but....if someone has 10 spare minutes could you please compile and post here a very detailed step by step guide for dummies (like me) on how to compile x264 under Windows XP (or at least fix and complete the example guide below). I don't need to understand how exactly it works, rather just blindly follow the steps. I've read the whole thread and made some compilation attempts, but a few things are still eluding me (the GPAC thing?). If more than one posts his version of such a guide, it would be even better. I can see x264vfw.dll and x264.exe always have different sizes, depending on who compiles them (St, bobOr or CD), so I guess different compilation procedures (parameters) are used.

A HUGE thanks in advance!


Example Guide:

Note: Most of this example guide is incorrect, including steps order, unnecessary steps, software versions, configure options etc. It's just an example of how to explain things to complete newbies (if you want the real thing check the final guide a few posts below).

step 1. Download and install TortoiseSVN from
http://prdownloads.sourceforge.net/t...3.msi?download

step 2. To download the x264 source, create an empty folder on your hard drive like this c:\x264\ . Right-click on this folder and select "SVN checkout" from the menu. Then in the field named "URL of repository:" type "svn://svn.videolan.org/x264/trunk" (without the quotes) and click OK. Wait for a few seconds until downloading is finished. Now the latest x264 source code is in the folder.

(note: there are many ways to download the source. TortoiseSVN is just one of them)

step 3. Download "MinGW-2.0.0-3.exe" from
http://prdownloads.sourceforge.net/m...3.exe?download
Execute the file and install MinGW to folder "c:\MinGW\"

step 4. Download "nasm-0.98.38-win32.zip" from
http://prdownloads.sourceforge.net/n...2.zip?download
Extract the zip file, rename "nasmw.exe" to "nasm.exe" and copy "nasm.exe" to: C:\MinGW\bin\)

step 5. Download "gcc-core-3.4.4-20050522-1.tar.gz" from
http://prdownloads.sourceforge.net/m...ar.gz?download
Extract the file, maintaining the directory structure, into your root directory for mingw "c:\MinGW", overwriting the old ones.

step 6.
Download "GPAC Framework 0.4.1 2005.10.08.exe" from
http://www.aziendeassociate.it/cd.asp?dir=/gpac/dev
Execute the file and install MinGW to folder "C:\GPAC\" (not c:\Program Files\GPAC\)

step 7. Download "binutils-2.16.91-20050827-1.tar.gz" from
http://prdownloads.sourceforge.net/m...ar.gz?download
Extract the file, maintaining the directory structure, into your root directory for mingw "c:\MinGW\", overwriting the old ones.

step 8. Download "w32api-3.3.tar.gz" from
http://prdownloads.sourceforge.net/m...ar.gz?download
Extract the file, overwriting lib and include folders into your root directory for mingw "c:\MinGW\"

step 9. Download "MSYS-1.0.10.exe" from
http://prdownloads.sourceforge.net/m...0.exe?download
Execute the file and install to "C:\msys\1.0"

When asked "Do you want to continue with the post install? [yn]" type y to confirm and press "Enter"
When asked "Do you have MinGW installed? [yn]" type y and press "Enter"
When asked "Where is your MinGW installation?" type c:/MinGW and press "Enter". Make sure you type in the path of your MinGW directory using forward slashes (/), not like the Dos prompt style (c:\)
Press Ok to finish the MSYS installation.

step 10. Some other steps may need to be added here...

step 11. In Start Menu->Programs->MinGW->MSYS execute msys. This will open the MSYS window.

step 12. Type "cd /c/x264/" (without the quotes) and press "Enter". If you have downloaded the x264 source to a different folder you need to specify the correct path here.

step 13. Type "./configure --enable-vfw --enable-avis-input --enable-mp4-output" (without the quotes). Instead of typing it you could copy the string from this guide (Ctrl+C) and paste it into the MinGW window by hitting the middle mouse button (or the scroll ball) or Shift + Left-click if your mouse has only 2 buttons.

step 14. Type "cd /c/x264/build/cygwin/" . If you have downloaded the x264 source to a different folder you need to specify the correct path here.

step 15. Type "make NDEBUG=1" (without the quotes) and press "Enter".

step 16. Now go to "C:\x264\build\cygwin\bin\" and you'll find the x264.exe (note: I've never reached this point, always get "make: *** [x264.exe] Error 1" or something at the end)

step 17. When compiling a new version of x264, always type "make clean" first.

step 18. Some extra steps for compiling the x264vfw.dll

Last edited by hpn; 14th October 2005 at 13:24.
hpn is offline   Reply With Quote
Old 13th October 2005, 15:00   #162  |  Link
Sharktooth
Mr. Sandman
 
Sharktooth's Avatar
 
Join Date: Sep 2003
Location: Haddonfield, IL
Posts: 11,768
make NDEBUG=1 is no longer necessary. just make.
step 14 and 18 are not necessary too.

Last edited by Sharktooth; 13th October 2005 at 16:08.
Sharktooth is offline   Reply With Quote
Old 13th October 2005, 15:36   #163  |  Link
bob0r
Pain and suffering
 
bob0r's Avatar
 
Join Date: Jul 2002
Posts: 1,337
for --enable-mp4-output you need gpac.

cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/gpac login
cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/gpac co -P gpac
configure
make clean
make lib

copy /gpac/include/gpac/ to c:/MinGW/include/
copy /gpac/bin/gcc/libgpac_static.a to c:/MinGW/lib/
bob0r is offline   Reply With Quote
Old 13th October 2005, 16:06   #164  |  Link
leowai
Registered User
 
Join Date: May 2005
Posts: 184
right after step13, just issue a "make" command will compile and produce both "x264.exe" (in root directory) and "x264vfw.dll" (in root\vfw\build\cygwin\bin).
leowai is offline   Reply With Quote
Old 13th October 2005, 21:29   #165  |  Link
hellfred
FFmpeg fan
 
Join Date: Dec 2003
Location: Germany
Posts: 427
I second Sharktooths suggestion to type make in x264 root directory (omitt step 14). The one in build/cygwin is most probably outdated
Code:
make
make install
Make install will copy x264.exe to /mingw/bin, the headers and libs to /mingw/include and /mingw/lib, allowing one to build mencoder with support of x264.
But on WinXP, with admin root, one can use the Makefile in vfw/build/cygwin to install the vfw dll:
Code:
cd vfw/build/cygwin/
make install
Hellfred
hellfred is offline   Reply With Quote
Old 14th October 2005, 00:44   #166  |  Link
hpn
Registered User
 
Join Date: Jan 2005
Posts: 191
Thank you all for the tips, especially bob0r for the GPAC details!


Here is the final version:

---------------------------------------------------------------------------------------------------

Step by step x264 compilation guide for complete newbies:
Last updated: Oct. 21, 2006

Note: Tested under Windows XP with x264 revision 594. All tools used in this guide will be replaced by new versions in the future (and some links broken), so make sure you always use the most recent versions.


step 1. Download and install "TortoiseSVN-1.3.4.6692-svn-1.3.2.msi" from
http://prdownloads.sourceforge.net/t...-svn-1.3.2.msi
(check for new version: link)

step 2. To download the x264 source, create an empty folder on your hard drive like this c:\x264\ . Right-click on this folder and select "SVN checkout" from the menu. Then in the field named "URL of repository:" type "svn://svn.videolan.org/x264/trunk" (without the quotes) and click OK. Wait a few seconds until downloading is finished. Now the latest x264 source code is in the folder.

(note: there are many ways to download the source. TortoiseSVN is just one of them)

step 3.
Download "MinGW-3.2.0-rc-3.exe" from
http://prdownloads.sourceforge.net/m...3.2.0-rc-3.exe
Execute the file and install MinGW to folder "C:\MinGW\"
(check for new version: link)

step 4. Download "mingw-runtime-3.9.tar.gz" from
http://prdownloads.sourceforge.net/m...ime-3.9.tar.gz
Extract the file, maintaining the directory structure to your root directory for mingw "C:\MinGW", overwriting the old files.
(check for new version: link)

step 5.
Download "w32api-3.7.tar.gz" from
http://prdownloads.sourceforge.net/m...api-3.7.tar.gz
Extract the file, overwriting "lib" and "include" folders into your root directory for mingw "C:\MinGW\"
(check for new version: link)

step 6.
Download "nasm-0.98.39-win32.zip" from
http://prdownloads.sourceforge.net/n...8.39-win32.zip
Extract the file, rename "nasmw.exe" to "nasm.exe" and copy "nasm.exe" to "C:\MinGW\bin\"
(check for new version: link)

step 7. Download "gcc-core-3.4.5-20060117-1.tar.gz" from
http://prdownloads.sourceforge.net/m...60117-1.tar.gz
Extract the file, maintaining the directory structure to your root directory for mingw "C:\MinGW", overwriting the old files.
(check for new version: link)

step 8.
Download "binutils-2.16.91-20060119-1.tar.gz" from
http://prdownloads.sourceforge.net/m...60119-1.tar.gz
Extract the file, maintaining the directory structure, into your root directory for mingw "C:\MinGW\", overwriting the old files.
(check for new version: link)

step 9. Download "zlib-1.2.3.exe" from
http://prdownloads.sourceforge.net/g...zlib-1.2.3.exe
Execute the file and install it to "C:\zlib\" (select full installation) and copy the contents of "C:\zlib\" maintaining the directory structure into "C:\MinGW\"
(check for new version: link)

step 10. Download "MSYS-1.0.11-2004.04.30-1.exe" from
http://prdownloads.sourceforge.net/m...04.04.30-1.exe
Execute the file and install in "C:\msys\1.0"
When asked "Do you want to continue with the post install? [yn]" type y to confirm and press "Enter"
When asked "Do you have MinGW installed? [yn]" type y and press "Enter"
When asked "Where is your MinGW installation?" type c:/MinGW and press "Enter". Make sure you type in the path of your MinGW directory using forward slashes (/), not backslashes (\) like the DOS prompt style (C:\)
Press Ok to finish the MSYS installation.
(check for new version: link)

step 11. Download "msysDTK-1.0.1.exe" from
http://prdownloads.sourceforge.net/m...sDTK-1.0.1.exe
Execute the file and install in "C:\msys\1.0"
(msysDTK-1.0.1.exe installs cvs needed for the GPAC download below)

step 12. In Start Menu->Programs->MinGW->MSYS execute msys. This will open the MSYS window. If the font looks too small on your screen, just open the file "c:\msys\1.0\msys.bat" with notepad, search for "Courier-12" and change it to "Courier-14", then restart msys.

step 13 Type "cd /c" (without the quotes) and press "Enter".

step 14. Type "msys/1.0/bin/cvs -z3 -d:pserver:anonymous@gpac.cvs.sourceforge.net:/cvsroot/gpac co -P gpac" (without the quotes). This command will download the GPAC source code to C:\gpac\
(note: Instead of typing this long string you can copy it from this guide (Ctrl+C) and paste in the MinGW window by clicking the middle mouse button (or press the scroll ball) or Shift + Left-click if your mouse has only 2 buttons)

step 15. Reserved (currently not used, so just skip them)

step 16. Type "cd /c/gpac/" (without the quotes) and press "Enter".

step 17. Type "configure" (the only thing it does is to create config.mak in the C:\gpac folder)

step 18. Type "make lib" (a long process follows, so wait about a minute until it's complete)

step 19. Reserved (currently not used, so just skip it)

step 20. Type "cd /c/x264/" (without the quotes) and press "Enter". If you have downloaded the x264 source to a different folder you need to specify the correct path here.

step 21. (optional, go to step 22 if you don't want to patch the source) If you want to apply patch(es) to the x264 source code, just copy the diff file(s) to c:\x264\ folder, then type "patch < filename.diff -p0" replacing filename.diff with the real file name.

For example if you want to apply 2 patches:

x264_aq.5-576.diff
x264_tcplx_mask.00.diff


you just type:
patch < x264_aq.5-576.diff -p0
then
patch < x264_tcplx_mask.00.diff -p0

The latest diff files may be found at this page. If you get "failed hunks" errors while applying diff files, just read the quide about fixing conflicting diffs a few posts below.

step 22. Type configure --enable-avis-input --enable-mp4-output --extra-cflags="-Ic:/gpac/include" --extra-ldflags="-Lc:/gpac/bin/gcc" (here the closing character " is part of the configure string, so don't miss it). Instead of typing this long string you can copy it from this guide (Ctrl+C) and paste in the MinGW window by clicking the middle mouse button (or press the scroll ball) or Shift + Left-click if your mouse has only 2 buttons .

step 23. Type "make" (without the quotes) and press "Enter".

note: when compiling x264 again (step 23), always type "make clean" first.

step 24. Now you can locate the compiled file here:
C:\x264\x264.exe

Of course instead of compiling x264 yourself, it is always safer to download and install the latest x264 builds from bob0r or celtic_druid

Last edited by hpn; 24th January 2007 at 23:28.
hpn is offline   Reply With Quote
Old 14th October 2005, 09:10   #167  |  Link
JimiK
just me
 
Join Date: Sep 2002
Posts: 158
Instead of having to copy the libs in step 20 everytime, you could add:
--extra-cflags="-Ic:/gpac/include" --extra-ldflags="-Lc:/gpac/bin/gcc"
in step 22. This way your MinGW/lib folder stays clean and your latest gpac compile gets used without the copying.
Best regards,
JimiK
JimiK is offline   Reply With Quote
Old 14th October 2005, 11:25   #168  |  Link
Sharktooth
Mr. Sandman
 
Sharktooth's Avatar
 
Join Date: Sep 2003
Location: Haddonfield, IL
Posts: 11,768
alternative to step24:
for VFW there's also an installer folder located in wfv/installer.
to compile the installer script (x264-conf.nsi) you need to download and install NSIS version 2.xx from http://nsis.sourceforge.net/ .
Once you installed NSIS just righ-click the x264.conf.nsi script and select "Compile NSIS script".
Then, when finished, double click the .exe file and you get x264 VFW installed with start menu entries for configuration and uninstall.
Sharktooth is offline   Reply With Quote
Old 17th October 2005, 21:10   #169  |  Link
thetrueavatar
Registered User
 
Join Date: Sep 2004
Posts: 29
Hi,
First a big thanks for this thread about x264 compilation.
I never tried to compile an open-source projet before and my first attempt was really painful. So once again thanks for all those informations.

However, I still have two problems even if I've followed all your instruction.

First, I can't compile vfw.
Here's my error
Code:
make -C vfw/build/cygwin
make[1]: Entering directory `/c/x264/trunk/vfw/build/cygwin'
 C: ./config.c
 C: ./driverproc.c
c:/x264/trunk/vfw/build/cygwin/../../x264vfw.h:133: warning: 'tabs_enable_items'                                              declared `static' but never defined
c:/x264/trunk/vfw/build/cygwin/../../x264vfw.h:134: warning: 'tabs_update_items'                                              declared `static' but never defined
 W: ./resource.rc
 L: x264vfw.dll
Creating library file: x264vfw.dll.a
c:/x264/trunk/vfw/build/cygwin/../../../libx264.a(common.o):common.c:(.text+0xd)                                             : undefined reference to `mcount'
c:/x264/trunk/vfw/build/cygwin/../../../libx264.a(common.o):common.c:(.text+0x36                                             c): undefined reference to `mcount'
c:/x264/trunk/vfw/build/cygwin/../../../libx264.a(common.o):common.c:(.text+0x3b                                             e): undefined reference to `mcount'
c:/x264/trunk/vfw/build/cygwin/../../../libx264.a(common.o):common.c:(.text+0x44                                             c): undefined reference to `mcount'
c:/x264/trunk/vfw/build/cygwin/../../../libx264.a(common.o):common.c:(.text+0x4e                                             c): undefined reference to `mcount'
c:/x264/trunk/vfw/build/cygwin/../../../libx264.a(common.o):common.c:(.text+0x58                                             d): more undefined references to `mcount' follow
collect2: ld returned 1 exit status
make[1]: *** [x264vfw.dll] Error 1
make[1]: Leaving directory `/c/x264/trunk/vfw/build/cygwin'
make: *** [x264vfw.dll] Error 2
The compilation of the cli work well but when I try to use it I have this problem:
Code:
avis [error]: unsupported input format (DIB )
Any idea about the problem would be welcome.
I use the command line:
/configure --enable-avis-input --enable-mp4-output --extra-cflags="-Ic:/gpac/include" --extra-ldflags="-Lc:/gpac/bin/gcc"
thetrueavatar

Last edited by thetrueavatar; 17th October 2005 at 21:15.
thetrueavatar is offline   Reply With Quote
Old 17th October 2005, 23:05   #170  |  Link
hpn
Registered User
 
Join Date: Jan 2005
Posts: 191
Quote:
Originally Posted by thetrueavatar
I use the command line:
/configure --enable-avis-input --enable-mp4-output --extra-cflags="-Ic:/gpac/include" --extra-ldflags="-Lc:/gpac/bin/gcc"
thetrueavatar
I don't see "--enable-vfw" in your configure line, so try to add it like this:
configure --enable-vfw --enable-avis-input --enable-mp4-output --extra-cflags="-Ic:/gpac/include" --extra-ldflags="-Lc:/gpac/bin/gcc"

Also make sure you strictly follow all 24 steps I posted above and everything should compile fine.

Last edited by hpn; 17th October 2005 at 23:07.
hpn is offline   Reply With Quote
Old 18th October 2005, 03:27   #171  |  Link
leowai
Registered User
 
Join Date: May 2005
Posts: 184
@thetrueavatar,
For the client error, you need to install AVISynth (v2.5.5, v2.5.6 beta is not recommended). Read the help to use it.

Feed your video input to a avi script file (*.avs) and convert the colorspace to yv12 with following command in the script:
Code:
converttoyv12()

Last edited by leowai; 18th October 2005 at 04:52.
leowai is offline   Reply With Quote
Old 18th October 2005, 03:45   #172  |  Link
Sharktooth
Mr. Sandman
 
Sharktooth's Avatar
 
Join Date: Sep 2003
Location: Haddonfield, IL
Posts: 11,768
the makefiles in the subfolder may be outdated.
use the makefile in the x264 root folder.
Sharktooth is offline   Reply With Quote
Old 18th October 2005, 21:50   #173  |  Link
thetrueavatar
Registered User
 
Join Date: Sep 2004
Posts: 29
I have the right version of avisynth. Moreover I use all2x264 to encode and this one works fine with your build sharktooth but not with mine...
For the makefile, I use the one in the root but I don't know why for the vfw It use the cygwin makefile
thetrueavatar is offline   Reply With Quote
Old 19th October 2005, 13:35   #174  |  Link
Sharktooth
Mr. Sandman
 
Sharktooth's Avatar
 
Join Date: Sep 2003
Location: Haddonfield, IL
Posts: 11,768
have you added --enable-vfw in the configure lina as suggested by hpn?
Sharktooth is offline   Reply With Quote
Old 20th October 2005, 14:15   #175  |  Link
thetrueavatar
Registered User
 
Join Date: Sep 2004
Posts: 29
For the vfw now it's ok. I don't understand why that didn't work before but it's ok now.
However I still have my problem whith the cli. I had already install mingwin so I didn't follow all the step(only the last one.). I will try to follow step by step your guide and will reinstall everything
thetrueavatar is offline   Reply With Quote
Old 20th October 2005, 14:45   #176  |  Link
Sharktooth
Mr. Sandman
 
Sharktooth's Avatar
 
Join Date: Sep 2003
Location: Haddonfield, IL
Posts: 11,768
The problem with the cli is most likely an unsupported colorspace and not a build problem.
Sharktooth is offline   Reply With Quote
Old 22nd October 2005, 08:00   #177  |  Link
el divx
"el" as in Hellas
 
el divx's Avatar
 
Join Date: Jun 2003
Location: Greece
Posts: 71
Quote:
Originally Posted by Sharktooth
the makefiles in the subfolder may be outdated.
use the makefile in the x264 root folder.
In the mailing list akupenguin wrote that the /x264/build/cygwin makefile was obsolete and that he would mark it for deletion.
__________________
Divx Forums Nickname: DivxRulez | Greek Doom9 Forums Nickname: Dark Scizor | dvd.stuff.gr Forums Nickname: Dark Scizor
el divx is offline   Reply With Quote
Old 22nd October 2005, 21:40   #178  |  Link
thetrueavatar
Registered User
 
Join Date: Sep 2004
Posts: 29
I have tried to compile x264 on another computer(and I follow all the steps this time!)and now it seems to works. Just a last question: is it normal that my own build weigh only 713kb while sharktooth's build is 940kb???
I know that there are some patch applied to this build but I suppose that this is not the only reason for such a difference
thetrueavatar is offline   Reply With Quote
Old 23rd October 2005, 03:26   #179  |  Link
Sharktooth
Mr. Sandman
 
Sharktooth's Avatar
 
Join Date: Sep 2003
Location: Haddonfield, IL
Posts: 11,768
The reason is i added some optimizations to both GPAC and x264.

EDIT: And i also use gcc 4.0.2 which, when using optimizations, produces larger binaries. But maybe i will switch back to gcc 3.4.4.

Last edited by Sharktooth; 23rd October 2005 at 04:17.
Sharktooth is offline   Reply With Quote
Old 31st October 2005, 11:56   #180  |  Link
max-holz
Registered User
 
Join Date: Mar 2005
Posts: 173
Ehm. I follow this step:

step 2. To download the x264 source, create an empty folder on your hard drive like this c:\x264\ . Right-click on this folder and select "SVN checkout" from the menu. Then in the field named "URL of repository:" type "svn://svn.videolan.org/x264/trunk" (without the quotes) and click OK. Wait a few second until downloading is finished. Now the latest x264 source code is in the folder.

but I always got the same message: the host is unreachable
max-holz is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 19:43.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.