主题 : 交叉编译 MPlayer-1.0rc3 配置文件 复制链接 | 浏览器收藏 | 打印
级别: 侠客
UID: 9105
精华: 0
发帖: 95
金钱: 755 两
威望: 307 点
贡献值: 0 点
综合积分: 190 分
注册时间: 2009-09-17
最后登录: 2017-09-13
楼主  发表于: 2010-09-22 23:07

 交叉编译 MPlayer-1.0rc3 配置文件

图片:
./configure \
--host-cc=gcc \
--cc=arm-linux-gnueabi-gcc \
--target=arm \
--enable-static \
--disable-win32dll \
--disable-dvdread \
--disable-dvdread-internal \
--disable-dvdnav \
--disable-libdvdcss-internal \
\
--disable-largefiles \
--disable-apple-remote \
--disable-apple-ir \
\
--disable-tv \
--disable-tv-v4l1 \
--disable-tv-v4l2 \
--disable-tv-bsdbt848 \
--disable-tv-teletext \
\
--disable-unrarexec \
\
--disable-macosx \
--disable-maemo \
--disable-macosx-finder \
\
--disable-macosx-bundle \
--disable-inet6       \
--disable-gethostbyname2  \
--disable-ftp          \
--disable-vstream      \
--disable-pthreads     \
--disable-w32threads   \
--disable-ass          \
--enable-rpath         \
\
--enable-fbdev \
--disable-mencoder \
--disable-live \
--enable-mad \
--enable-libavcodec_a


结果  李孝利的MV
级别: 圣骑士
UID: 44407
精华: 0
发帖: 386
金钱: 1945 两
威望: 389 点
贡献值: 0 点
综合积分: 772 分
注册时间: 2011-04-25
最后登录: 2014-08-25
1楼  发表于: 2012-03-14 15:39
移植Mplayer


Mplayer在Linux上安裝起來很方便,簡單的 configure,make一下,就裝好了,和QT的GUI配合,界面還是蠻友好的。Mplayer對媒體格式的廣泛支持,以及豐富的後期處理濾鏡,最新的版本更支持DIVX,H.264,MPEG4等最新的流媒體格式,可以實時在線播放視頻流,MPlayer大部分解碼庫都自帶了,如ffmpeg,但是自帶的音頻庫效果不好.換成使用libmad效果不錯.因此MPlayer在ARM-Linux的最簡單的移植只需要移植這兩個即可.移植後即進行字符界面的播放。

如果需要字幕支持.需要移植freetype庫.支持JPG皮膚需要 libjpeg庫,打開DVD光盤格式,需要dvdread,dvdnav等,支持pnm庫需要libpnm

MPlayer的面版主要採用X11支持.但移植X11需要大量工作,一般將其關掉。ARM版同樣可以加入live555支持,支持遠程的RTSP的流媒體播放器,方法同X86版類似。


一、開發環境

編譯系統:Linux12/kernel 2.6.32.24
開發板:Mini6410(nand 1024M,SDRAM 64M)
交叉編譯工具:arm-linux-gcc-4.5.1


實現mplayer,要從三方面著手:

1.編譯Kernel支持ALSA
2.編譯安裝libmad
3.User Mode支持./mplayer配置命令


二、移植Mplayer

1.移植準備
  a. 下載 libid3tag源代碼 (使用libid3tag -0.15.1b)
  b. 下載 libmad源代碼 (使用libmad-0.15.1b)
  c. 下載 Mplayer源代碼(使用Mplayer 1.0rc3)

2.編譯libid3tag
  a. 配置.configure
   #./configure --host=arm-linux --disable-shared --prefix=/usr/local/arm/4.5.1/lib CC="arm-linux-gcc"  \
      --disable-shared –enable-static \
      CPPFLAGS="-I/usr/local/arm/4.5.1/lib/include" \
      LDFLAGS="-L/usr/local/arm/4.5.1/lib/lib"
  b.編譯並安裝libid3tag
        #  make CC=arm-linux-gcc
        #  make CC=arm-linux-gcc install

這一步的目的是在/usr/local/arm/4.5.1/lib下生成lib目錄,在lib目錄下生成include和lib兩個檔夾,對應檔夾中生成id3tag.h和libid3tag.a檔,這兩個檔供mplayer編譯用。

3.編譯libmad
  a. 配置.configure
   #./configure --enable-fpm=arm --host=arm-linux --disable-shared --prefix=/usr/local/arm/4.5.1/lib CC="arm-linux-gcc"
   b. 編輯Makefile:將-fforce-men參數移除
       (原因是gcc 4.4 或者更高版本,已經將其去除了,所以會出現上面的錯誤!)
   c. 編譯並安裝libmad
   #  make CC=arm-linux-gcc
   #  make CC=arm-linux-gcc install

