在win32平台上利用mingw进行VLC的移植

简介: 首先是创建VLC的编译环境。 到http://sourceforge.net/project/showfiles.php?group_id=2435下载相关文件。 下载MinGW-5.1.3.exe或者更高的版本,然后运行,按照提示安装,最好选择安装full版本。

首先是创建VLC的编译环境。

http://sourceforge.net/project/showfiles.php?group_id=2435下载相关文件。

下载MinGW-5.1.3.exe或者更高的版本,然后运行,按照提示安装,最好选择安装full版本。

下载MSYS-1.0.10.exe或者更高的版本,然后运行,按照提示安装,中间要正确填写已经安装好的MinGW的目录,例如“j:/MinGW”。主要要用“/”。

下载msysDTK-1.0.0.exe或者更高的版本,然后运行,按照提示安装。

其次是编译VLC。

下载http://download.videolan.org//pub/testing/win32/contrib-0.8.6e-gcc-3.4.5-only.tar.bz2 到某个目录,如“j:\vlc”。

http://www.videolan.org/vlc/download-sources.html下载VLC source code tar.gz文件到上述目录。

运行msys程序,在弹出的控制终端中输入

mkdir /vlc

然后用windows的记事本编辑器编辑msys\1.0\etc\fstab文件,在里面加入一行 j:/VLC /vlc,这样可以挂载vlc目录。

在msys的控制终端中输入

cd /vlc

tar jxvf contrib-0.8.6e-gcc-3.4.5-only.tar.bz2 –C /

会把解码库解压到/usr/win32-branch目录中。

在当前目录继续输入

tar zxvf vlc-0.8.6e.tar.gz

将vlc的源代码解压缩到vlc-0.8.6e目录中。

在当前目录继续输入

  cd vlc-0.8.6e

  ./bootstrap

  PKG_CONFIG_PATH=/usr/win32-branch/lib/pkgconfig \

  CPPFLAGS="-I/usr/win32-branch/include -I/usr/win32-branch/include/ebml" \

  LDFLAGS=-L/usr/win32-branch/lib \

  ./configure \

      --disable-gtk \

      --enable-nls --enable-sdl --with-sdl-config-path=/usr/win32-branch/bin \

      --enable-ffmpeg --with-ffmpeg-mp3lame --with-ffmpeg-faac \

      --with-ffmpeg-zlib --enable-faad --enable-flac --enable-theora \

      --with-wx-config-path=/usr/win32-branch/bin \

      --with-freetype-config-path=/usr/win32-branch/bin \

      --with-fribidi-config-path=/usr/win32-branch/bin \

      --enable-caca --with-caca-config-path=/usr/win32-branch/bin \

      --with-xml2-config-path=/usr/win32-branch/bin \

      --with-dvdnav-config-path=/usr/win32-branch/bin \

      --disable-cddax --disable-vcdx --enable-goom \

      --enable-twolame --enable-dvdread \

      --disable-mkv \

      --enable-debug

开始VLC的配置,然后执行

make

开始编译。编译过程中先出现如下错误:

j:/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/sys/stat.h:113: error: syntax error before "off_t"

j:/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/sys/stat.h:118: error: syntax error before '}' token

make[4]: *** [libaccess_output_file_plugin_a-file.o] Error 1

make[4]: Leaving directory `/vlc/vlc-0.8.6e/modules/access_output'

make[3]: *** [all-modules] Error 1

make[3]: Leaving directory `/vlc/vlc-0.8.6e/modules/access_output'

make[2]: *** [all-recursive] Error 1

make[2]: Leaving directory `/vlc/vlc-0.8.6e/modules'

make[1]: *** [all-recursive] Error 1

make[1]: Leaving directory `/vlc/vlc-0.8.6e'

make: *** [all] Error 2

原因是:没有在sys/stat.h之前包含“config.h”文件。这2个头文件有冲突。

解决办法:将vlc-0.8.6e /modules/access_out/file.c和vlc-0.8.6e /modules/access_out/udp.c这两个文件的“#include ”注释掉。

继续编译,又同样出类似问题

j:/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/sys/stat.h:113: error: syntax error before "off_t"

j:/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/sys/stat.h:118: error: syntax error before '}' token

make[6]: *** [libmux_ps_plugin_a-pes.o] Error 1

make[6]: Leaving directory `/vlc/vlc-0.8.6e/modules/mux/mpeg'

make[5]: *** [all-modules] Error 1

make[5]: Leaving directory `/vlc/vlc-0.8.6e/modules/mux/mpeg'

