主要参考:
https://blog.csdn.net/longji/article/details/52304590 vlc-2.2.4 交叉编译 UbuntuX64_1604_Desktop 编译windows版本vlc
http://www.knowsky.com/1042484.html vlc2.2.4在64位ubuntu下的交叉编译
9月30号完成了对VLC-3.0.4的win32编译,请参考:我的https://blog.csdn.net/danfbaore/article/details/82892467
VLC及CONTRIB下载的镜像地址:https://mirrors.ustc.edu.cn/videolan-ftp
1,make prebuilt 时不要自动下载vlc-contrib-i686-w64-mingw32-latest.tar.bz2,请下载 手动下载
vlc-contrib-x86_64-w64-mingw32-20160218.tar.bz2 更名后放在CONTRIB/WIN32.
20150630及以前版本不要使用,否则在后边MAKE时会出MKV等模块编译失败。
最新的版本也不能使用,否则会提示libavautil等版本不能使用大小55或56的新版本。
2, 有这些相关报错时:gperf,flex,bison,等,可用 sudo apt-get install gperf flex bison安装。
3,JAVA版本,一定要看清楚:
java version "1.8.0_181"
Java(TM) SE Runtime Environment (build 1.8.0_181-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)
如果是openjdk 需要:sudo apt-get remove openjdk* 参考https://www.linuxidc.com/Linux/2017-02/140908.htm
卸载后发现ANT也没有了,需要重新安装。不知为什么我每次开一个终端看JAVA版本还是OPENJDK 只能再重新写下配置让其生效后才得到想要的JDK1.8
4, 64位UBUNTU上编译VLC时提示需要32位LUAC 按以下方式安装。
configure: error: You need 32-bits luac when using lua from contrib
参考:https://stackoverflow.com/questions/36273574/configure-error-you-need-32-bits-luac-when-using-lua-from-contrib
sudo apt-get install lua5.1:i386
5,2.2.8目前在打包时不能下载 失败,但编译出的程序是可用的。
6,这两个版本都能正常播放视频, 但我串流时能拉流,转换为HTTP流推出时失败, 试了下官方的好象也不行,不知是不是版本问题,官方的3.0以上版本是可以的。
7,使用 sudo make install 否则可能有权限问题。
8,最后一步make package-win32-zip 遇到错误 提示/usr/include/wine/windows/stdole2.idl 文件找不到,
我试了下:sudo apt-get install wine-dev 可以了。
9,以下为主要命令:
sudo wget https://mirrors.ustc.edu.cn/videolan-ftp/vlc/2.2.4/vlc-2.2.4.tar.xz
sudo apt-get install gcc-mingw-w64-i686 g++-mingw-w64-i686 mingw-w64-tools
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install gcc-mingw-w64-i686 g++-mingw-w64-i686 mingw-w64-tools
sudo apt-get install lua5.1 lua5.2 liblua5.1-dev liblua5.2.dev
sudo apt-get install libtool automake autoconf autopoint make gettext
sudo apt-get install pkg-config qt4-dev-tools qt5-default
sudo apt-get install git subversion cmake cvs zip p7zip p7zip-full nsis bzip2
sudo apt-get install yasm ragel wine-dev
sudo wget https://mirrors.ustc.edu.cn/videolan-ftp/contrib/i686-w64-mingw32/vlc-contrib-i686-w64-mingw32-20160218.tar.bz2
../bootstrap --host=i686-w64-mingw32
make prebuilt
cd ../..
cd win32
../bootstrap
sudo apt-get install flex bison
sudo apt-get install gperf
//以下配置注意版本,这是2.2.4的
export PKG_CONFIG_PATH=$HOME/vlc-2.2.4/contrib/i686-w64-wingw32/lib/pkgconfig
export PKG_COFIG_LIBDIR=$HOME/vlc-2.2.4/contrib/i686-w64-mingw32/lib/pkgconfig
export PKG_CONFIG_PATH_CUSTOM=$PKG_CONFIG_LIBDIR
java -version
../configure --host=i686-w64-mingw32
make
make package-win-common
wine ./vlc-2.2.4/vlc.exe
sudo apt-get install wine
wine ./vlc-2.2.4/vlc.exe
make package-win32-7zip
sudo apt-get install wine-dev
make package-win32-7zip
编译出的库比官方小, 串流时能拉出流,却不能推出HTTP OGG的流。VLM返回流失败,经测试官方这个版本也没有这个功能。
10,试了下UBUNT18版本,也会有MKV报错.
11,目前为止3.0.0及以上版本不论是PREBUILT还是FETCH都不能编译出WIN32版本,如有编译成功的请告诉我下,不胜感激。3.0.0报错如下:
vlc-3.0.0 使用CONTRIB 20180218 编译PREBUILT
d@ubuntu:~/vlc-3.0.0/contrib/win32$ ../bootstrap --host=i686-w64-mingw32
d@ubuntu:~/vlc-3.0.0/contrib/win32$ make prebuilt
d@ubuntu:~/vlc-3.0.0/contrib/win32$ cd ../.. && cd win32
d@ubuntu:~/vlc-3.0.0/win32$ ../bootstrap
d@ubuntu:~/vlc-3.0.0/win32$ export PKG_CONFIG_PATH=$HOME/vlc-3.0.0/contrib/i686-w64-mingw32/lib/pkgconfig
d@ubuntu:~/vlc-3.0.0/win32$ export PKG_CONFIG_LBDIR=$HOME/vlc-3.0.0/contrib/i686-w64-mingw32/lib/pkgconfig
d@ubuntu:~/vlc-3.0.0/win32$ export PKG_CONFIG_PATH_CUSTOM=$PKG_CONFIG_LIBDIR
d@ubuntu:~/vlc-3.0.0/win32$ ../configure --host=i686-w64-mingw32
checking for MPG123... no
configure: WARNING: Library libmpg123 needed for mpg123 was not found
checking for GST_APP... no
configure: WARNING: No package 'gstreamer-app-1.0' found. GStreamer modules will not be built.
checking for libavutil variant... ffmpeg
checking for AVCODEC... no
configure: error: Requested 'libavcodec >= 57.37.100' but version of libavcodec is 56.56.101. Pass --disable-avcodec to ignore this error.
d@ubuntu:~/vlc-3.0.0/win32$ ../configure --host=i686-w64-mingw32 --disable-avcodec
d@ubuntu:~/vlc-3.0.0/win32$ make
make[4]: Entering directory '/home/d/vlc-3.0.0/win32/modules'
^
CCLD libaccess_wasapi_plugin.la
CC access/shm.lo
CCLD libshm_plugin.la
CXX access/dshow/dshow.lo
In file included from ../../modules/access/dshow/dshow.cpp:52:0:
../../modules/access/dshow/access.h:33:24: fatal error: wrl/client.h: No such file or directory
compilation terminated.
Makefile:25225: recipe for target 'access/dshow/dshow.lo' failed
make[4]: *** [access/dshow/dshow.lo] Error 1
make[4]: Leaving directory '/home/d/vlc-3.0.0/win32/modules'
Makefile:26104: recipe for target 'all-recursive' failed
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory '/home/d/vlc-3.0.0/win32/modules'
Makefile:11217: recipe for target 'all' failed
make[2]: *** [all] Error 2
make[2]: Leaving directory '/home/d/vlc-3.0.0/win32/modules'
Makefile:1530: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/d/vlc-3.0.0/win32'
Makefile:1415: recipe for target 'all' failed
make: *** [all] Error 2
使用最新CONTRIB 配置时不再报错
MAKE 时报错如下:
CC input/vlm_event.lo
CC input/vlmshell.lo
../../src/input/vlmshell.c: In function ‘vlm_Show’:
../../src/input/vlmshell.c:1505:51: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
while( ((s->date + j * s->period) <= now) &&
^
CCLD libvlccore.la
/home/d/vlc-3.0.0/contrib/i686-w64-mingw32/lib/libintl.a(printf.o): In function `libintl_vprintf':
/home/jenkins/workspace/vlc-nightly/vlc-nightly-win32-x86/contrib/contrib-win32/gettext/gettext-tools/intl/../../gettext-runtime/intl/printf.c:138: undefined reference to `_imp____acrt_iob_func'
/home/jenkins/workspace/vlc-nightly/vlc-nightly-win32-x86/contrib/contrib-win32/gettext/gettext-tools/intl/../../gettext-runtime/intl/printf.c:138: undefined reference to `_imp____acrt_iob_func'
/home/d/vlc-3.0.0/contrib/i686-w64-mingw32/lib/libintl.a(printf.o): In function `libintl_vwprintf':
/home/jenkins/workspace/vlc-nightly/vlc-nightly-win32-x86/contrib/contrib-win32/gettext/gettext-tools/intl/../../gettext-runtime/intl/printf.c:368: undefined reference to `_imp____acrt_iob_func'
/home/jenkins/workspace/vlc-nightly/vlc-nightly-win32-x86/contrib/contrib-win32/gettext/gettext-tools/intl/../../gettext-runtime/intl/printf.c:368: undefined reference to `_imp____acrt_iob_func'
collect2: error: ld returned 1 exit status
Makefile:2234: recipe for target 'libvlccore.la' failed
make[3]: *** [libvlccore.la] Error 1
make[3]: Leaving directory '/home/d/vlc-3.0.0/win32/src'
Makefile:1785: recipe for target 'all' failed
make[2]: *** [all] Error 2
make[2]: Leaving directory '/home/d/vlc-3.0.0/win32/src'
Makefile:1530: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/d/vlc-3.0.0/win32'
Makefile:1415: recipe for target 'all' failed
make: *** [all] Error 2
使用MAKE FETCH
MAKE ERROR:
mkdir -p d3d11
cp ../../contrib/tarballs/d3d11.idl d3d11 && cd d3d11 && patch -fp1 < ../../../contrib/src/d3d11/processor_format.patch
patching file d3d11.idl
mkdir -p -- "/home/d/vlc-3.0.0/contrib/i686-w64-mingw32/include/"
i686-w64-mingw32-widl -DBOOL=WINBOOL -I/usr/include/wine/windows/ -h -o /home/d/vlc-3.0.0/contrib/i686-w64-mingw32/include/d3d11.h d3d11/d3d11.idl
mkdir -p -- "/home/d/vlc-3.0.0/contrib/i686-w64-mingw32/include/"
i686-w64-mingw32-widl -DBOOL=WINBOOL -I/usr/include/wine/windows/ -h -o /home/d/vlc-3.0.0/contrib/i686-w64-mingw32/include/dxgidebug.h ../../contrib/tarballs/dxgidebug.idl
mkdir -p -- "/home/d/vlc-3.0.0/contrib/i686-w64-mingw32/include/"
cp ../../contrib/tarballs/dxgitype.h /home/d/vlc-3.0.0/contrib/i686-w64-mingw32/include/dxgitype.h
touch .dxgitype
mkdir -p dxgi12
cp ../../contrib/tarballs/dxgi1_2.idl dxgi12 && cd dxgi12 && patch -fp1 < ../../../contrib/src/d3d11/dxgi12.patch
patching file dxgi1_2.idl
mkdir -p -- "/home/d/vlc-3.0.0/contrib/i686-w64-mingw32/include/"
i686-w64-mingw32-widl -DBOOL=WINBOOL -I/usr/include/wine/windows/ -h -o /home/d/vlc-3.0.0/contrib/i686-w64-mingw32/include/dxgi1_2.h dxgi12/dxgi1_2.idl
dxgi12/dxgi1_2.idl:43: error: syntax error, unexpected aKNOWNTYPE, expecting tIMPORT
../../contrib/src/d3d11/rules.mak:65: recipe for target '/home/d/vlc-3.0.0/contrib/i686-w64-mingw32/include/dxgi1_2.h' failed
make: *** [/home/d/vlc-3.0.0/contrib/i686-w64-mingw32/include/dxgi1_2.h] Error 1
9月30号完成了对VLC-3.0.4的编译,请参考:我的https://blog.csdn.net/danfbaore/article/details/82892467