如果不先配置安裝libmad,則在make mplayer時出現找不到mad.h 錯誤,這一步的目的是在/usr/local/arm/4.5.1/lib下生成lib目錄,在lib目錄下生成include和lib兩個檔夾,對應檔夾中生成mad.h和libmad.a檔,這兩個檔供mplayer編譯用。?

4.編譯Mplayer

a. 配置.configure

# ./configure --host-cc=gcc --cc=arm-linux-gcc --target=arm --enable-static --disable-win32dll --disable-dvdread --disable-dvdread-internal --disable-dvdnav --disable-libdvdcss-internal --enable-fbdev --disable-mencoder --disable-live --disable-mp3lib --disable-mad --enable-libavcodec_a --language=zh_CN --disable-live 2>&1 | tee logfile

b. 編譯
#  make CC=arm-linux-gcc


測試
./mplayer *.mp3
./mplayer *.avi
./mplayer *.rmvb
[ 此帖被kazaya在2012-03-20 15:50重新编辑 ]
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
贡献值: 71 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
2楼  发表于: 2012-03-14 17:52
支持一下
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
级别: 新手上路
UID: 87590
精华: 0
发帖: 17
金钱: 85 两
威望: 17 点
贡献值: 0 点
综合积分: 34 分
注册时间: 2013-02-21
最后登录: 2014-03-04
3楼  发表于: 2013-02-22 10:22
rc3不知道如何提供libmad编译出来的mad.h和libmad.a的路径......
级别: 新手上路
UID: 96146
精华: 0
发帖: 46
金钱: 230 两
威望: 46 点
贡献值: 0 点
综合积分: 92 分
注册时间: 2013-09-06
最后登录: 2018-02-08
4楼  发表于: 2013-10-29 19:47
这其中的第一句:1.編譯Kernel支持ALSA
如何实现呢?
我现在编译,make的时候,出现libasound.a中找不到clock_gettime
上网搜索发现和alsa有关系。
这个问题该如何解决呢?
谢谢。
板子是210
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
贡献值: 71 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
5楼  发表于: 2013-10-29 23:02
这其中的第一句:1.編譯Kernel支持ALSA
如何实现呢?

这里指的是内核镜像里需要包含ALSA架构的音频驱动。如果你用的是光盘上的内核源代码,里面应该已经包含了。

我现在编译,make的时候,出现libasound.a中找不到clock_gettime

能否把你的步骤和完整的编译信息传上来?
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
级别: 新手上路
UID: 96146
精华: 0
发帖: 46
金钱: 230 两
威望: 46 点
贡献值: 0 点
综合积分: 92 分
注册时间: 2013-09-06
最后登录: 2018-02-08
6楼  发表于: 2013-10-30 09:03

 回 5楼(kasim) 的帖子

晚点我会回复这些代码的。
现在的问题是在fedora下面交叉编译的时候出现这些问题。
级别: 新手上路
UID: 96146
精华: 0
发帖: 46
金钱: 230 两
威望: 46 点
贡献值: 0 点
综合积分: 92 分
注册时间: 2013-09-06
最后登录: 2018-02-08
7楼  发表于: 2013-10-30 12:33

 回 5楼(kasim) 的帖子

具体内容请看附件。
libmad已经make成功了,按照二楼的方法。

说明一下,因为参考了网络上的其他编译方法,所以我这里用的是mplayer 1.0rc2,用rc3,其实也是这个结果,因为测试过的。

此外,在libmpeg2的中的motion_comp_arm_s.S文件开头,加入了如下内容:
#ifndef HAVE_PLD
.macro pld reg
.endm
#endif
@ motion_comp_arm_s.S
实际上,加与不加,编译结果都是一样的。
make的log在附件中。