make[4]: *** [all-recursive] Error 1

make[4]: Leaving directory `/vlc/vlc-0.8.6e/modules/mux'

make[3]: *** [all] Error 2

make[3]: Leaving directory `/vlc/vlc-0.8.6e/modules/mux'

make[2]: *** [all-recursive] Error 1

make[2]: Leaving directory `/vlc/vlc-0.8.6e/modules'

make[1]: *** [all-recursive] Error 1

make[1]: Leaving directory `/vlc/vlc-0.8.6e'

make: *** [all] Error 2

解决办法:将vlc-0.8.6e\modules\mux\mpeg\pes.c文件的“#include ”注释掉。

继续编译,还是有问题

j:/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/wchar.h:419: error: `off_t' does not name a type

make[3]: *** [libaxvlc_a-main.o] Error 1

make[3]: Leaving directory `/vlc/vlc-0.8.6e/activex'

make[2]: *** [all] Error 2

make[2]: Leaving directory `/vlc/vlc-0.8.6e/activex'

make[1]: *** [all-recursive] Error 1

make[1]: Leaving directory `/vlc/vlc-0.8.6e'

make: *** [all] Error 2

原因:off_t类型没有定义。

解决办法:在MinGW/include/wchar.h文件中加入如下代码:

#ifndef _OFF_T_DEFINED

typedef long off_t;

#define _OFF_T_DEFINED

#endif

继续编译,可以通过,并在vlc-0.8.6e目录下面生成vlc.exe可执行文件,这就是可以用于windows下的VLC了。通过实验,编译成功的文件可以播放*.mpg、*.mp3等格式的多媒体文件以及接收播放网络流媒体。

相关文章
|
9月前
|
编译器 C语言 Windows
cryptopp使用Qt mingw编译,以及海思平台交叉编译
cryptopp使用Qt mingw编译,以及海思平台交叉编译
228 0
|
Ubuntu 编译器 芯片
FFmpeg开发笔记(十):ffmpeg在ubuntu上的交叉编译移植到海思HI35xx平台
FFmpeg开发笔记(十):ffmpeg在ubuntu上的交叉编译移植到海思HI35xx平台
FFmpeg开发笔记(十):ffmpeg在ubuntu上的交叉编译移植到海思HI35xx平台
|
Unix Linux Shell
使用msys2 在windows上构建ffmpeg开发环境
使用msys2 在windows上构建ffmpeg开发环境
520 0
|
Windows
编译WINDOWS版FFmpeg:编译SDL
编译WINDOWS版FFmpeg:编译SDL
159 0
|
编解码 Unix Linux
FFmpeg开发笔记(三):ffmpeg介绍、windows编译以及开发环境搭建
FFmpeg开发笔记(三):ffmpeg介绍、windows编译以及开发环境搭建
FFmpeg开发笔记(三):ffmpeg介绍、windows编译以及开发环境搭建
|
编译器 开发工具 C语言
FFmpeg开发笔记(一):ffmpeg介绍、windows开发环境搭建(mingw和msvc,无需源码编译)
FFmpeg开发笔记(一):ffmpeg介绍、windows开发环境搭建(mingw和msvc,无需源码编译)
FFmpeg开发笔记(一):ffmpeg介绍、windows开发环境搭建(mingw和msvc,无需源码编译)
|
Web App开发 C语言 Windows
一步步实现windows版ijkplayer系列文章之一Windows10平台编译ffmpeg 4.0.2,生成ffplay
Windows10平台编译ffmpeg 4.0.2,生成ffplay 最近想研究下ffplay的代码,学习代码是枯燥无味的,也是抽象的,学习一个系统或者软件之前,好的入门方法是先把系统搭建起来,或者把软件编译出来,直观的操作一下相关的功能,由表入里,熟悉功能之后,在慢慢深入代码,由现象看到本质,才能理解的更加深刻。
2629 0
|
Linux Windows C语言
移植ffmpeg到VC环境心得
所有想学习ffmpeg的网友有福了,大名鼎鼎的ffmpeg,移植到Windows的VC6版本全部开源,编译环境为VC6+SP5+VCPP5。别忘记了顶贴哦。 移植ffmpeg到windows,主要的修改是ffmpeg中VC6不支持C99语法,简单移植步骤如下: 1:首先装好Linux、VMware和SDL,配置好smb,在Linux下编译通过,验证能正确的Run。
801 0