[MEncoder-users] Compiling in Windows

James Hastings-Trew jimht at shaw.ca
Sat Feb 14 15:53:19 CET 2009


It's been said in this list before that you'd have to be an idiot if you 
can't compile Mplayer and Mencoder from source. Therefore, I am an 
idiot. I am not a programmer and have zero experience with compiling 
things. I hope the tale told in this message represents a reasonable 
attempt to get this, but ultimately, I'm not there yet. Can someone help 
this wandering idiot find the right direction?

Here's what I've done:
I went to Gianluigi Tiesi's page http://oss.netfarm.it/mplayer-win32.php 
and downloaded his MinGW Build Environment. This seems to be relatively 
complete with all the various header files needed for the windows 
environment. I put this in C:\MinGW.  I also downloaded all of his MinGW 
libs and put all of the folders in C:\MinGW (include, lib, bin and so on)

I downloaded the latest SVN of mplayer:
        svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer
I then went into C:\MinGW\mplayer and typed
        ./configure
        make
This gives me working versions of mplayer and mencoder. As a test, I 
tried this command line:
        mencoder Harry_Potter.mp4 -oac mp3lame -ovc lavc -vf 
scale=640:-10 -o test.avi
and mencoder set off and started making a reasonable avi file out of the 
input movie. So, it's working that far. Yay me.

However, mencoder doesn't seem to know what x264 is. Trying this command 
line:
        mencoder Harry_Potter.mp4 -oac mp3lame -ovc x264 -x264encopts 
bitrate=800 -vf scale=640:-10 -o test.avi
gives me this output:

        MEncoder SVN-r28554-4.2.4 (C) 2000-2009 MPlayer Team
        -x264encopts is not an MEncoder option
        Exiting... (error parsing command line)

Omitting the -x264encopts bitrate=800 from the command line gives me this:

        MEncoder SVN-r28554-4.2.4 (C) 2000-2009 MPlayer Team
        success: format: 0  data: 0x0 - 0x5d34baa7
        libavformat file format detected.
        [lavf] Video stream found, -vid 0
        [lavf] Audio stream found, -aid 1
        VIDEO:  [avc1]  1280x528  24bpp  23.976 fps    0.0 kbps ( 0.0 
kbyte/s)
        [V] filefmt:44  fourcc:0x31637661  size:1280x528  fps:23.976  
ftime:=0.0417
        
==========================================================================
        Opening audio decoder: [faad] AAC (MPEG2/4 Advanced Audio Coding)
        FAAD: compressed input bitrate missing, assuming 128kbit/s!
        AUDIO: 48000 Hz, 2 ch, s16le, 128.0 kbit/8.33% (ratio: 
16000->192000)
        Selected audio codec: [faad] afm: faad (FAAD AAC (MPEG-2/MPEG-4 
Audio))
        
==========================================================================
        Couldn't find video filter 'x264'.
        Failed to open the encoder.
        Exiting...

I noticed as configure was running the following message go by:
        Checking for x264 ... no (in libavcodec: no)
And looking in configure.log I saw this:

============ Checking for x264 ============

#include <inttypes.h>
#include <x264.h>
#if X264_BUILD < 59
#error We do not support old versions of x264. Get the latest from SVN.
#endif
int main(void) { x264_encoder_open((void*)0); return 0; }

