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 10th November 2008, 14:38   #1  |  Link
ramprasad85
Registered User
 
Join Date: Oct 2008
Location: Chennai India
Posts: 31
Compiling x264 on Fedora9 for windows

Hi
I am able to compile x264 for linux.
i wish to cross compile x264 for windows from linux.
I have installed mingw
the cross compiler is located at /usr/local/mingw/bin/i586-mingw32msvc-gcc
The script i used has:
CC=/usr/local/mingw/bin/i586-mingw32msvc-gcc \
./configure --host=i586-mingw32msvc --disable-pthread --disable-avis-input


the output is
Platform: X86
System: MINGW
avis input: no
mp4 output: no
pthread: no
gtk: no
debug: no
gprof: no
PIC: no
shared: no
visualize: no


then when i run "make"
i am getting this error


yasm -O2 -f win32 -DPREFIX -DHAVE_SSE3 -Icommon/i386/ -o common/i386/dct-a.o common/i386/dct-a.asm
strip:common/i386/dct-a.o: File format not recognized
make: [common/i386/dct-a.o] Error 1 (ignored)
yasm -O2 -f win32 -DPREFIX -DHAVE_SSE3 -Icommon/i386/ -o common/i386/cpu-a.o common/i386/cpu-a.asm
strip:common/i386/cpu-a.o: File format not recognized
make: [common/i386/cpu-a.o] Error 1 (ignored)
yasm -O2 -f win32 -DPREFIX -DHAVE_SSE3 -Icommon/i386/ -o common/i386/pixel-a.o common/i386/pixel-a.asm
strip:common/i386/pixel-a.o: File format not recognized
make: [common/i386/pixel-a.o] Error 1 (ignored)
yasm -O2 -f win32 -DPREFIX -DHAVE_SSE3 -Icommon/i386/ -o common/i386/mc-a.o common/i386/mc-a.asm
strip:common/i386/mc-a.o: File format not recognized
make: [common/i386/mc-a.o] Error 1 (ignored)
yasm -O2 -f win32 -DPREFIX -DHAVE_SSE3 -Icommon/i386/ -o common/i386/mc-a2.o common/i386/mc-a2.asm
strip:common/i386/mc-a2.o: File format not recognized
make: [common/i386/mc-a2.o] Error 1 (ignored)
yasm -O2 -f win32 -DPREFIX -DHAVE_SSE3 -Icommon/i386/ -o common/i386/predict-a.o common/i386/predict-a.asm
strip:common/i386/predict-a.o: File format not recognized
make: [common/i386/predict-a.o] Error 1 (ignored)
yasm -O2 -f win32 -DPREFIX -DHAVE_SSE3 -Icommon/i386/ -o common/i386/pixel-sse2.o common/i386/pixel-sse2.asm
strip:common/i386/pixel-sse2.o: File format not recognized
make: [common/i386/pixel-sse2.o] Error 1 (ignored)
yasm -O2 -f win32 -DPREFIX -DHAVE_SSE3 -Icommon/i386/ -o common/i386/quant-a.o common/i386/quant-a.asm
strip:common/i386/quant-a.o: File format not recognized
make: [common/i386/quant-a.o] Error 1 (ignored)
yasm -O2 -f win32 -DPREFIX -DHAVE_SSE3 -Icommon/i386/ -o common/i386/deblock-a.o common/i386/deblock-a.asm
strip:common/i386/deblock-a.o: File format not recognized
make: [common/i386/deblock-a.o] Error 1 (ignored)
ar rc libx264.a common/mc.o common/predict.o common/pixel.o common/macroblock.o common/frame.o common/dct.o common/cpu.o common/cabac.o common/common.o common/mdate.o common/csp.o common/set.o common/quant.o encoder/analyse.o encoder/me.o encoder/ratecontrol.o encoder/set.o encoder/macroblock.o encoder/cabac.o encoder/cavlc.o encoder/encoder.o encoder/eval.o common/i386/mc-c.o common/i386/predict-c.o common/i386/dct-a.o common/i386/cpu-a.o common/i386/pixel-a.o common/i386/mc-a.o common/i386/mc-a2.o common/i386/predict-a.o common/i386/pixel-sse2.o common/i386/quant-a.o common/i386/deblock-a.o
ranlib libx264.a
/usr/local/mingw/bin/i586-mingw32msvc-gcc -o x264.exe x264.o matroska.o muxers.o libx264.a -s
libx264.a: could not read symbols: Archive has no index; run ranlib to add one
make: *** [x264.exe] Error 1


