close

現在ffmpeg的官方建議ubuntu的環境下用mingw32編譯ffmpeg library for windows.而我一年之前在mingw+msys編譯出來的library,似乎會因為mmx,sse的問題當機.有爬文說到用gcc3.4.5編譯出來的確實可能這樣的問題存在...所以試試新的方法,是否真的解決問題和過程是不是比較簡單?

用Virtual Box裝了ubuntu 10.10 server version.整個過程比Desktop的版本順暢,不過沒有window介面唷.裝完之後,由於公司是在防火牆內,所以要設定proxy server.一開始用環境變數http_proxy的設定proxy.不過wget和apt對於windows的proxy認證一直有問題. (The ISA server requires authorization to fulfill the request....).所以改用ntlmaps,不過它需要Python1.5.2來執行.

1.抓取 ntlmaps

2.設定server.cfg of ntlmaps (nt domain, ip, port, username, password for MS Proxy Server using the proprietary NTLM protocol)

 PARENT_PROXY:192.168.1.254
 PARENT_PROXY_PORT:8080
 ALLOW_EXTERNAL_CLIENTS:0
 FRIENDLY_IPS: 192.168.3.184
 NT_DOMAIN:YOKO-TECH.com
 USER: personlin

3.設定http_proxy, 以及/etc/apt/apt.cfg

4.run main.py&

後來直接裝ntlmaps.exe的windows版本, 這樣就可以透過自己的公司電腦出去了.

接下來mingw32的環境設定, 10.10的版本已經有gcc-mingw32,所以很方便,不需要照官網的步驟

personlin@ubuntu32:~/ffmpeg-export-2010-10-18$ i586-mingw32msvc-gcc -v Thread model: win32 gcc version 4.4.4 (GCC)


$ sudo apt-get install gcc-mingw32

針對ffmpeg需要修正的部份.


--- /mingw/include/stdio.h.orig    2010-06-27 14:30:24.000000000 -0300
+++ /mingw/include/stdio.h 2010-06-27 14:32:24.000000000 -0300
@@ -186,6 +186,8 @@
_CRTIMP int __cdecl __MINGW_NOTHROW rmtmp(void);
_CRTIMP int __cdecl __MINGW_NOTHROW unlink (const char*);
#endif
+#else
+_CRTIMP char* __cdecl __MINGW_NOTHROW tempnam (const char*, const char*);
#endif /* __STRICT_ANSI__ */

_CRTIMP int __cdecl __MINGW_NOTHROW setvbuf (FILE*, char*, int, size_t);
--- /mingw/include/string.h.orig 2010-06-27 13:46:10.000000000 -0300
+++ /mingw/include/string.h 2010-06-27 14:01:04.000000000 -0300
@@ -116,6 +116,9 @@
#endif /* _UWIN */
#endif /* _NO_OLDNAMES */

+#else
+int __cdecl __MINGW_NOTHROW strcasecmp (const char*, const char *);
+int __cdecl __MINGW_NOTHROW strncasecmp (const char *, const char *, size_t);
#endif /* Not __STRICT_ANSI__ */

#ifndef _WSTRING_DEFINED
--- /mingw/include/stdio.h.orig 2010-06-27 14:30:24.000000000 -0300
+++ /mingw/include/stdio.h 2010-01-09 01:39:12.000000000 -0200
@@ -366,7 +366,7 @@
_CRTIMP int __cdecl __MINGW_NOTHROW _filbuf (FILE*);
_CRTIMP int __cdecl __MINGW_NOTHROW _flsbuf (int, FILE*);

-#if !defined _MT
+#if 0

__CRT_INLINE int __cdecl __MINGW_NOTHROW getc (FILE* __F)
{


$ sudo apt-get install yasm
$ wget http://www.ffmpeg.org/releases/ffmpeg-export-snapshot.tar.bz2
$ tar -xjvf ffmpeg-export-snapshot.tar.bz2
$ cd ffmpeg-export-2010-10-18
$ ./configure --enable-memalign-hack --arch=x86 --target-os=mingw32 --cross-prefix=i586-mingw32msvc- --prefix=$HOME/ffmpeg
$ make

 


真的太高興了..真的順暢多了...不然我還在搞最新的mingw-get,一直抓不到檔案的問題.最後裝完之後,build也是挺多問題要處理的.編出來之後,可以順暢的繼續用ffmpeg了...Orz...

personlin@ubuntu64:~/ffmpeg-export-2010-10-18$ i586-mingw32msvc-gcc -v
Using built-in specs.
Target: i586-mingw32msvc
Configured with: /build/buildd/gcc-mingw32-4.4.4/build-tree/gcc-4.4.4/configure --build=i686-linux-gnu --prefix=/usr --includedir='/usr/include' --mandir='/usr/share/man' --infodir='/usr/share/info' --sysconfdir=/etc --localstatedir=/var --libexecdir='/usr/lib/gcc-mingw32' --disable-multilib --enable-threads --enable-sjlj-exceptions --enable-version-specific-runtime-libs --disable-shared --target=i586-mingw32msvc --enable-languages=c,c++,fortran : (reconfigured) /build/buildd/gcc-mingw32-4.4.4/build-tree/gcc-4.4.4/configure --build=i686-linux-gnu --prefix=/usr --includedir='/usr/include' --mandir='/usr/share/man' --infodir='/usr/share/info' --sysconfdir=/etc --localstatedir=/var --libexecdir='/usr/lib/gcc-mingw32' --disable-multilib --enable-threads --enable-sjlj-exceptions --enable-version-specific-runtime-libs --disable-shared --target=i586-mingw32msvc --enable-languages=c,c++,fortran
Thread model: win32
gcc version 4.4.4 (GCC)
arrow
arrow
    全站熱搜

    Person 發表在 痞客邦 留言(0) 人氣()