View Full Version : x264 compilation
Pages :
1
2
3
[
4]
5
6
7
8
9
10
11
Sharktooth
25th September 2005, 19:41
compiling gpac 0.4.x with gcc is still problematic. i gave up... i only make the lib.
celtic_druid
26th September 2005, 03:48
I was able to compile most of it last time I tried. Just a problem with a few plugins from recollection. I find it easier just to use MSVC though.
leowai
26th September 2005, 06:45
compiling gpac 0.4.x with gcc is still problematic. i gave up... i only make the lib.
gpac static Lib should be enough to do the job for x264 with mp4 output support.
However, l would like to share my way to compile gpac succesfully to Sharktooth or others fail to compile gpac project. There is NO guarantee of success but that's how it works on my platform and it should work on yours (I think)!. And I hope you guys don't mind it's slightly off topic here. :D
DirectX dx_hw.dll is used to be the last module I can't compile successfully (before gpac CVS 23rd Sep 2005, see end of the thread for latest gpac CVS). It seems like it can detect DirectX in my MinGW but can't find the DirectX libraries correctly when compiling the DirectX sources. Therefore, I make following patch to force predefined DirectX lib and include folder to be used for the compilation.
Index: configure
===================================================================
RCS file: /cvsroot/gpac/gpac/configure,v
retrieving revision 1.9
diff -u -r1.9 configure
--- configure 23 Sep 2005 12:23:43 -0000 1.9
+++ configure 26 Sep 2005 04:18:22 -0000
@@ -703,6 +703,8 @@
if $cc -o $TMPO $TMPC 2> /dev/null ; then
has_mingw_directx="yes"
+dx_include="$dxsdk_path/include"
+dx_lib="$dxsdk_path/lib"
else
dx_include="$dxsdk_path/include"
dx_lib="$dxsdk_path/lib"
Following configuration settings are used:
./configure --cc=gcc --dxsdk-path=c:/MinGW --disable-amr-nb-fixed --disable-amr-nb --disable-amr-wb --disable-amr --disable-debug --disable-oss-audio --disable-opengl --disable-ssl --use-js=no --use-ft=no --use-jpeg=no --use-png=no --use-faad=no --use-mad=no --use-xvid=no --use-ffmpeg=no
I just found some problem for me to compile latest gpac CVS (says 26th Sep 2005). I don't remember I installed any WXWIDGETS under MinGW but the configure script says it is detected! Anyone experience the same thing here? :confused: :confused: Compilation fails with no doubt. This is the additional patch I used to disable the compilation of "osmo4_wx" application.
Index: applications/Makefile
===================================================================
RCS file: /cvsroot/gpac/gpac/applications/Makefile,v
retrieving revision 1.3
diff -u -r1.3 Makefile
--- applications/Makefile 31 Aug 2005 16:19:45 -0000 1.3
+++ applications/Makefile 26 Sep 2005 05:06:18 -0000
@@ -10,11 +10,11 @@
V4STUDIODIR=
INSTDIRS=mp4client osmozilla
-ifeq ($(USE_WXWIDGETS), yes)
-APPDIRS+=osmo4_wx
-V4STUDIODIR=V4Studio
-INSTDIRS+=osmo4_wx
-endif
+#ifeq ($(USE_WXWIDGETS), yes)
+#APPDIRS+=osmo4_wx
+#V4STUDIODIR=V4Studio
+#INSTDIRS+=osmo4_wx
+#endif
ALLDIRS=$(APPDIRS)
Hope these information helps.
celtic_druid
26th September 2005, 07:23
Well without Osmo4 do you need any of the plugins? You could just run make apps or whatever it is.
leowai
26th September 2005, 08:30
Well without Osmo4 do you need any of the plugins? You could just run make apps or whatever it is.
True...
So for the settings above, I will only need compile certain part of gpac project rather than all (lib, apps & mods).
i.e.
./configure && make lib && make apps
* use "make apps" is to get "MP4Box.exe" compiled.
Sharktooth
26th September 2005, 12:46
thanks for the info but i think i'll stick to the lib compilation. if i need the other stuff i'll just fire up visual studio and build the rest...
Kurtnoise
10th October 2005, 16:21
I think there is a missing header file in the last x264 revision (afxres.h to build the vfw version), right ? I've got an error message when I made a compile with vfw enabling.
celtic_druid
10th October 2005, 17:13
http://forum.doom9.org/showthread.php?p=715033&highlight=afxres.h#post715033
Kurtnoise
10th October 2005, 18:07
mmh...I've the last minGW build and "make clean" doesn't resolve the problem for me. So, I replaced afxres.h by winres.h and it works fine now.
bob0r
10th October 2005, 18:17
http://www.mingw.org
http://www.mingw.org/download.shtml
w32api-3.3.tar.gz
http://prdownloads.sourceforge.net/mingw/w32api-3.3.tar.gz?download
Copy/overwrite lib and include dir to mingw/
I had the same problem (Thank Sharktooth ;) )
P.S. do a clean SVN checkout....
hpn
13th October 2005, 14:56
@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/tortoisesvn/TortoiseSVN-1.2.4.4479-svn-1.2.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/mingw/MinGW-3.2.0-rc-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/nasm/nasm-0.98.39-win32.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/mingw/gcc-core-3.4.4-20050522-1.tar.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/mingw/binutils-2.16.91-20050827-1.tar.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/mingw/w32api-3.3.tar.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/mingw/MSYS-1.0.10.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
Sharktooth
13th October 2005, 15:00
make NDEBUG=1 is no longer necessary. just make.
step 14 and 18 are not necessary too.
bob0r
13th October 2005, 15:36
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/
leowai
13th October 2005, 16:06
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).
hellfred
13th October 2005, 21:29
I second Sharktooths suggestion to type make in x264 root directory (omitt step 14). The one in build/cygwin is most probably outdated
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:
cd vfw/build/cygwin/
make install
Hellfred
hpn
14th October 2005, 00:44
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/tortoisesvn/TortoiseSVN-1.3.4.6692-svn-1.3.2.msi
(check for new version: link (http://prdownloads.sourceforge.net/tortoisesvn))
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/mingw/MinGW-3.2.0-rc-3.exe
Execute the file and install MinGW to folder "C:\MinGW\"
(check for new version: link (http://prdownloads.sourceforge.net/mingw/?sort_by=name))
step 4. Download "mingw-runtime-3.9.tar.gz" from
http://prdownloads.sourceforge.net/mingw/mingw-runtime-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 (http://prdownloads.sourceforge.net/mingw/?sort_by=name))
step 5.
Download "w32api-3.7.tar.gz" from
http://prdownloads.sourceforge.net/mingw/w32api-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 (http://prdownloads.sourceforge.net/mingw/?sort_by=name))
step 6.
Download "nasm-0.98.39-win32.zip" from
http://prdownloads.sourceforge.net/nasm/nasm-0.98.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 (http://prdownloads.sourceforge.net/nasm/?sort_by=name))
step 7. Download "gcc-core-3.4.5-20060117-1.tar.gz" from
http://prdownloads.sourceforge.net/mingw/gcc-core-3.4.5-20060117-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 (http://prdownloads.sourceforge.net/mingw/?sort_by=name))
step 8.
Download "binutils-2.16.91-20060119-1.tar.gz" from
http://prdownloads.sourceforge.net/mingw/binutils-2.16.91-20060119-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 (http://prdownloads.sourceforge.net/mingw/?sort_by=name))
step 9. Download "zlib-1.2.3.exe" from
http://prdownloads.sourceforge.net/gnuwin32/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 (http://prdownloads.sourceforge.net/gnuwin32/?sort_by=name))
step 10. Download "MSYS-1.0.11-2004.04.30-1.exe" from
http://prdownloads.sourceforge.net/mingw/MSYS-1.0.11-2004.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 (http://prdownloads.sourceforge.net/mingw/?sort_by=name))
step 11. Download "msysDTK-1.0.1.exe" from
http://prdownloads.sourceforge.net/mingw/msysDTK-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 (http://mirror05.x264.nl/Sharktooth/?dir=./x264/patches) 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 (http://x264.nl) or celtic_druid (http://ffdshow.faireal.net/mirror/x264/)
JimiK
14th October 2005, 09:10
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
Sharktooth
14th October 2005, 11:25
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.
thetrueavatar
17th October 2005, 21:10
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
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:
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
hpn
17th October 2005, 23:05
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.
leowai
18th October 2005, 03:27
@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:
converttoyv12()
Sharktooth
18th October 2005, 03:45
the makefiles in the subfolder may be outdated.
use the makefile in the x264 root folder.
thetrueavatar
18th October 2005, 21:50
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
Sharktooth
19th October 2005, 13:35
have you added --enable-vfw in the configure lina as suggested by hpn?
thetrueavatar
20th October 2005, 14:15
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
Sharktooth
20th October 2005, 14:45
The problem with the cli is most likely an unsupported colorspace and not a build problem.
el divx
22nd October 2005, 08:00
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.
thetrueavatar
22nd October 2005, 21:40
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
Sharktooth
23rd October 2005, 03:26
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.
max-holz
31st October 2005, 11:56
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
hpn
31st October 2005, 14:53
I just tried and the server responds fine as usual. Make sure in your firewall program (if you're using any) you give TurtoiseSVN permission to access the Internet.
max-holz
31st October 2005, 15:11
I just tried and the server responds fine as usual. Make sure in your firewall program (if you're using any) you give TurtoiseSVN permission to access the Internet.
Yes the problem is my PeerGuardian.
max-holz
1st November 2005, 15:23
Thanks for the guide compilation works fine.
Now I have another question :) .
In which way I could set optimization for CPU and CPU's instruction?
es. P4, MMX, SSE2, SSE3
Sharktooth
1st November 2005, 15:48
search for the -march switch options in your gcc manual (or online manual)...
Audionut
2nd November 2005, 00:23
edit: silly mistake.
Sharktooth
2nd November 2005, 15:45
however the compiler optimizations wont give you a remarkable speed difference, since all the complex parts were already written in ASM.
Yong
4th November 2005, 10:39
Here's the error message i got when try to compile x264 with AQ patch... :(
$ make -s
./version.sh: svnversion: command not found
In file included from common/common.h:61,
from common/predict.c:35:
common/dct.h:82: error: redefinition of 'x264_dct8_weight_tab'
common/dct.h:34: error: previous definition of 'x264_dct8_weight_tab' was here
common/predict.c: In function `predict_4x4_vr':
common/predict.c:535: warning: unused variable `l3'
common/predict.c: In function `predict_4x4_hd':
common/predict.c:568: warning: unused variable `t3'
common/predict.c: In function `predict_4x4_vl':
common/predict.c:592: warning: unused variable `t7'
common/predict.c: In function `predict_8x8_vr':
common/predict.c:774: warning: unused variable `l7'
common/predict.c: In function `predict_8x8_hd':
common/predict.c:802: warning: unused variable `t7'
make: *** [common/predict.o] Error 1
EDIT: Just compiled with r360, same error message... :mad:
May be is my computer or gcc broken... :(
Has anyone hav this problem too?
Now failed to pacthing it with r362... :rolleyes:
(atleast the RD patch V3 is working ;) )
Sharktooth
4th November 2005, 15:28
download the updated AQ patch it works for rev360+.
hpn
6th November 2005, 16:03
Sharktooth (and the others), how do you apply both conflicting patches "x264_p8rd.5.diff" and "x264_brdo.3.diff" to revision 364?
I aplly:
patch < x264_p8rd.5.diff -p0
then
patch < x264_brdo.3.diff -p0
and I get 2 failed hunks:
patching file `x264.c'
Hunk #1 FAILED at 253.
Hunk #2 FAILED at 477.
Hunk #3 succeeded at 521 (offset 10 lines).
Hunk #4 succeeded at 735 (offset 2 lines).
2 out of 4 hunks FAILED -- saving rejects to x264.c.rej
Is there some tool or command to fix this (for example by changing the second diff so that it takes the changes made by the first diff into consideration) or I have to read the x264.c.rej and manually fix the source (which sounds like not a good idea)? I googled and found some info about a diff3 command (diff3 --help in the MinGW console), but have no idea if it can work in my case.
Sharktooth
6th November 2005, 16:04
http://forum.doom9.org/showthread.php?p=733273#post733273
hpn
6th November 2005, 16:15
I've already read that, but didn't like the "manual" part, that's why I'm asking hoping for a more elegant solution. Anyway, I'll do it manually. Thank you :)
Sharktooth
6th November 2005, 16:21
I can suggest a less elegant solution: merging the 2 patches (it still requires some "manual" work) and then applying the new patch to the sources.
hpn
6th November 2005, 23:33
After wasting some time today trying to figure out the best way to compile revision 364 with the current conflicting patches from the Sharktooth's page (http://forum.doom9.org/showthread.php?t=89979), I decided to post a short guide for total newbies like me about fixing conflicting diff files (feel free to correct me if you find errors). Such diff conflicts may occur when two or more developers make independent changes to a common original (Alex_W and pengvado in this particular case).
Example with revision 364 (the patches will change, but the same logic could be used for resolving similar diff conflicts in the future).
When applying the patches in the following order:
1. patch < x264_experimental_rd_pskip.0.diff -p0
2. patch < x264_aq.5.diff -p0
3. patch < x264_p8rd.6.diff -p0
4. patch < x264_brdo.3_fixed.diff -p0
You get 2 failed hunks:
patching file `x264.c'
Hunk #1 FAILED at 253.
Hunk #2 FAILED at 477.
Hunk #3 succeeded at 521 (offset 10 lines).
Hunk #4 succeeded at 735 (offset 2 lines).
2 out of 4 hunks FAILED -- saving rejects to x264.c.rej
"x264_aq.5.diff" is applying the following patch to "x264.c":
@@ -476,6 +484,8 @@
#define OPT_CHROMALOC 313
#define OPT_MIXED_REFS 314
#define OPT_CRF 315
+#define OPT_AQ_STRENGTH 316
+#define OPT_AQ_SENSITIVITY 317
static struct option long_options[] =
{
That's why "x264_brdo.3.diff" fails when trying to apply:
@@ -476,6 +477,7 @@
#define OPT_CHROMALOC 313
#define OPT_MIXED_REFS 314
#define OPT_CRF 315
+#define OPT_B_RDO 316
static struct option long_options[] =
{
So in "x264_brdo.3.diff" you have to manually replace the code above by:
@@ -476,6 +477,7 @@
#define OPT_CRF 315
#define OPT_AQ_STRENGTH 316
#define OPT_AQ_SENSITIVITY 317
+#define OPT_B_RDO 318
static struct option long_options[] =
{
As pointed out by Sharktooth in another thread 316 is already used by the AQ option (#define OPT_AQ_STRENGTH 316), so we must replace 316 by the first unused number - 318. (To edit the diff files don't use Notepad or WordPad, but some good code editor like this one (http://prdownloads.sourceforge.net/pnotepad/pn206.exe?download))
Plus:
x264_p8rd.6.diff is applying the following to "x264.c":
@@ -252,7 +252,7 @@
" - esa: exhaustive search (slow)\n"
" --merange <integer> Maximum motion vector search range [%d]\n"
" -m, --subme <integer> Subpixel motion estimation and partition\n"
- " decision quality: 1=fast, 6=best. [%d]\n"
+ " decision quality: 1=fast, 7=best. [%d]\n"
" --mixed-refs Decide references on a per partition basis\n"
" --no-chroma-me Ignore chroma in motion estimation\n"
" -8, --8x8dct Adaptive spatial transform size\n"
That's why "x264_brdo.3.diff" fails when trying to apply:
@@ -253,6 +253,7 @@
" --merange <integer> Maximum motion vector search range [%d]\n"
" -m, --subme <integer> Subpixel motion estimation and partition\n"
" decision quality: 1=fast, 6=best. [%d]\n"
+ " --b-rdo RD based mode decision for B-frames\n"
" --mixed-refs Decide references on a per partition basis\n"
" --no-chroma-me Ignore chroma in motion estimation\n"
" -8, --8x8dct Adaptive spatial transform size\n"
So to make the code in "x264_brdo.3.diff" works, just manually change "6=best" to "7=best" like this:
" --merange <integer> Maximum motion vector search range [%d]\n"
" -m, --subme <integer> Subpixel motion estimation and partition\n"
" decision quality: 1=fast, 7=best. [%d]\n"
+ " --b-rdo RD based mode decision for B-frames\n"
" --mixed-refs Decide references on a per partition basis\n"
" --no-chroma-me Ignore chroma in motion estimation\n"
" -8, --8x8dct Adaptive spatial transform size\n"
Now save the corrected "x264_brdo.3.diff" to something like "x264_brdo.3_fixed.diff" and apply it instead of the wrong one.
Instead of tweeking "x264_brdo.3.diff", an alternative way to fix the conflicts is first to apply all 4 patches (including the broken one) and after reading the MinGW console log about the failed hunks (Hunk #1 FAILED at 253 Hunk #2 FAILED at 477) and the rejects file (x264.c.rej) to manually add the failed hunks to the source, meaning adding 2 lines to the code directly to "x264.c" like this:
#define OPT_AQ_SENSITIVITY 317
+#define OPT_B_RDO 318
static struct option long_options[] =
.....
.....
" decision quality: 1=fast, 7=best. [%d]\n"
+ " --b-rdo RD based mode decision for B-frames\n"
" --mixed-refs Decide references on a per partition basis\n"
(Both lines are those with the leading +). This alternative way may seem easier, but IMHO is a worse solution, because instead of fixing the patch that causes the conflict you're trying to fix the SVN source ("x264.c" in this particular case) that has nothing to do with our problem, plus when building the next x264 revisions you'll have to fix the source again instead of just applying the already fixed "x264_brdo.3_fixed.diff" (if it's not already commited to the SVN).
And finally I want to repeat again that I'm a complete newbie (first time applying b0rked patches today) so the whole guide may be wrong (hopefully not :) )
bob0r
18th November 2005, 18:50
Small remark about gpac (needed for x264 .mp4 output)
Compiling fails after 2005-11-12 (x264 revision 367 was on that date and this worked)
The error:
gcc -O3 -fno-strict-aliasing -Wall -I/home/user/gpac/include -c -o encode_isom.o encode_isom.c
encode_isom.c:30:24: error: gpac/laser.h: No such file or directory
encode_isom.c: In function 'gf_sm_encode_scene':
encode_isom.c:381: error: 'GF_LASeRCodec' undeclared (first use in this function)
encode_isom.c:381: error: (Each undeclared identifier is reported only once
encode_isom.c:381: error: for each function it appears in.)
encode_isom.c:381: error: 'lsr_enc' undeclared (first use in this function)
encode_isom.c:579: warning: implicit declaration of function 'gf_odf_get_laser_config'
make[2]: *** [encode_isom.o] Error 1
make[2]: Leaving directory `/home/user/gpac/src/scene_manager'
make[1]: *** [libgpac.dll] Error 2
make[1]: Leaving directory `/home/user/gpac/src'
make: *** [lib] Error 2
Using gpac from 2005-11-12 does work.
Getting gpac from that date:
cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/gpac co -D 2005-11-12 gpac
Will update thread when gpac works again (or if someone else notices, please do the same)
el divx
19th November 2005, 07:41
Pulled today a fresh copy of GPAC from cvs, followed your instructions and it compiled without problems(GPAC, offcourse).
bob0r
19th November 2005, 12:54
@el divx and all:
Yup it works again :)
el divx
20th November 2005, 14:19
gcc -o x264.exe x264.o matroska.o libx264.a -lwinmm -lgpac_static -Lc:/gpac/bin/gcc -lvfw32 -s
c:/gpac/bin/gcc/libgpac_static.a(os_divers.o):os_divers.c:(.text+0x535): undefined reference to `timeBeginPeriod@4'
c:/gpac/bin/gcc/libgpac_static.a(os_divers.o):os_divers.c:(.text+0x6ca): undefined reference to `timeEndPeriod@4'
c:/gpac/bin/gcc/libgpac_static.a(os_divers.o):os_divers.c:(.text+0x4e5): undefined reference to `timeGetTime@0'
collect2: ld returned 1 exit status
make: *** [x264.exe] Error 1
I get this though when trying to build x264 with MP4 support.
el divx
6th December 2005, 19:20
In file included from encoder/set.c:38:
c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/config.h:48:24: gpac/tools.h: No such file or directory
In file included from encoder/set.c:38:
c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/config.h:89: error: syntax error before "gf_cfg_set_key"
c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/config.h:97: error: syntax error before "gf_cfg_get_section_count"
c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/config.h:106: error: syntax error before "u32"
c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/config.h:115: error: syntax error before "gf_cfg_get_key_count"
c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/config.h:125: error: syntax error before "u32"
c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/config.h:138: error: syntax error before "gf_cfg_insert_key"
c:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/config.h:138: error: syntax error before "u32"
encoder/set.c: In function `x264_sei_version_write':
encoder/set.c:464: error: `X264_VERSION' undeclared (first use in this function)
encoder/set.c:464: error: (Each undeclared identifier is reported only once
encoder/set.c:464: error: for each function it appears in.)
make: *** [encoder/set.o] Error 1
Got this after compiling rev.384 with mingw.
Sharktooth
6th December 2005, 20:01
you didnt compile gpac correctly.
unmei
7th December 2005, 15:50
in the build change for sharktooth's 384G it reads
Enabled Profiling for CLI (should help encoding speed).
How is that to be understood?
At first i thought it might mean that you get profiler output on the CLI so one might base settings descions on that (or help the devs find anomalies or whatever). But obviously it does not.
So my only guess left is, that it means the exe is compiled with profiler support - but that is completly contra-intuitive - why would "extra bloat" help the encoding speed?
/me is confused
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.