搜索
bottom↓
回复: 2

【原创】Fedora10下源码编译vlc-1.1.1成功,附傻瓜操作

[复制链接]

出0入0汤圆

发表于 2010-9-15 12:02:30 | 显示全部楼层 |阅读模式
经师兄介绍后经常在论坛逛,没做过什么贡献,现把自己的一个学习经历记录下来,略表心意希望有所弥补,跟大家帖子比起来技术含量偏低,欢迎大家拍砖

在samtao兄文章的指导下完成vlc的源码编译安装,小生感激涕零,自知忘性>记性,且老板要求留存编译流程以备后者,故备忘如下,如能令他人少走弯路节省时间,善莫大焉:

1:下载vlc的source code版本。
(samtao兄用的是1.0.6,等小生下载的时候已经是1.1.1版本,但编译安装过程无区别)

2:为了让root用户可以执行VLC,我们需要加上 --enable-run-as-root(本人以root登录,没加也没问题)
ps:可以执行如下:[root@tsong vlc-1.0.6]# ./configure --help|grep root  查看该命令怎么写
(samtao兄写的比较快,如果你是跟我差不多的linux菜鸟,你需要知道./configure编译命令之前还有tar -jxvf ****.tar.bz(或bz2)解压,用CD命令进入解压缩后的文件夹等)
编译命令:./configure --enable-run-as-root --prefix=/root/soft/vlc
(--prefix=/root/soft/vlc 这个是安装目录,可以自己定义更改)
提示缺少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 后,在这个mad错误之前还出现这个错误
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后提示:
Package lua-5.1.4-2.fc10.i386 already installed and latest version
后来才知道应当安装lua-devel,安装后解决了这个问题,后面的fribidi-devel小生也是这时候安装的)

3:编译libmad.
按照提示,下载:http://www.underbit.com/products/mad,编译
./configure --prifix=/root/soft/libmad
make 提示错误(这个make错误小生没遇到,应该是gcc没及时更新,懒人有懒福)
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
(此时libmad安装在/root/soft/libmad文件夹内)

4:继续编译vlc,这时候用如下命令:
./configure --enable-run-as-root --prefix=/root/soft/vlc --with-mad=/root/soft/libmad/
继续,提示找不到libavcodec,
configure: error: Could not find libavcodec or libavutil. Use --disable-avcodec to ignore this error.

5:编译libavcodec.
下载,编译:http://www.ffmpeg.org/download.html
./configure --prifix=/root/soft/ffmpeg
make
编译过程极其漫长
完成之后输入make install即OK
作为一个过来者,我建议用下面这个命令编译:
./configure --prefix=/root/soft/ffmpeg --enable-swscale --enable-postproc --enable-gpl
否则,你将不得不执行步骤7和步骤8。 (这个操作特别有效,学习了)

6:继续编译,不用置疑,一定还是会提示libavcodec找不到,why?因为你放的目录程序找不到。这时候就要用到pkg-config了
export PKG_CONFIG_PATH="/usr/lib/pkgconfig:/usr/local/lib/pkgconfig:/root/soft/ffmpeg/lib/pkgconfig"
(在Terminal输入上述代码,Enter,当然要注意你的安装位置是否跟上面相同)
export完成之后,我们可以测试一下:
[root@tsong vlc-1.0.6]# pkg-config --modversion libavcodec
52.20.1
如果可以打印出版本信息,那么OK,就可以继续编译了

7:继续编译。
编译命令还是
./configure --enable-run-as-root --prefix=/root/soft/vlc --with-mad=/root/soft/libmad/
继续提示缺少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到一个选项,默认在编译到时候没有启用。
[root@tsong ffmpeg-0.5.1]# ./configure --help|grep swscale
--enable-swscale enable GPLed software scaler support [no]
无奈,只好继续返回步骤5,用如下命令:
[root@tsong ffmpeg-0.5.1]# ./configure --prefix=/root/soft/ffmpeg --enable-swscale
然后再重复再编译安装ffmpeg
make
make install

8:完成步骤7中到swscale后,继续编译。
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到一个配置?
[root@tsong ffmpeg-0.5.1]# ./configure --help|grep postproc
--enable-postproc enable GPLed postprocessing support [no]
[root@tsong ffmpeg-0.5.1]# ./configure --prefix=/root/soft/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
ffmpeg-user@mplayerhq.hu 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.
[root@tsong ffmpeg-0.5.1]# ./configure --prefix=/root/soft/ffmpeg --enable-swscale --enable-postproc --enable-gpl
无语,继续用./configure --prefix=/root/soft/ffmpeg --enable-swscale --enable-postproc --enable-gpl 命令编译ffmpeg
这可是第三次编译ffmpeg了!

9:继续编译:提示缺少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=/root/soft/a52dec
make
make install

10:编译好a52dec后,我们继续编译vlc
./configure --enable-run-as-root --prefix=/root/soft/vlc --with-mad=/root/soft/libmad/ --with-a52=/root/soft/a52dec/
11:
继续报错(这个本人之前乱搞的时候安装了)
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,然后编译安装。
[root@tsong fribidi-0.10.9]# ./configure --prefix=/root/soft/fribidi
make
make install

12:如步骤6,还是需要修改PKG_CONFIG_PATH,使之包含刚刚安装的fribidi
export PKG_CONFIG_PATH="/usr/lib/pkgconfig:/usr/local/lib/pkgconfig:/root/soft/ffmpeg/lib/pkgconfig:/root/soft/fribidi/lib/pkgconfig"
继续编译