./configure的时候,输出文件如下:
Detected operating system: Linux
Detected host architecture: arm
Checking for arm-linux-gcc version ... 4.5.1, ok
Checking for host cc ... gcc
Checking for cross compilation ... ./configure: line 1501: /tmp/mplayer-conf-5574-27036: cannot execute binary file
yes
Checking for assembler support of -pipe option ... yes
Checking for compiler support of named assembler arguments ... yes
Checking for .align is a power of two ... yes
Checking for ARMv5TE (Enhanced DSP Extensions) ... yes
Checking for ARMv6 (SIMD instructions) ... yes
Checking for iWMMXt (Intel XScale SIMD instructions) ... no
Checking for -lposix ... no
Checking for -lm ... yes
Checking for langinfo ... yes
Checking for language ... using en (man pages: en )
Checking for enable sighandler ... yes
Checking for runtime cpudetection ... no
Checking for restrict keyword ... __restrict
Checking for __builtin_expect ... yes
Checking for kstat ... no
Checking for posix4 ... no
Checking for lrintf ... yes
Checking for mkstemp ... yes
Checking for nanosleep ... yes
Checking for socklib ... yes
Checking for inet_pton() ... yes (using )
Checking for network ... yes
Checking for inttypes.h (required) ... yes
Checking for int_fastXY_t in inttypes.h ... yes
Checking for word size ... ./configure: line 2946: /tmp/mplayer-conf-5574-27036: cannot execute binary file

Checking for malloc.h ... yes
Checking for memalign() ... yes
Checking for alloca.h ... yes
Checking for mman.h ... yes
Checking for dynamic loader ... yes
Checking for dynamic a/v plugins support ... no
Checking for pthread ... yes (using -lpthread)
Checking for w32threads ... no (using pthread instead)
Checking for rpath ... no
Checking for iconv ... yes
Checking for soundcard.h ... yes (sys/soundcard.h)
Checking for sys/dvdio.h ... no
Checking for sys/cdio.h ... no
Checking for linux/cdrom.h ... yes
Checking for dvd.h ... no
Checking for termcap ... yes (using -lncurses)
Checking for termios ... yes (sys/termios.h)
Checking for shm ... yes
Checking for strsep() ... yes
Checking for vsscanf() ... yes
Checking for swab() ... yes
Checking for POSIX select() ... yes
Checking for gettimeofday() ... yes
Checking for glob() ... yes
Checking for setenv() ... yes
Checking for sys/sysinfo.h ... yes
Checking for pkg-config ... yes
Checking for Samba support (libsmbclient) ... no
Checking for tdfxfb ... no
Checking for s3fb ... no
Checking for tdfxvid ... no
Checking for xvr100 ... no
Checking for tga ... yes
Checking for md5sum support ... yes
Checking for bl ... no
Checking for DirectFB ... no
Checking for X11 headers presence ... yes
Checking for X11 ... no (check if the dev(el) packages are installed)
Checking for DPMS ... no
Checking for Xv ... no
Checking for XvMC ... no
Checking for Xinerama ... no
Checking for Xxf86vm ... no
Checking for XF86keysym ... no
Checking for DGA ... no
Checking for 3dfx ... no
Checking for OpenGL ... no
Checking for VIDIX ... no
Checking for /dev/mga_vid ... no
Checking for xmga ... no
Checking for GGI ... no
Checking for GGI extension: libggiwmh ... no
Checking for AA ... no
Checking for CACA ... no
Checking for SVGAlib ... no
Checking for FBDev ... yes
Checking for DVB ... no
Checking for DVB HEAD ... yes
Checking for zr ... no
Checking for PNG support ... yes
Checking for JPEG support ... yes
Checking for PNM support ... yes
Checking for GIF support ... no
Checking for VESA support ... no
Checking for SDL ... no
Checking for NAS ... no
Checking for DXR2 ... no
Checking for DXR3/H+ ... no
Checking for IVTV TV-Out ... no
Checking for V4L2 MPEG Decoder ... yes
Checking for OSS Audio ... yes
Checking for aRts ... no
Checking for EsounD ... no
Checking for Polyp ... no
Checking for JACK ... no
Checking for OpenAL ... no
Checking for ALSA audio ... yes (using alsa 1.0.x and alsa/asoundlib.h)
Checking for Sun audio ... no
Checking for VCD support ... yes
Checking for dvdread ... no
Checking for internal libdvdcss ... no
Checking for cdparanoia ... no
Checking for libcdio ... no
Checking for bitmap font support ... yes
Checking for freetype >= 2.0.9 ... no
Checking for fontconfig ... no (freetype support needed)
Checking for SSA/ASS support ... no (FreeType support needed)
Checking for fribidi with charsets ... no
Checking for ENCA ... no
Checking for zlib ... yes
Checking for RTC ... yes
Checking for liblzo2 support ... no
Checking for mad support ... yes
Checking for Twolame ... no
Checking for Toolame ... no
Checking for OggVorbis support ... yes (internal Tremor)
Checking for libspeex (version >= 1.1 required) ... no
Checking for OggTheora support ... no
Checking for internal mp3lib support ... no
Checking for internal liba52 support ... yes
Checking for libdca support ... no
Checking for internal libmpeg2 support ... yes
Checking for libmpcdec (musepack, version >= 1.2.1 required) ... no
Checking for FAAC (AAC encoder) support ... no (in libavcodec: )
Checking for FAAD2 (AAC) support ... yes (internal floating-point)
Checking for LADSPA plugin support ... no
Checking for Win32 codecs ... no
Checking for XAnim codecs ... yes (using /usr/local/arm/4.5.1/lib/codecs)
Checking for RealPlayer codecs ... yes (using /usr/local/arm/4.5.1/lib/codecs)
Checking for QuickTime codecs ... auto
Checking for Nemesi Streaming Media libraries ... no
Checking for LIVE555 Streaming Media libraries ... no
Checking for FFmpeg libavutil ... yes (static)
Checking for FFmpeg libavcodec ... yes (libavcodec.so is discouraged over static libavcodec)
Checking for FFmpeg libavformat ... yes (static)
Checking for FFmpeg libpostproc ... yes (static)
Checking for libamr narrowband ... no
Checking for libamr wideband ... no
Checking for libdv-0.9.5+ ... no
Checking for XviD ... no
Checking for x264 ... no (in libavcodec: no)
Checking for libnut ... no
Checking for mencoder ... no
Checking for fastmemcpy ... yes
Checking for UniquE RAR File Library ... yes
Checking for TV interface ... yes
Checking for Video 4 Linux TV interface ... yes
Checking for Video 4 Linux 2 TV interface ... yes
Checking for TV teletext interface ... no
Checking for Radio interface ... no
Checking for Capture for Radio interface ... no
Checking for Video 4 Linux 2 Radio interface ... no
Checking for Video 4 Linux Radio interface ... no
Checking for Video 4 Linux 2 MPEG PVR interface ... yes
Checking for audio select() ... yes
Checking for ftp ... yes
Checking for vstream client ... no
Checking for byte order ... little-endian
Checking for OSD menu ... no
Checking for Subtitles sorting ... yes
Checking for XMMS inputplugin support ... no
Checking for inet6 ... yes
Checking for gethostbyname2 ... yes
Checking for GUI ... no
Checking for automatic gdb attach ... no
Checking for compiler support for noexecstack ... yes
Checking for joystick ... no
Checking for lirc ... no
Checking for lircc ... no
Checking for maemo (Nokia 770) ... no
Checking for color console output ... no
Checking for DVD support (libdvdnav) ... no
Creating config.mak
Creating config.h

