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 2nd December 2008, 16:49   #1  |  Link
snd303
Registered User
 
snd303's Avatar
 
Join Date: Apr 2008
Posts: 2
How to compile libx264.dll for Avidemux?

Hi, everyone. Does anyone know how to compile libx264.dll for Avidemux?
-
My System
Windows XP Prof SP3
-
So here is what I did so far
  • Installed all the programs listed in that guide
    Step by step x264 compilation guide for complete newbies:
    -
  • I always tried to install the newest version of each program
    binutils-2.19-mingw32-rc1-bin.tar.gz
    gcc-part-core-4.3.0-20080502-2-mingw32-alpha-bin.tar.gz
    Git-1.6.0.2-preview20080923.exe
    MinGW-5.1.4.exe
    w32api-3.12-mingw32-dev.tar.gz
    yasm-0.7.2-win32.exe
    zlib-1.2.3.exe
    gpac-0.4.4-rc2.zip (I guess not necessary for Avidemux?)
    pthreads-w32-2-8-0-release.exe
    -
  • Get the newest x264 build with Git
    Code:
    git clone git://git.videolan.org/x264.git
    -
  • Open MSYS and start to configure the source
    Code:
    configure --prefix=/mingw --enable-pthread --enable-avis-input --enable-shared
    -
    Gives me the following result
    Code:
    ./version.sh: git: command not found
    Platform:   X86
    System:     MINGW
    asm:        yes
    avis input: yes
    mp4 output: no
    pthread:    yes
    debug:      no
    gprof:      no
    PIC:        no
    shared:     yes
    visualize:  no
    
    You can run 'make' or 'make fprofiled' now.
    -
  • Then start to compile
    Code:
    make SONAME=libx264.dll
    Some warnings appear during compiling but nothing to worry about I guess…
    -
Everything’s finished and I have a brand new x264.exe (1,12 MB) and libx264.dll (803 KB).
-
Testing x264.exe
Code:
$ x264.exe --version
x264 0.65.x
built on Dec  2 2008, gcc: 4.3.0 20080305 (alpha-testing) mingw-20080502
-
Overwriting the existing libx264.dll in the Avidemux folder and try to encode a video in x264 gives me the following result:
Filter Init Failed
-
Looking forward for some advice.
-
snd303
snd303 is offline   Reply With Quote
Old 2nd December 2008, 18:50   #2  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
You must make sure that you use the same core version of libx264-xx.dll that Avidemux was compiled for!

Usually the x264 API is unchanged over several revisions, but once it is changed, Avidemux needs to be re-compiled with latest x264.h too!

For example if a Avidemux shipped with libx264-65.dll, then it will only work with libx264 core version 65...


BTW: You need to apply the alignment fix patch to make libx264-xx.dll work properly, otherwise it will crash when executing some of the SSE functions.

And you need GCC 4.2.x or newer to make the alignment fix work. Also Avisynth input is useless for the x264 DLL.


My build script looks like this:
Code:
git clone git://git.videolan.org/x264.git
echo 
echo --------------------------------------------------------------------------
echo 
cd x264
patch -p1 < ../avidemux.diff
echo 
echo --------------------------------------------------------------------------
echo 
./configure --enable-shared --extra-cflags="-march=pentium2"
echo 
echo --------------------------------------------------------------------------
echo 
make fprofiled VIDS="../sample.avs ../sample2.avs"
echo 
echo --------------------------------------------------------------------------
The patch is as follows:
Code:
*** a/encoder/encoder.c	Fri Sep 19 23:19:33 2008
--- b/encoder/encoder.c	Sat Sep 20 03:38:48 2008
*************** static int x264_slices_write( x264_t *h 
*** 1328,1329 ****
--- 1341,1343 ----
   ****************************************************************************/
+ __attribute__((force_align_arg_pointer))
  int     x264_encoder_encode( x264_t *h,

Last but not least, latest libx264-65.dll for Avidemux r4494 can be found here:
http://forum.doom9.org/showthread.ph...26#post1218226
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊

Last edited by LoRd_MuldeR; 2nd December 2008 at 20:08.
LoRd_MuldeR is offline   Reply With Quote
Old 3rd December 2008, 01:50   #3  |  Link
snd303
Registered User
 
snd303's Avatar
 
Join Date: Apr 2008
Posts: 2
THX a lot LoRd_MuldeR. I always seeing you around since I’m using Avidemux. My libx264.dll works fine with your latest Avidemux build.

It’s like you said
Quote:
You must make sure that you use the same core version of libx264-xx.dll that Avidemux was compiled for!

Usually the x264 API is unchanged over several revisions, but once it is changed, Avidemux needs to be re-compiled with latest x264.h too!

For example if a Avidemux shipped with libx264-65.dll, then it will only work with libx264 core version 65...
snd303
__________________

Last edited by snd303; 3rd December 2008 at 03:14.
snd303 is offline   Reply With Quote
Old 3rd December 2008, 02:03   #4  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
Quote:
Originally Posted by snd303 View Post
My libx264.dll works fine with your latest Avidemux build.
BTW: It's Gruntster's Avidemux build that I mirror on my site. He also came up with the alignment fix patch
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊
LoRd_MuldeR is offline   Reply With Quote
Reply

Tags
avidemux, compile, libx264.dll, mingw, msys

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 21:47.


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