gcc -Wall -Wno-switch -Wpointer-arith -Wredundant-decls -O4 
-march=native -mtune=native -pipe -ffast-math -fomit-frame-pointer -I.  
-Ilibdvdread4   -lwinmm -lws2_32 -liconv -lpng -lz -ljpeg -lgif -lz 
-lbz2 -lmad -lspeex -ldts -lmpcdec -ladvapi32 -lole32 -lxvidcore -lm  
-lopengl32 -lgdi32 -lgdi32 -lwinmm -ld3d9 -lgdi32 -lfaac  -lfaac -o 
/tmp/mplayer-conf-8512-1648.exe /tmp/mplayer-conf-29628-1648.c -lx264
c:/mingw/bin/../lib/gcc/i686-pc-mingw32/4.2.4/../../../libx264.a(encoder.o):(.text+0x2243): 
undefined reference to `pthread_join'
c:/mingw/bin/../lib/gcc/i686-pc-mingw32/4.2.4/../../../libx264.a(encoder.o):(.text+0x344a): 
undefined reference to `pthread_join'
c:/mingw/bin/../lib/gcc/i686-pc-mingw32/4.2.4/../../../libx264.a(encoder.o):(.text+0x492b): 
undefined reference to `pthread_create'
c:/mingw/bin/../lib/gcc/i686-pc-mingw32/4.2.4/../../../libx264.a(cpu.o):(.text+0x1): 
undefined reference to `pthread_num_processors_np'
c:/mingw/bin/../lib/gcc/i686-pc-mingw32/4.2.4/../../../libx264.a(analyse.o):(.text+0x5b9f): 
undefined reference to `__mingw_vfprintf'
c:/mingw/bin/../lib/gcc/i686-pc-mingw32/4.2.4/../../../libx264.a(frame.o):(.text+0x1555): 
undefined reference to `pthread_mutex_lock'
c:/mingw/bin/../lib/gcc/i686-pc-mingw32/4.2.4/../../../libx264.a(frame.o):(.text+0x156f): 
undefined reference to `pthread_cond_wait'
c:/mingw/bin/../lib/gcc/i686-pc-mingw32/4.2.4/../../../libx264.a(frame.o):(.text+0x15c1): 
undefined reference to `pthread_mutex_lock'
c:/mingw/bin/../lib/gcc/i686-pc-mingw32/4.2.4/../../../libx264.a(frame.o):(.text+0x15d5): 
undefined reference to `pthread_cond_broadcast'
c:/mingw/bin/../lib/gcc/i686-pc-mingw32/4.2.4/../../../libx264.a(frame.o):(.text+0x2394): 
undefined reference to `pthread_mutex_destroy'
c:/mingw/bin/../lib/gcc/i686-pc-mingw32/4.2.4/../../../libx264.a(frame.o):(.text+0x23a2): 
undefined reference to `pthread_cond_destroy'
c:/mingw/bin/../lib/gcc/i686-pc-mingw32/4.2.4/../../../libx264.a(frame.o):(.text+0x2a4e): 
undefined reference to `pthread_mutex_init'
c:/mingw/bin/../lib/gcc/i686-pc-mingw32/4.2.4/../../../libx264.a(frame.o):(.text+0x2a67): 
undefined reference to `pthread_cond_init'
c:/mingw/bin/../lib/gcc/i686-pc-mingw32/4.2.4/../../../libx264.a(frame.o):(.text+0x1593): 
undefined reference to `pthread_mutex_unlock'
c:/mingw/bin/../lib/gcc/i686-pc-mingw32/4.2.4/../../../libx264.a(frame.o):(.text+0x15ed): 
undefined reference to `pthread_mutex_unlock'
c:/mingw/bin/../lib/gcc/i686-pc-mingw32/4.2.4/../../../libx264.a(ratecontrol.o):(.text+0x30f): 
undefined reference to `__mingw_vfprintf'
c:/mingw/bin/../lib/gcc/i686-pc-mingw32/4.2.4/../../../libx264.a(ratecontrol.o):(.text+0x6be): 
undefined reference to `pthread_mutex_lock'
c:/mingw/bin/../lib/gcc/i686-pc-mingw32/4.2.4/../../../libx264.a(ratecontrol.o):(.text+0x6fd): 
undefined reference to `pthread_mutex_unlock'
c:/mingw/bin/../lib/gcc/i686-pc-mingw32/4.2.4/../../../libx264.a(ratecontrol.o):(.text+0x732): 
undefined reference to `pthread_mutex_lock'
c:/mingw/bin/../lib/gcc/i686-pc-mingw32/4.2.4/../../../libx264.a(ratecontrol.o):(.text+0x14b6): 
undefined reference to `pthread_mutex_lock'
c:/mingw/bin/../lib/gcc/i686-pc-mingw32/4.2.4/../../../libx264.a(ratecontrol.o):(.text+0x14d9): 
undefined reference to `pthread_mutex_unlock'
c:/mingw/bin/../lib/gcc/i686-pc-mingw32/4.2.4/../../../libx264.a(ratecontrol.o):(.text+0x1504): 
undefined reference to `pthread_mutex_lock'
c:/mingw/bin/../lib/gcc/i686-pc-mingw32/4.2.4/../../../libx264.a(ratecontrol.o):(.text+0x2092): 
undefined reference to `pthread_mutex_lock'
c:/mingw/bin/../lib/gcc/i686-pc-mingw32/4.2.4/../../../libx264.a(ratecontrol.o):(.text+0x20df): 
undefined reference to `pthread_mutex_unlock'
c:/mingw/bin/../lib/gcc/i686-pc-mingw32/4.2.4/../../../libx264.a(ratecontrol.o):(.text+0x241c): 
undefined reference to `pthread_mutex_lock'
c:/mingw/bin/../lib/gcc/i686-pc-mingw32/4.2.4/../../../libx264.a(ratecontrol.o):(.text+0x247f): 
undefined reference to `pthread_mutex_unlock'
c:/mingw/bin/../lib/gcc/i686-pc-mingw32/4.2.4/../../../libx264.a(ratecontrol.o):(.text+0x2757): 
undefined reference to `pthread_mutex_lock'
c:/mingw/bin/../lib/gcc/i686-pc-mingw32/4.2.4/../../../libx264.a(ratecontrol.o):(.text+0x2781): 
undefined reference to `pthread_mutex_unlock'
c:/mingw/bin/../lib/gcc/i686-pc-mingw32/4.2.4/../../../libx264.a(ratecontrol.o):(.text+0x28c0): 
undefined reference to `pthread_mutex_lock'
c:/mingw/bin/../lib/gcc/i686-pc-mingw32/4.2.4/../../../libx264.a(ratecontrol.o):(.text+0x290d): 
undefined reference to `pthread_mutex_unlock'
c:/mingw/bin/../lib/gcc/i686-pc-mingw32/4.2.4/../../../libx264.a(ratecontrol.o):(.text+0x3062): 
undefined reference to `pthread_mutex_lock'
c:/mingw/bin/../lib/gcc/i686-pc-mingw32/4.2.4/../../../libx264.a(ratecontrol.o):(.text+0x30a1): 
undefined reference to `pthread_mutex_unlock'
c:/mingw/bin/../lib/gcc/i686-pc-mingw32/4.2.4/../../../libx264.a(ratecontrol.o):(.text+0x3192): 
undefined reference to `pthread_mutex_lock'
c:/mingw/bin/../lib/gcc/i686-pc-mingw32/4.2.4/../../../libx264.a(ratecontrol.o):(.text+0x31d1): 
undefined reference to `pthread_mutex_unlock'
c:/mingw/bin/../lib/gcc/i686-pc-mingw32/4.2.4/../../../libx264.a(ratecontrol.o):(.text+0x761): 
undefined reference to `pthread_mutex_unlock'
collect2: ld returned 1 exit status

Looking in the various MinGW folders, I do indeed have bin/x264.exe, 
include/x264.h, and lib/libx264.a, so I am reasonably confident that I 
have the various x264 bits that the compiler is looking for but 
something about the pthread thing is not right. :(

Buh... so, what do I need to do to make this work? I have a sense that I 
am *this* close, but I am really at a loss as to what to do to fix this.




More information about the MEncoder-users mailing list