Config files successfully generated by ./configure --host-cc=gcc --cc=arm-linux-gcc --target=arm-linux --enable-static --disable-win32dll --disable-dvdread --disable-dvdread-internal --disable-dvdnav --disable-libdvdcss-internal --enable-fbdev --disable-mencoder --disable-live --disable-mp3lib --enable-mad --enable-libavcodec_a --disable-live --disable-ivtv --prefix=/usr/local/arm/4.5.1 !

  Install prefix: /usr/local/arm/4.5.1
  Data directory: /usr/local/arm/4.5.1/share/mplayer
  Config direct.: /usr/local/arm/4.5.1/etc/mplayer

  Byte order: little-endian
  Optimizing for:

  Languages:
    Messages/GUI: en
    Manual pages: en  

  Enabled optional drivers:
    Input: ftp pvr tv-v4l2 tv-v4l tv vcd dvb network
    Codecs: libavcodec real xanim faad2 libmpeg2 liba52 tremor(internal) libmad
    Audio output: alsa oss v4l2 mpegpes(dvb)
    Video output: v4l2 pnm jpeg png mpegpes(dvb) fbdev md5sum tga
    Audio filters:
  Disabled optional drivers:
    Input: dvdnav vstream radio tv-teletext live555 nemesi cddb cdda libdvdcss(internal) dvdread smb
    Codecs: x264 xvid libdv libamr_wb libamr_nb qtx win32 faac musepack libdca mp3lib libtheora speex toolame twolame liblzo gif
    Audio output: sun openal jack polyp esd arts ivtv dxr2 nas sdl
    Video output: ivtv dxr3 dxr2 sdl vesa gif89a zr zr2 svga caca aa ggi xmga mga xvidix winvidix cvidix opengl 3dfx dga xvmc xv x11 dfbmga directfb bl xvr100 tdfx_vid s3fb tdfxfb
    Audio filters: ladspa

'config.h' and 'config.mak' contain your configuration options.
Note: If you alter theses files (for instance CFLAGS) MPlayer may no longer
      compile *** DO NOT REPORT BUGS if you tweak these files ***

