vlc太大,组件太多,我们根据业务需求,能用的仅仅是几个组件而已,其他不用的我们就该去掉。这里Jeremiah根据自己的情况精简了vlc,vlc-0.9.4最后得到的安装文件3518KB,cab文件3520KB;vlc-0.8.6i的安装文件3087KB,cab文件3264KB。相对于原来几十兆来说,小了N多。
1. 业务需求。
Jeremiah所用的业务需求是:(1)播放本地avi文件。(2)播放ts封装的rtp流。(3)播放rtsp流。
2. vlc-0.9.4的精简
脚本configure-vlc03.sh(见附件)如下:
PATH=/usr/win32/bin:$PATH \
PKG_CONFIG_LIBDIR=/usr/win32/lib/pkgconfig \
CPPFLAGS="-I/usr/win32/include -I/usr/win32/include/ebml" \
LDFLAGS=-L/usr/win32/lib \
CC="gcc -mno-cygwin" CXX="g++ -mno-cygwin" \
./configure \
--host=i686-pc-mingw32 \
--disable-gtk \
--enable-avcodec \
--enable-avformat \
--enable-libmpeg2 \
--enable-live555 --with-live555-tree=/usr/win32/live.com \
--disable-nls \
--disable-skins2 \
--disable-qt4 \
--disable-macosx-defaults \
--disable-hal \
--disable-dbus \
--disable-dbus-control \
--disable-telepathy \
--disable-mmx \
--disable-sse \
--disable-altivec \
--disable-coverage \
--disable-release \
--enable-sout \
--disable-lua \
--disable-httpd \
--disable-libproxy \
--disable-audioscrobbler \
--disable-taglib \
--disable-dvdnav \
--disable-dshow \
--disable-bda \
--disable-smb \
--disable-dvbpsi \
--disable-v4l2 \
--disable-libcdio \
--disable-libcddb \
--disable-vcdx \
--disable-cdda \
--disable-vcd \
--disable-dvb \
--disable-screen \
--disable-ogg \
--disable-mkv \
--disable-mod \
--disable-mpc \
--disable-gme \
--disable-mad \
--disable-id3tag \
--disable-swscale \
--disable-imgresample \
--disable-faad \
--disable-real \
--disable-realrtsp \
--disable-libtar \
--disable-a52 \
--disable-dca \
--disable-flac \
--disable-vorbis \
--disable-tremor \
--disable-speex \
--disable-tarkin \
--disable-theora \
--disable-dirac \
--disable-schroedinger \
--disable-png \
--disable-zvbi \
--disable-telx \
--disable-cmml \
--disable-kate \
--disable-x11 \
--disable-xvideo \
--disable-glx \
--disable-xinerama \
--disable-opengl \
--disable-sdl \
--disable-sdl-image \
--disable-freetype \
--disable-fribidi \
--disable-fontconfig \
--disable-libxml2 \
--disable-pulse \
--disable-alsa \
--disable-upnp \
--disable-ncurses \
--disable-visual \
--disable-atmo \
--disable-bonjour \
--disable-libgcrypt \
--disable-gnutls \
--disable-remoteosd \
--enable-shared=yes \
--enable-x264 \
--enable-vlc \
--enable-activex \
脚本请参考:
make通过只后,删除locale文件夹,这个文件夹是用本地语言作界面的。删除plugins中的200多dll,只保留:
libaccess_file_plugin.dll
libaout_directx_plugin.dll
libasf_plugin.dll
libaudio_format_plugin.dll
libavcodec_plugin.dll
libavformat_plugin.dll
libavi_plugin.dll
libconverter_fixed_plugin.dll
libconverter_float_plugin.dll
libhotkeys_plugin.dll
liblive555_plugin.dll
libmpeg_audio_plugin.dll
libpacketizer_copy_plugin.dll
libpacketizer_h264_plugin.dll
libpacketizer_vc1_plugin.dll
libplaylist_plugin.dll
librc_plugin.dll
librtp_plugin.dll
libsubtitle_plugin.dll
libtrivial_channel_mixer_plugin.dll
libtrivial_mixer_plugin.dll
libts_plugin.dll
libugly_resampler_plugin.dll
libvout_directx_plugin.dll
libwaveout_plugin.dll
再用.nsi脚本编译,修改n个错误之后就生成了较小的安装文件了。
3. 精简vlc-0.8.6i
脚本configure-vlc02.sh(见附件)如下: PKG_CONFIG_PATH=/usr/win32/lib/pkgconfig \
CPPFLAGS="-I/usr/win32/include -I/usr/win32/include/ebml" \
LDFLAGS=-L/usr/win32/lib \
CC="gcc -mno-cygwin" CXX="g++ -mno-cygwin" \
./configure \
--with-freetype-config-path=/usr/win32/bin \
--with-fribidi-config-path=/usr/win32/bin \
--enable-ffmpeg --with-ffmpeg-mp3lame --with-ffmpeg-faac \
--with-ffmpeg-zlib \
--enable-live555 --with-live555-tree=/usr/win32/live.com \
--disable-nls \
--disable-cddax \
--disable-vcdx \
--disable-skins2 \
--disable-wxwidgets \
--disable-mozilla \
--disable-httpd \
--disable-dvdnav \
--disable-libcdio \
--disable-libcddb \
--disable-cdda \
--disable-sdl \
--disable-sdl-image \
--disable-vcd \
--disable-dvdread \
--disable-smb \
--disable-cmml \
--disable-alsa \
--disable-opengl \
--disable-png \
--disable-screen \
--disable-mkv \
--disable-mod \
--disable-mpc \
--disable-libtar \
--disable-speex \
--disable-visual \
--disable-daap \
--disable-bonjour \
--disable-gnutls \
--disable-vorbis \
--disable-dts \
--disable-real \
--disable-xml \
--disable-x264 \
--enable-sout \
--enable-activex \
--enable-shared-libvlc \
--enable-release
make之后删除http,locale,skins,osdmenu文件夹,plugins保留:
libaccess_file_plugin.dll
libaccess_udp_plugin.dll
libaout_directx_plugin.dll
libasf_plugin.dll
libaudio_format_plugin.dll
libavi_plugin.dll
libffmpeg_plugin.dll
libfloat32tos16_plugin.dll
libfloat32_mixer_plugin.dll
libipv4_plugin.dll
libmpeg_audio_plugin.dll
libmpgatofixed32_plugin.dll
librc_plugin.dll
libs16tofixed32_plugin.dll
libs16tofloat32swab_plugin.dll
libs16tofloat32_plugin.dll
libs8tofloat32_plugin.dll
libsubtitle_plugin.dll
libtrivial_channel_mixer_plugin.dll
libtrivial_mixer_plugin.dll
libts_plugin.dll
libu8tofixed32_plugin.dll
libu8tofloat32_plugin.dll
libugly_resampler_plugin.dll
libvobsub_plugin.dll
libvout_directx_plugin.dll
libwaveout_plugin.dll
使用.nsi脚本来做安装文件就ok了。