i used nasm and got similar error.
I tried make AS=i586-mingw32msvc-as
but i says

i586-mingw32msvc-as -O2 -f elf -DHAVE_SSE3 -Icommon/i386/ -o common/i386/dct-a.o common/i386/dct-a.asm
i586-mingw32msvc-as: unrecognized option '-O2'
make: *** [common/i386/dct-a.o] Error 1


i also tried
make AS=i586-mingw32msvc-as ASFLAGS="-f win32"
i am getting
common/i386/dct-a.asm:710: Warning: rest of line ignored; first ignored character is ` '


where am i going wrong?
Thank you
ramprasad85 is offline   Reply With Quote
Old 10th November 2008, 17:04   #2  |  Link
Dark Shikari
x264 developer
 
Dark Shikari's Avatar
 
Join Date: Sep 2005
Posts: 8,666
Start by grabbing an x264 version that isn't a year or two old...
Dark Shikari is offline   Reply With Quote
Old 11th November 2008, 13:18   #3  |  Link
ramprasad85
Registered User
 
Join Date: Oct 2008
Location: Chennai India
Posts: 31
I am using the latest source code, downloaded using git
I could not locate much details at http://x264dev.multimedia.cx/
can u please direct me

when I used mingw's ar, ranlib, strip and gcc, i was able to compile the code. But the exe is not working on windows. it crashes without any error message. only the "submit error report" dialog box appears.

I was able to compile x246 on cygwin in windows. but when i run that exe, that exe also behaves in a similar manner.

please give the standard way to compile x264 on linux for windows
so that i can integrate it with VLC and use it on windows
Thank you
ramprasad85 is offline   Reply With Quote
Old 11th November 2008, 13:28   #4  |  Link
Dark Shikari
x264 developer
 
Dark Shikari's Avatar
 
Join Date: Sep 2005
Posts: 8,666
Quote:
Originally Posted by ramprasad85 View Post
I am using the latest source code, downloaded using git
No you aren't, the "i386" folder hasn't even existed for an entire year.
Dark Shikari is offline   Reply With Quote
Old 11th November 2008, 15:12   #5  |  Link
kemuri-_9
Compiling Encoder
 
kemuri-_9's Avatar
 
Join Date: Jan 2007
Posts: 1,348
Quote:
Originally Posted by Dark Shikari View Post
No you aren't, the "i386" folder hasn't even existed for an entire year.
it was renamed to x86 that long ago? wow....
__________________
custom x264 builds & patches | F@H | My Specs
kemuri-_9 is offline   Reply With Quote
Old 12th November 2008, 07:20   #6  |  Link
squid_80
Registered User
 
Join Date: Dec 2004
Location: Melbourne, AU
Posts: 1,963
Since March, actually. (I suspect DS is in the future and sends patches back in time.)
squid_80 is offline   Reply With Quote
Old 12th November 2008, 08:50   #7  |  Link
Dark Shikari
x264 developer
 
Dark Shikari's Avatar
 
Join Date: Sep 2005
Posts: 8,666
Quote:
Originally Posted by squid_80 View Post
Since March, actually. (I suspect DS is in the future and sends patches back in time.)
Bah, so 9 months. Close enough
Dark Shikari is offline   Reply With Quote
Old 12th November 2008, 15:09   #8  |  Link
ramprasad85
Registered User
 
Join Date: Oct 2008
Location: Chennai India
Posts: 31
latest x264 crashes while using MMX/SSE capabilities

I downloaded the source from ftp://ftp.videolan.org/pub/videolan/...1-2245.tar.bz2 and compiled it on FC9 using Mingw. On windows When i encode a file using x264.exe it crashes. If i manually remove the "-DHAVE_MMX" from the configure script and compile it, it works. Is there a fix

Last edited by ramprasad85; 12th November 2008 at 15:11.
ramprasad85 is offline   Reply With Quote
Old 12th November 2008, 15:20   #9  |  Link
kemuri-_9
Compiling Encoder
 
kemuri-_9's Avatar
 
Join Date: Jan 2007
Posts: 1,348
that means the ASM is broken,
thus why it crashes from the start when you try and execute.

so depending on what you were trying to build:
A. an x64 binrary
or
B. an x86 binary

the situation is as follows:
A. x264 does not have win x64 asm support, so you have to use the --disable-asm flag in the ./configure to get a compile that does not crash. And without asm, the x64 version is a complete turtle to x86 w/ asm.

B. cross-compiler failure. since it works fine on windows through the standard cygwin and msys/mingw methods.
__________________
custom x264 builds & patches | F@H | My Specs
kemuri-_9 is offline   Reply With Quote
Old 13th November 2008, 06:41   #10  |  Link
ramprasad85
Registered User
 
Join Date: Oct 2008
Location: Chennai India
Posts: 31
Success!
I downloaded the latest code and noticed the x86 folder.
The code compiled.
But when i executed the exe on windows it crashes.
looking at the disassembly, i figured out that it is trying to use MMX registers. So i manually deleted the -DHAVE_MMX from the configure script and compiled. Now it works. In fact VLC 0.9.6 which uses x264 also crashes when i use H264 codec.
I tested the exe on 3 computers.
Is there a fix for this.
Thank you
ramprasad85 is offline   Reply With Quote
Old 13th November 2008, 06:59   #11  |  Link
squid_80
Registered User
 
Join Date: Dec 2004
Location: Melbourne, AU
Posts: 1,963
Do you mean you're running x264 on a pc that doesn't have MMX?
squid_80 is offline   Reply With Quote
Old 13th November 2008, 07:10   #12  |  Link
ramprasad85
Registered User
 
Join Date: Oct 2008
Location: Chennai India
Posts: 31
[ramprasad@localhost ~]$ cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 15
model : 4
model name : Intel(R) Pentium(R) 4 CPU 2.40GHz
stepping : 1
cpu MHz : 2400.260
cache size : 1024 KB
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 5
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe constant_tsc up pebs bts pni monitor ds_cpl cid xtpr
bogomips : 4803.24
clflush size : 64

My CPU has MMX and SSE support,
ramprasad85 is offline   Reply With Quote
Old 13th November 2008, 08:05   #13  |  Link
Dark Shikari
x264 developer
 
Dark Shikari's Avatar
 
Join Date: Sep 2005
Posts: 8,666
Deleting -DHAVE_MMX is equivalent to disabling assembly. If it works without assembly, I suspect you have borked something relating to the assembler.

Would it happen that your Linux is 64-bit and Windows is 32-bit, for example? Or your Windows is 64-bit?
Dark Shikari is offline   Reply With Quote
Old 13th November 2008, 10:27   #14  |  Link
ramprasad85
Registered User
 
Join Date: Oct 2008
Location: Chennai India
Posts: 31
I have windows and Linux on the same system (dual boot) on a intel P4
i downloaded x264 source, compiled it using Mingw32 compiler by setting 'CC=' and used Mingw32's ar ranlib and strip by modifying Make file.
when i run the exe on windows
1. send error report box appears
2. when debug button is clicked, Visual studio says (unhandled exception)
3. When i click ok the faulting instruction has some thing to do with mm0
which i believe is something to do with MMX.
when i run the same exe with --no-asm it runs perfectly
For more info have a look at the attached images
Thank you
Attached Images
   
ramprasad85 is offline   Reply With Quote
Old 13th November 2008, 10:34   #15  |  Link
Dark Shikari
x264 developer
 
Dark Shikari's Avatar
 
Join Date: Sep 2005
Posts: 8,666
Quote:
Originally Posted by ramprasad85 View Post
I have windows and Linux on the same system (dual boot) on a intel P4
You haven't said anything about 32-bit or 64-bit, like I asked.
Dark Shikari is offline   Reply With Quote
Old 13th November 2008, 15:33   #16  |  Link
kemuri-_9
Compiling Encoder
 
kemuri-_9's Avatar
 
Join Date: Jan 2007
Posts: 1,348
i don't think his processor has the EM64T instruction set, so it shouldn't even be capable of either x64 linux or windows.

It seems that his processor is the original p4 line,
so best he has is SSE2, no SSE3 or EM64T.

so it is probably the fact he's on a really old revision and the -DHAVE_SSE3 in the ASFLAGS is fubarring it up.
since x264 is trying to use SSE3 instructions with that in there and he doesn't have them, would explain the crash when ran normally and no crash with --no-asm.

@ramprasad85
try the following
see if x264 runs fine with adding --asm sse2 to your commandline (i think it existed back then)
if that works then remake x264 with the following
make ASFLAGS="-O2 -f win32 -DPREFIX"
with whatever else you're using to get it to make right; just ASFLAGS needs to be what i have there.
__________________
custom x264 builds & patches | F@H | My Specs

Last edited by kemuri-_9; 13th November 2008 at 15:48.
kemuri-_9 is offline   Reply With Quote
Reply

Tags
crosscompile, mingw, x264

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 06:27.


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