'make' will now compile MPlayer and 'make install' will install it.
Note: On non-Linux systems you might need to use 'gmake' instead of 'make'.

NOTE: Win32 codec DLLs are not supported on your CPU (arm) or your
operating system (Linux). You may encounter a few files that cannot
be played due to missing open source video/audio codec support.

Check configure.log if you wonder why an autodetection failed (make sure
development headers/packages are installed).

NOTE: The --enable-* parameters unconditionally force options on, completely
skipping autodetection. This behavior is unlike what you may be used to from
autoconf-based configure scripts that can decide to override you. This greater
level of control comes at a price. You may have to provide the correct compiler
and linker flags yourself.
If you used one of these options (except --enable-gui and similar ones that
turn on internal features) and experience a compilation or linking failure,
make sure you have passed the necessary compiler/linker flags to configure.

If you suspect a bug, please read DOCS/HTML/en/bugreports.html.
附件: makelog.zip (20 K) 下载次数:9
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
贡献值: 71 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
8楼  发表于: 2013-10-30 14:02

 回 7楼(mukguchina) 的帖子

从命令"readelf -s /opt/FriendlyARM/toolschain/4.5.1/arm-none-linux-gnueabi/lib/librt-2.11.so |grep clock_gettime"的输出来看,clock_gettime()应该是包含在librt-2.11.so里的:
    75: 00003818   112 FUNC    GLOBAL DEFAULT   12 clock_gettime@@GLIBC_2.4
   153: 00000000     0 FILE    LOCAL  DEFAULT  ABS clock_gettime.c
   340: 00003818   112 FUNC    LOCAL  HIDDEN    12 __GI_clock_gettime
   364: 00003818   112 FUNC    GLOBAL DEFAULT   12 clock_gettime

你可以在命令行上手动执行

arm-linux-gcc -o mplayer mplayer.o m_property.o mp_fifo.o mp_msg.o mixer.o parser-mpcmd.o subopt-helper.o command.o asxparser.o codec-cfg.o cpudetect.o edl.o find_sub.o get_path.o m_config.o m_option.o m_struct.o mpcommon.o parser-cfg.o playtree.o playtreeparser.o spudec.o sub_cc.o subreader.o vobsub.o unrarlib.o libvo/libvo.a libao2/libao2.a input/libinput.a libmpcodecs/libmpcodecs.a libaf/libaf.a libmpdemux/libmpdemux.a stream/stream.a libswscale/libswscale.a libvo/libosd.a libavformat/libavformat.a libavcodec/libavcodec.a libavutil/libavutil.a libpostproc/libpostproc.a liba52/liba52.a libmpeg2/libmpeg2.a libfaad2/libfaad2.a tremor/libvorbisidec.a osdep/libosdep.a  -Wl,-z,noexecstack    -lncurses -lpng -lz -ljpeg -lasound -ldl -lpthread -lz -lmad -lpthread -ldl -lrt -rdynamic -static -lm

来验证加上"-lrt"是否能解决问题
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
级别: 新手上路
UID: 96146
精华: 0
发帖: 46
金钱: 230 两
威望: 46 点
贡献值: 0 点
综合积分: 92 分
注册时间: 2013-09-06
最后登录: 2018-02-08
9楼  发表于: 2013-10-30 15:26

 回 8楼(kasim) 的帖子

貌似有了。现在有事。等会儿卡看。
按照你给的指令,输出如下:
/opt/FriendlyARM/toolschain/4.5.1/arm-none-linux-gnueabi/sys-root/usr/lib/libasound.a(pcm_multi.o): In function `snd_pcm_multi_hwsync':
pcm_multi.c:(.text+0x1274): warning: Warning: snd_pcm_hwsync() is deprecated, consider to use snd_pcm_avail()
libmpcodecs/libmpcodecs.a(ad_realaud.o): In function `preinit':
ad_realaud.c:(.text+0x1f8): warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/opt/FriendlyARM/toolschain/4.5.1/arm-none-linux-gnueabi/sys-root/usr/lib/libasound.a(pcm_direct.o): In function `snd1_pcm_direct_parse_open_conf':
pcm_direct.c:(.text+0x5138): warning: Using 'getgrnam' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
stream/stream.a(network.o): In function `check4proxies':
network.c:(.text+0x13c): warning: Using 'gethostbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
stream/stream.a(tcp.o): In function `connect2Server_with_af':
tcp.c:(.text+0x120): warning: Using 'gethostbyname2' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking