Author Topic: Compiling x264 on 32 & 64 Bit Windows - Guide.  (Read 157698 times)

Offline koliva

  • Member
  • Posts: 9
    • View Profile
Re: Compiling x264 on 32 & 64 Bit Windows - Guide.
« Reply #210 on: February 11, 2013, 05:47:08 AM »
Is there anybody who could compile the x264 on MSVC?

Offline BugMaster

  • Member
  • Posts: 80
    • View Profile
Re: Compiling x264 on 32 & 64 Bit Windows - Guide.
« Reply #211 on: February 11, 2013, 11:55:07 AM »
Is there anybody who could compile the x264 on MSVC?
x264 can't be compiled by MSVC itself because it doesn't support C99 standard which x264 use. Also x264 doesn't have project files for MSVS IDE. On Windows you can compile x264 with Cygwin or MinGW+msys or Intel C Compiler+MSVS+msys.

Offline koliva

  • Member
  • Posts: 9
    • View Profile
Re: Compiling x264 on 32 & 64 Bit Windows - Guide.
« Reply #212 on: February 12, 2013, 01:32:52 AM »
x264 can't be compiled by MSVC itself because it doesn't support C99 standard which x264 use. Also x264 doesn't have project files for MSVS IDE. On Windows you can compile x264 with Cygwin or MinGW+msys or Intel C Compiler+MSVS+msys.

Then how come direct264 was able to compile the x264 under MSVS? I suppose they didn't change the x264 so that it supports C99?

Offline BugMaster

  • Member
  • Posts: 80
    • View Profile
Re: Compiling x264 on 32 & 64 Bit Windows - Guide.
« Reply #213 on: February 12, 2013, 09:36:17 AM »
Then how come direct264 was able to compile the x264 under MSVS? I suppose they didn't change the x264 so that it supports C99?
That is exactly what they did. direct264 use its own forked version (currently not up to date) of libx264 with rewritten parts of C99 to C89.

Offline Bugi

  • Member
  • Posts: 12
    • View Profile
Re: Compiling x264 on 32 & 64 Bit Windows - Guide.
« Reply #214 on: February 15, 2013, 03:52:09 AM »
I've been doing some trial and errors in learning how to compile 'better'; this is something I really want to learn, but there does not seem to be a good starting point to learn this stuff. I've been searching and reading for a month now, but I'm not really getting somewhere.

At this point I have some basic questions which I have not been able to find an answer to:

1. What does this "PATH" actually mean? I know I can add things to it, whatever it is, by executing
Code: [Select]
export PATH="$PATH:/c/xxxx/bin"(1b) And can I execute this command several times to add more than one folder? (1c) Does it replace the PATH as it was before executing the command?

2. Komisar, am I right in concluding that the two folders named 'i686-w64-mingw32' and 'x86_64-w64-mingw32' are the folders that are used according to the --host config? [I.e. that if I specify --host=x86_64-w64-mingw32 it loads the ilbs/includes in that corresponding folder]

3. If so, what I don't get, is that it does not matter whether I specify
Code: [Select]
--host=x86_64-w64-mingw32 or
Code: [Select]
--host=x86_64-pc-mingw32: both end up configuring for x64 without any error messages.

4. Komisar, with your lastest toolchain and libpack extracted to C:\MinGW, the libs (GPAC, FFMS) get picked up if doing a simple ./configure, which leads to a x86 build. When specifying the host as x64 as noted in point 4 (either variant!), the libs are not recognised/loaded. I still do not understand how I can make them recognised.

5. Which compiler flags can I use to maximise runtime performance of my executable? I'm currently configuring with the following switches:
Code: [Select]
--host=x86_64-w64-mingw32 --extra-cflags="-march=native -O4 -ffast-math -flto" --enable-static --enable-stripand of course profiling the build. I'm using only medium or slow presets in x264, so Graphite does not benefit my purposes.

6. Does x264 or any of its dependencies (pthread, gpac, etc.) benefit from building with Intel's Compiler - ICL13? Or is GCC preferred/faster?

7. What is the difference between or function of the include folder and the lib folder?

8. Or in general: does anyone have a good starting point for me to learn how to build my own tool chain and stuff? My ultimate learning goal is to compile every/most dependency of x264 myself.

I hope (some of) my questions can easily be answered. Thanks for your patience!

