Fedora12 下源码编译vlc-1.1.5成功 , 也是借鉴了网上别人的资料,先谢过!
先下载vlc的source code版本。
下载的时候已经是最新1.1.5版本
以root登录 (如果不是root,为了让root用户可以执行VLC,需要加上 --enable-run-as-root, 也可以./configure --help|grep root 查看该命令怎么写)
先解压tar -jxvf vlc-1.1.5.tar.bz(或bz2),cd 进入解压缩后的文件夹,查看INSTALL文档,里面有说明怎么安装和依赖库.
编译命令:./configure (--enable-run-as-root) --prefix=/usr (我是根据文档来的)
(--prefix=/usr 这个是安装目录,可以自己定义更改)
提示缺少libmad:configure: error: Could not find libmad on your system: you may get it from http://www.underbit.com/products/mad/. Alternatively you can use --disable-mad to disable the mad plugin.
configure: error: Could not find lua. Lua is needed for some interfaces (rc, telnet, http) as well as many other custom scripts. Use --disable-lua to ignore this error.
我运行# yum install lua 后,发现不是lua 有问题 ,上google查下才知道
应当安装lua-devel ,好的,运行 yum install lua-devel , 安装后解决了这个问题
编译libmad.
按照提示,下载:http://www.underbit.com/products/mad,编译
./configure --prifix=/usr
make 提示错误
cc1: error: unrecognized command line option "-fforce-mem"
make[2]: *** [version.lo] Error 1
make[2]: Leaving directory `/home/izhier/download/libmad-0.15.1b'
google,说是gcc版本太高,修改makefile,删除-fforce-mem
即可make,然后make install
好了,继续编译,这时候用如下命令:
./configure --prefix=/usr --with-mad=/usr
提示找不到libavcodec,
configure: error: Could not find libavcodec or libavutil. Use --disable-avcodec to ignore this error.
晕 , 下载 ffmpeg(官网打不开,我是网上下的),编译:
./configure --prifix=/usr/ffmpeg(先创建)
make
漫长.....
之后make install
OK
提示:建议用下面这个命令编译:
./configure --prefix=/root/soft/ffmpeg --enable-swscale --enable-postproc --enable-gpl
否则,你将不得不多编译几次ffmpeg .
继续编译vlc,不用置疑,错误又来了,(如果提示libavcodec找不到,可用 pkg-config指定ffmpeg/lib/pkgconfig)export PKG_CONFIG_PATH="/usr/lib/pkgconfig:/usr/local/lib/pkgconfig:/usr/ffmpeg/lib/pkgconfig"
export完成之后,我们可以测试一下:
pkg-config --modversion libavcodec
52.20.1
如果可以打印出版本信息,那么OK,就可以继续编译了
继续编译vlc。
./configure --prefix=/usr --with-mad=/usr
继续提示缺少swscale:checking for SWSCALE... no
configure: error: Could not find libswscale. Use --disable-swscale to ignore this error. Proper software scaling and some video chroma conversion will be missing.
google了一下,发现swscale是ffmpeg到一个选项,默认在编译到时候没有启用。
./configure --help|grep swscale
--enable-swscale enable GPLed software scaler support [no]
无奈,只好继续返ffmpeg,用如下命令:
./configure --prefix=/usr/ffmpeg --enable-swscale
然后再重复再编译安装ffmpeg
make
make install
OK ,本认为可以了,但编译swscale后,继续编译vlc,出错。
checking for ffmpeg/swscale.h... no
checking for POSTPROC... no
configure: error: Could not find libpostproc. Use --disable-postproc to ignore this error.
看报错在ffmpeg后面,该不会libpostproc也是ffmpeg到一个配置吧?
./configure --help|grep postproc
果然
--enable-postproc enable GPLed postprocessing support [no]
无奈
./configure --prefix=/usr/ffmpeg --enable-swscale --enable-postproc
postproc is gpl and --enable-gpl is not specified.
If you think configure made a mistake, make sure you are using the latest
version from SVN. If the latest version fails, report the problem to the
[email protected] mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "config.err" produced by configure as this will help
solving the problem.
不管了,也使能这项
./configure --prefix=/usr/ffmpeg --enable-swscale --enable-postproc --enable-gpl
命令编译ffmpeg
这可是第三次编译ffmpeg了!
到这步,认为不会有什么大错误了吧,结果 继续编译vlc:
提示缺少a52
checking for a52dec/a52.h... no
configure: error: Could not find liba52 on your system: you may get it from http://liba52.sf.net/. Alternatively you can use --disable-a52 to disable the a52 plugin.
按照提示,从地址 http://liba52.sf.net下载,
./configure --prefix=/usr
make
make install
编译好a52dec后,继续编译vlc
./configure --prefix=/usr --with-mad=/usr --with-a52=/usr
继续报错(疯了,555)
checking for FRIBIDI... configure: error: Package requirements (fribidi) were not met:
No package 'fribidi' found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables FRIBIDI_CFLAGS
and FRIBIDI_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
从网址:http://fribidi.org/下载fribidi,然后编译安装。
./configure --prefix=/usr
make
make install
继续编译
终于要成功了!
congratulations!
config.status: creating vlc-config
Enabled modules: a52tofloat32 a52tospdif access_alsa access_mmap access_oss adjust alphamask alsa aout_file aout_sdl atmo audio_format audioscrobbler avcodec avformat bandlimited_resampler blend blendbench bluescreen canvas cdda chain clone cmml colorthres converter_float crop croppadd dbus deinterlace dolby_surround_decoder dtstospdif dynamicoverlay equalizer erase extract fake fb float32_mixer folder freetype gaussianblur gestures glx gnutls gradient grain hal headphone_channel_mixer hotkeys http i420_rgb_mmx i420_rgb_sse2 i420_ymga i420_ymga_mmx i420_yuy2 i420_yuy2_mmx i420_yuy2_sse2 i422_i420 i422_yuy2 i422_yuy2_mmx i422_yuy2_sse2 inhibit invert linear_resampler logo magnify marq memcpy3dn memcpymmx memcpymmxext mosaic motion motionblur motiondetect mpgatofixed32 mux_ogg noise normvol notify ogg opengl opengl osd_parser osdmenu oss panoramix param_eq png podcast postproc probe_hal psychedelic puzzle qt4 rc remoteosd ripple rotate rss rv32 sap scale scaletempo scene screensaver sharpen shout showintf signals simple_channel_mixer skins2 spatializer spdif_mixer stream_out_raop swscale telepathy telnet telx transform unzip v4l2 vcd visual vmem vorbis vout_sdl wall wave x11 x11_screen xml xvideo yuv yuvp yuy2_i420 yuy2_i422 zip
libvlc configuration
--------------------
version : 1.1.5
system : linux
architecture : i686 mmx sse sse2
build flavour : devel
vlc aliases : cvlc rvlc svlc qvlc
plugins/bindings :
You can tune the compiler flags in vlc-config.
To build vlc and its plugins, type `./compile' or `make'.
继续
make (漫长等待)
make install(漫长等待)
OK , (这个时候你可以去查看VLC是否乖乖地躺在应用--影音选项里了)
一看没有图标,
google 下 ,
来编辑文件/usr/share/applications /vlc.desktop
[Desktop Entry]
Version=1.0
Name=Vlc Player
Comment=vlc player
GenericName=vlc
Exec=/root/soft/vlc/bin/vlc
Terminal=false
X-MultipleArgs=false
Type=Application
Icon=vlc48x48
Categories=AudioVideo;
MimeType=text/html;
StartupWMClass=Chromium
StartupNotify=true
X-Desktop-File-Install-Version=0.15
终于完成了,忙了一天,看去看看吧
vlc播放网上链接视频
(转载)
如果上面无效:可以用 yum :
先添加源Livna源仓库:#yum install livna
如果上面的命令执行失败的话,就用这一句:#rpm -ivh http://rpm.livna.org/livna-release.rpm
接下来添加Fusion源仓库:
#rpm -Uvh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm
#rpm -Uvh http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm
最后就是重头戏了:
#yum install mplayer-gui
#yum install xine
#yum install vlc
说实话,每次装这个都很头疼,这下总算找了个简单可行的办法!