13:继续报错(这个本人之前乱搞的时候安装了)
----------My god,我快失去耐心了。好在马上就结束了
checking for QT4... no
configure: WARNING: Qt 4 library not found
configure: error: The skins2 module depends on a the Qt4 development package. Without it you won't be able to open any dialog box from the interface, which makes the skins2 interface rather useless. Install the Qt4 development package or alternatively you can also configure with: --disable-qt4 --disable-skins2.
下载QT4,http://qt.nokia.com/downloads-cn 这又是一个大家伙,将近400MB呢,好在我之前已经下载编译好了,现在要做的就是指定pkg-config就可以了

14:还是让pkg-config可以找到qt4就可以了(/opt/qtsdk/qt/lib/pkgconfig)
export PKG_CONFIG_PATH="/usr/lib/pkgconfig:/usr/local/lib/pkgconfig:/root/soft/ffmpeg/lib/pkgconfig:/root/soft/fribidi/lib/pkgconfig:/opt/qtsdk/qt/lib/pkgconfig"

15: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.0.6
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'.

16:很遗憾,编译的时候再次出现错误提示:(这个小生没遇到,估计是因为以前把软件都乱装在了root)
ERROR : src/ft2_font.cpp:30: 29: fribidi/fribidi.h: No such file or directory
src/ft2_font.cpp: In member function 'virtual GenericBitmap* FT2Font::drawString(const UString&, uint32_t, int) const':
ERROR : src/ft2_font.cpp: 157: 'FriBidiCharType' was not declared in this scope
google:http://svn.tribler.org/vlc/trunk/modules/gui/skins2/src/ft2_font.cpp
查找代码ft2_font.cpp,在目录/root/download/vlc-1.0.6/modules/gui/skins2/src 下,看到了
#include <fribidi/fribidi.h>
因为我们的fribidi是安装在/root/soft/fribidi目录,不是默认安装在/usr/include目录,那么建立符号链接!
[root@tsong include]# ln -s /root/soft/fribidi/include/fribidi/ fribidi
[root@tsong include]# pwd
/usr/include

17:继续
make         (漫长等待)
make install(漫长等待)

18:done   (这个时候你可以去查看VLC是否乖乖地躺在Applications--Sound&Video的选项里了)

19:编辑文件/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
(fedora 10下vlc播放网上链接视频的速度不及在XP下快,后续再看看)

阿莫论坛20周年了!感谢大家的支持与爱护!!

知道什么是神吗?其实神本来也是人,只不过神做了人做不到的事情 所以才成了神。 (头文字D, 杜汶泽)

出0入0汤圆

发表于 2010-9-16 16:39:47 | 显示全部楼层
?

出0入0汤圆

发表于 2011-6-3 16:23:21 | 显示全部楼层
楼主你好,我按你说的做,做到最后一步17步make install出现问题啊。求群主帮忙看看:
Libraries have been installed in:
   /home/kathy/vlc-1.1.9/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
test -z "/home/kathy/vlc-1.1.9/include/vlc" || /bin/mkdir -p "/home/kathy/vlc-1.1.9/include/vlc"
/usr/bin/install -c -m 644 ../include/vlc/libvlc_version.h '/home/kathy/vlc-1.1.9/include/vlc'
/usr/bin/install: `../include/vlc/libvlc_version.h' and `/home/kathy/vlc-1.1.9/include/vlc/libvlc_version.h' are the same file
make[5]: *** [install-nodist_pkgincludeHEADERS] Error 1
make[5]: Leaving directory `/home/kathy/vlc-1.1.9/src'
make[4]: *** [install-am] Error 2
make[4]: Leaving directory `/home/kathy/vlc-1.1.9/src'
make[3]: *** [install-recursive] Error 1
make[3]: Leaving directory `/home/kathy/vlc-1.1.9/src'
make[2]: *** [install] Error 2
make[2]: Leaving directory `/home/kathy/vlc-1.1.9/src'
make[1]: *** [install-recursive] Error 1
make[1]: Leaving directory `/home/kathy/vlc-1.1.9'
make: *** [install] Error 2
回帖提示: 反政府言论将被立即封锁ID 在按“提交”前,请自问一下:我这样表达会给举报吗,会给自己惹麻烦吗? 另外:尽量不要使用Mark、顶等没有意义的回复。不得大量使用大字体和彩色字。【本论坛不允许直接上传手机拍摄图片,浪费大家下载带宽和论坛服务器空间,请压缩后(图片小于1兆)才上传。压缩方法可以在微信里面发给自己(不要勾选“原图),然后下载,就能得到压缩后的图片。注意:要连续压缩2次才能满足要求!!】。另外,手机版只能上传图片,要上传附件需要切换到电脑版(不需要使用电脑,手机上切换到电脑版就行,页面底部)。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|Archiver|amobbs.com 阿莫电子技术论坛 ( 粤ICP备2022115958号, 版权所有:东莞阿莫电子贸易商行 创办于2004年 (公安交互式论坛备案:44190002001997 ) )

GMT+8, 2024-7-23 13:23

© Since 2004 www.amobbs.com, 原www.ourdev.cn, 原www.ouravr.com

快速回复 返回顶部 返回列表