[Post Scriptum]
For reference, these are the steps I take in building:
1. Use the msys installer to install the msys base system to C:/MinGW
2. Extract the contents of the single root folder in the archive multilib toolchain into C:/MinGW
3. Extract contents of the single root folder in the archive libpack into C:/MinGW
4. Download the latest yasm32, rename it to yasm.exe and put it in C:/MinGW/bin
5. run msyspostinstall batch file and point it to C:/MinGW
6. Download Git Portable and extract it to C:/gitportable
7. Start msys prompt and add this Git to the path by the export PATH command (other option: start msys bash from within a Git-cmd prompt)
8. navigate to /c and run the git clone command
9. enter x264 folder and run the above ./config command with the x64 --host setting

[EDIT]
Apparently the libs in the libpack are not compatible ( "(...) skipping incompatible (...)" ) with something, and some libs are missing from the pack:
Code: [Select]
checking for -S... yes
checking whether windres works... yes
x264 configure script
Command line options: "--host=x86_64-w64-mingw32" "--extra-cflags=-march=native" "-O4" "-ffast-math" "-flto" "--enable-static" "--enable-strip"

checking whether gcc works... yes
checking whether gcc supports for( int i = 0; i < 9; i++ ); with -std=gnu99... yes
checking whether yasm supports vpmovzxwd ymm0, xmm0... yes
checking whether gcc supports __asm__("pabsw %xmm0, %xmm0");... yes
checking for pthread_create(0,0,0,0); in pthread.h... yes
checking for return log2f(2); in math.h... yes
checking for sws_init_context(0,0,0); in libswscale/swscale.h... no
Failed commandline was:
--------------------------------------------------
gcc conftest.c -m64  -Wall -I. -I$(SRCPATH) -march=native -O4 -ffast-math -flto -std=gnu99  -lswscale -lavutil  -m64   -lpthread -o conftest
c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/bin/ld.exe: skipping incompatible c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/lib/libswscale.a when searching for -lswscale
c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/bin/ld.exe: skipping incompatible c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/lib\libswscale.a when searching for -lswscale
c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/bin/ld.exe: skipping incompatible c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/lib/libswscale.a when searching for -lswscale
c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lswscale
c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/bin/ld.exe: skipping incompatible c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/lib/libavutil.a when searching for -lavutil
c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/bin/ld.exe: skipping incompatible c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/lib\libavutil.a when searching for -lavutil
c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/bin/ld.exe: skipping incompatible c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/lib/libavutil.a when searching for -lavutil
c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lavutil
collect2.exe: error: ld returned 1 exit status
--------------------------------------------------
Failed program was:
--------------------------------------------------
#include <libswscale/swscale.h>
int main () { sws_init_context(0,0,0); return 0; }
--------------------------------------------------
checking for -lpostproc... no
Failed commandline was:
--------------------------------------------------
gcc conftest.c -m64  -Wall -I. -I$(SRCPATH) -march=native -O4 -ffast-math -flto -std=gnu99 -lpostproc  -m64   -lpthread -o conftest
c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/bin/ld.exe: skipping incompatible c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/lib/libpostproc.a when searching for -lpostproc
c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/bin/ld.exe: skipping incompatible c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/lib\libpostproc.a when searching for -lpostproc
c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/bin/ld.exe: skipping incompatible c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/lib/libpostproc.a when searching for -lpostproc
c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lpostproc
collect2.exe: error: ld returned 1 exit status
--------------------------------------------------
Failed program was:
--------------------------------------------------
int main () {  return 0; }
--------------------------------------------------
checking for -lavcodec... no
Failed commandline was:
--------------------------------------------------
gcc conftest.c -m64  -Wall -I. -I$(SRCPATH) -march=native -O4 -ffast-math -flto -std=gnu99 -lavcodec  -m64   -lpthread -o conftest
c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/bin/ld.exe: skipping incompatible c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/lib/libavcodec.a when searching for -lavcodec
c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/bin/ld.exe: skipping incompatible c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/lib\libavcodec.a when searching for -lavcodec
c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/bin/ld.exe: skipping incompatible c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/lib/libavcodec.a when searching for -lavcodec
c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lavcodec
collect2.exe: error: ld returned 1 exit status
--------------------------------------------------
Failed program was:
--------------------------------------------------
int main () {  return 0; }
--------------------------------------------------
checking for -lavcore... no
Failed commandline was:
--------------------------------------------------
gcc conftest.c -m64  -Wall -I. -I$(SRCPATH) -march=native -O4 -ffast-math -flto -std=gnu99 -lavcore  -m64   -lpthread -o conftest
c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lavcore
collect2.exe: error: ld returned 1 exit status
--------------------------------------------------
Failed program was:
--------------------------------------------------
int main () {  return 0; }
--------------------------------------------------
checking for -lswscale... no
Failed commandline was:
--------------------------------------------------
gcc conftest.c -m64  -Wall -I. -I$(SRCPATH) -march=native -O4 -ffast-math -flto -std=gnu99 -lswscale  -m64   -lpthread -o conftest
c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/bin/ld.exe: skipping incompatible c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/lib/libswscale.a when searching for -lswscale
c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/bin/ld.exe: skipping incompatible c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/lib\libswscale.a when searching for -lswscale
c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/bin/ld.exe: skipping incompatible c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/lib/libswscale.a when searching for -lswscale
c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lswscale
collect2.exe: error: ld returned 1 exit status
--------------------------------------------------
Failed program was:
--------------------------------------------------
int main () {  return 0; }
--------------------------------------------------
checking for -lavutil... no
Failed commandline was:
--------------------------------------------------
gcc conftest.c -m64  -Wall -I. -I$(SRCPATH) -march=native -O4 -ffast-math -flto -std=gnu99 -lavutil  -m64   -lpthread -o conftest
c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/bin/ld.exe: skipping incompatible c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/lib/libavutil.a when searching for -lavutil
c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/bin/ld.exe: skipping incompatible c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/lib\libavutil.a when searching for -lavutil
c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/bin/ld.exe: skipping incompatible c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/lib/libavutil.a when searching for -lavutil
c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lavutil
collect2.exe: error: ld returned 1 exit status
--------------------------------------------------
Failed program was:
--------------------------------------------------
int main () {  return 0; }
--------------------------------------------------
checking for -lm... yes
checking for -lz... yes
checking for -lbz2... yes
checking for -lpthread... yes
checking for -lavifil32... yes
checking for avformat_close_input(0); in libavformat/avformat.h... no
Failed commandline was:
--------------------------------------------------
gcc conftest.c -m64  -Wall -I. -I$(SRCPATH) -march=native -O4 -ffast-math -flto -std=gnu99  -L. -lavformat -lm -lz -lbz2 -lpthread -lavifil32  -m64   -lpthread -o conftest
c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/bin/ld.exe: skipping incompatible c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/lib/libavformat.a when searching for -lavformat
c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/bin/ld.exe: skipping incompatible c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/lib\libavformat.a when searching for -lavformat
c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/bin/ld.exe: skipping incompatible c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/lib/libavformat.a when searching for -lavformat
c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lavformat
collect2.exe: error: ld returned 1 exit status
--------------------------------------------------
Failed program was:
--------------------------------------------------
#include <libavformat/avformat.h>
int main () { avformat_close_input(0); return 0; }
--------------------------------------------------
checking for FFMS_DestroyVideoSource(0); in ffms.h... no
Failed commandline was:
--------------------------------------------------
gcc conftest.c -m64  -Wall -I. -I$(SRCPATH) -march=native -O4 -ffast-math -flto -std=gnu99  -lffms2  -m64   -lpthread -o conftest
c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/bin/ld.exe: skipping incompatible c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/lib/libffms2.a when searching for -lffms2
c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/bin/ld.exe: skipping incompatible c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/lib\libffms2.a when searching for -lffms2
c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/bin/ld.exe: skipping incompatible c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/lib/libffms2.a when searching for -lffms2
c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lffms2
collect2.exe: error: ld returned 1 exit status
--------------------------------------------------
Failed program was:
--------------------------------------------------
#include <ffms.h>
int main () { FFMS_DestroyVideoSource(0); return 0; }
--------------------------------------------------
checking for FFMS_DestroyVideoSource(0); in ffms.h... no
Failed commandline was:
--------------------------------------------------
gcc conftest.c -m64  -Wall -I. -I$(SRCPATH) -march=native -O4 -ffast-math -flto -std=gnu99  -lffms2 -lstdc++ -L. -lavformat -lm -lz -lbz2 -lpthread -lavifil32  -m64   -lpthread -o conftest
c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/bin/ld.exe: skipping incompatible c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/lib/libffms2.a when searching for -lffms2
c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/bin/ld.exe: skipping incompatible c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/lib\libffms2.a when searching for -lffms2
c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/bin/ld.exe: skipping incompatible c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/lib/libffms2.a when searching for -lffms2
c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lffms2
c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/bin/ld.exe: skipping incompatible c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/lib/libavformat.a when searching for -lavformat
c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/bin/ld.exe: skipping incompatible c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/lib\libavformat.a when searching for -lavformat
c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/bin/ld.exe: skipping incompatible c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/lib/libavformat.a when searching for -lavformat
c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lavformat
collect2.exe: error: ld returned 1 exit status
--------------------------------------------------
Failed program was:
--------------------------------------------------
#include <ffms.h>
int main () { FFMS_DestroyVideoSource(0); return 0; }
--------------------------------------------------
checking for -lz... yes
checking for gpac/isomedia.h... no
Failed commandline was:
--------------------------------------------------
gcc conftest.c -m64  -Wall -I. -I$(SRCPATH) -march=native -O4 -ffast-math -flto -std=gnu99 -lgpac_static -lz -lwinmm  -m64   -lpthread -o conftest
c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/bin/ld.exe: skipping incompatible c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/lib/libgpac_static.a when searching for -lgpac_static
c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/bin/ld.exe: skipping incompatible c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/lib\libgpac_static.a when searching for -lgpac_static
c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/bin/ld.exe: skipping incompatible c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/lib/libgpac_static.a when searching for -lgpac_static
c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lgpac_static
collect2.exe: error: ld returned 1 exit status
--------------------------------------------------
Failed program was:
--------------------------------------------------
#include <gpac/isomedia.h>
int main () {  return 0; }
--------------------------------------------------
checking for uint32_t test_vec __attribute__ ((vector_size (16))) = {0,1,2,3}; in stdint.h... yes
checking for -fno-tree-vectorize... yes
checking for fseeko(stdin,0,0); in stdio.h... yes
checking for -Wshadow... yes

platform:      X86_64
system:        WINDOWS
cli:           yes
libx264:       internal
shared:        no
static:        yes
asm:           yes
interlaced:    yes
avs:           yes
lavf:          no
ffms:          no
gpac:          no
gpl:           yes
thread:        posix
filters:       crop select_every
debug:         no
gprof:         no
strip:         yes
PIC:           no
visualize:     no
bit depth:     8
chroma format: all

I've solved this issue by copying and overwriting the contents of x86_64-w64 into i686-w64. All libs are now found.
« Last Edit: February 16, 2013, 06:28:01 AM by Bugi »

Offline jpsdr

  • Member
  • Posts: 6
    • View Profile
Re: Compiling x264 on 32 & 64 Bit Windows - Guide.
« Reply #215 on: May 16, 2013, 11:53:11 PM »
According here : https://github.com/DarkShikari/x264-devel/commit/9f65fe86e6297f83568786bbc81cfe56591f13e1
The yasm version required is at least 1.2.0, but in the 1rst post, the link provided is 1.0.1.
I think this should be updated.
New commit have been pushed since a long time, shouldn't the link be updated ?

Offline b4ne

  • Member
  • Posts: 3
    • View Profile
Re: Compiling x264 on 32 & 64 Bit Windows - Guide.
« Reply #216 on: July 12, 2013, 10:55:29 PM »
Need help compiling 64 bit with FFMS

I have think I have read through every page and more, been at it for many hours trying to get this to work.

- gcc ver - 4.8.0 and 4.7.3 (same results)
- komisar's libpack-gcc47x
- x264-snapshot-20130712-2245-stable.tar.bz2

merged libpack to mingw directory

and ran with (as posted in the op)
Code: [Select]
./configure --cross-prefix=x86_64-w64-mingw32- --host=x86_64-pc-mingw32

and would get error of no command string, or something.... then removed the "-" after mingw32 and would get error of no c compiler.

removed --cross-prefix all together and would compile and would compile being x86_64, but no ffms. so...this is what I am doing now, and don't really know where to go from here...

Code: [Select]
./configure --enable-static --enable-strip --bit-depth=10 --host=x86_64-w64-mingw32 --prefix=/mingw/x86_64-w64-mingw32 --extra-cflags="-I/mingw/x86_64-w64-mingw32/include" --extra-ldflags="-L/mingw/x86_64-w64-mingw32/lib"
and this is the result

Code: [Select]
fatal: Not a git repository (or any of the parent directories): .git
platform:      X86_64
system:        WINDOWS
cli:           yes
libx264:       internal
shared:        no
static:        yes
asm:           yes
interlaced:    yes
avs:           avisynth
lavf:          yes
ffms:          no
gpac:          yes
gpl:           yes
thread:        posix
opencl:        no
filters:       resize crop select_every
debug:         no
gprof:         no
strip:         yes
PIC:           no
visualize:     no
bit depth:     10
chroma format: all

You can run 'make' or 'make fprofiled' now.




Here is my log file - config.log

I see alot of stuff about ffms/ffms2 but have no idea what I am looking at

Any help is appreciated.

Offline komisar

  • Member
  • Posts: 29
    • View Profile
    • My x264 CLI/VFW builds and tools
Re: Compiling x264 on 32 & 64 Bit Windows - Guide.
« Reply #217 on: July 14, 2013, 03:35:06 AM »
b4ne
Unpack http://komisar.gin.by/mingw/libpack-gcc47x-20130714.7z to you $HOME
Use:
Code: [Select]
configure --host=x86_64-w64-mingw32 --enable-static --enable-strip --bit-depth=10 --extra-cflags="-I${HOME}/libpack-gcc47x-20130714/x86_64-w64-mingw32/include" --extra-ldflags="-L${HOME}/libpack-gcc47x-20130714/x86_64-w64-mingw32/lib"
P.S. whose toolchain you use?
« Last Edit: July 14, 2013, 03:40:49 AM by komisar »

Offline b4ne

  • Member
  • Posts: 3
    • View Profile
Re: Compiling x264 on 32 & 64 Bit Windows - Guide.
« Reply #218 on: July 14, 2013, 08:55:26 AM »
b4ne
Unpack http://komisar.gin.by/mingw/libpack-gcc47x-20130714.7z to you $HOME
Use:
Code: [Select]
configure --host=x86_64-w64-mingw32 --enable-static --enable-strip --bit-depth=10 --extra-cflags="-I${HOME}/libpack-gcc47x-20130714/x86_64-w64-mingw32/include" --extra-ldflags="-L${HOME}/libpack-gcc47x-20130714/x86_64-w64-mingw32/lib"
P.S. whose toolchain you use?

komisar, thanks for the reply but unfortunately same results. *Edit - actually i just realized you linked a different libpack - i will try again shortly with the above pack

for the toolchain...i am using the following...

mingw: x64-4.8.0-release-posix-seh-rev2.7z or x64-4.7.3-release-posix-sjlj-rev1.7z

though now looking I think there is a 4.8.1 release...don't know if that will make a difference

and

MSYS: msys+7za+wget+svn+git+mercurial+cvs-rev13.7z (I think I may have an earlier revision)
« Last Edit: July 14, 2013, 10:36:07 AM by b4ne »

Offline komisar

  • Member
  • Posts: 29
    • View Profile
    • My x264 CLI/VFW builds and tools
Re: Compiling x264 on 32 & 64 Bit Windows - Guide.
« Reply #219 on: July 14, 2013, 11:09:23 AM »
for the toolchain...i am using the following...
try http://komisar.gin.by/mingw/mingw-w64.gcc473.ml.20130412.7z or compile youself ffmpeg/ffms2/gpac with you toolchain

Offline b4ne

  • Member
  • Posts: 3
    • View Profile
Re: Compiling x264 on 32 & 64 Bit Windows - Guide.
« Reply #220 on: July 14, 2013, 12:01:45 PM »
try http://komisar.gin.by/mingw/mingw-w64.gcc473.ml.20130412.7z or compile youself ffmpeg/ffms2/gpac with you toolchain

Replacing the toolchain did it, thanks ! :D

I had thought of and had tried to compile ffmpeg/ffms2/gpac - ffmpeg would go fine, but ffms would fail.

Thanks again

Offline d4rk1

  • Member
  • Posts: 1
    • View Profile
Re: Compiling x264 on 32 & 64 Bit Windows - Guide.
« Reply #221 on: September 23, 2013, 07:09:44 PM »
Hi,

I've just compiled x264 and got 1-2 questions:

Somehow my vanilla builds are compared to @komisar 's builds [vanilla] ~5-10%
slower. (Only tested on x64)

I'm using his Toolchain / Libpack, msys from MinGW-Builds + yasm-1.2.0-win64.
With additional flags like:

Code: [Select]
./configure --host=x86_64-w64-mingw32 --enable-static --enable-shared --enable-strip --extra-cflags="-I${HOME}/Libs/include -march=native -Ofast -fgraphite-identity -floop-parallelize-all -ftree-loop-distribution -fivopts" --extra-ldflags="-L${HOME}/Libs/lib -lm"
I got ~3-5%, but I'm still much slower.
So what did I do wrong? :o

And can propably somone tell me how to build ffmpeg/gpac/ffms myself?

And my last question:
Is there a way to use lto/fprofile-generate/-use with x264_x64?

Offline jpsdr

  • Member
  • Posts: 6
    • View Profile
Re: Compiling x264 on 32 & 64 Bit Windows - Guide.
« Reply #222 on: September 24, 2013, 11:58:48 PM »
Can this be explained by a fprofiled compile ?

Offline houwenbin

  • Member
  • Posts: 1
    • View Profile
Re: Compiling x264 on 32 & 64 Bit Windows - Guide.
« Reply #223 on: September 29, 2013, 07:48:56 PM »
What's the guide for VS2005/VS2008?