MPlayer porting on ARM (s5pv210 Development Board)

Source: Internet
Author: User

MPlayer 1.0 has already brought most of the decoding libraries, such as ffmpeg, but the audio library comes with a very bad effect in s5pv210. It's good to use Libmad. So MPlayer The simplest transplant in arm-linux only needs to be ported to these two. The character interface is played after the migration.
Prepare before porting, install Arm-linux Cross compiler, and download mplayer-1.0rc2.tar.bz2 and Libmad packages (libmad-0.15.1b.tar.gz)

1. Installing Libmad
(1) Decompression Libmad
Unzip the Libmad bag (libmad-0.15.1b.tar.gz);
$ tar zxvf libmad-0.15.1b.tar.gz-c Libmad

(2) Enter the Libmad directory, enter the configuration command:
$ CD Libmad
$./configure--enable-fpm=arm--host=arm-linux--disable-shared--disable-debugging--prefix=/home/bamboo/testcode/ Libmad/lib CC=/OPT/CAOZHUDONG/BIN/ARMV4TL-CAOZHUDONG-LINUX-GNUEABI-GCC (to ensure that the ARM-LINUX-GCC path has already been export, otherwise the full path is given.) )

(3) Cross-compilation Libmad (run)
$ make
$ make Install
This allows you to see the/usr/local/arm/3.3.2/lib directory with the Include and Lib directories, which are Libmad related libraries.


2. Installing MPlayer
(1) Decompression MPlayer
Unzip the MPlayer bag (mplayer-1.0rc2.tar.bz2)
$ tar jxvf mplayer-1.0rc2.tar.bz2-c MPlayer

(2) Enter the MPlayer directory, enter the configuration command:
$ CD MPlayer
The key to/configure is the following configuration parameters. The configuration parameters of the RC2 version are slightly changed compared to the pre version, and the configuration parameters are as follows:
$./configure--CC=/OPT/CAOZHUDONG/BIN/ARMV4TL-CAOZHUDONG-LINUX-GNUEABI-GCC--HOST-CC=GCC--target=arm-linux-- Enable-static--disable-win32dll--disable-dvdread--enable-fbdev--disable-mencoder--disable-live--disable-mp3lib --enable-mad--enable-libavcodec_a--language=zh_cn--disable-armv5te--disable-armv6--with-extraincdir=/home/ Bamboo/testcode/libmad/lib/include--with-extralibdir=/home/bamboo/testcode/libmad/lib/lib

--CC: Cross-compilation tool, if not added to the environment variable, you must specify the full path
--target: In the pre release, this is described for--target and this configuration parameter:
===============================================
--target=arm-armv4l-linux This parameter to note is a three-part, the first part of ARM refers to the arch, which is set to arm, the second part of the armv4l refers to the specific version, this should be noted, Must be consistent with the platform directory name under the Libavcodec directory, otherwise the optimized code for this platform is not compiled (as I see it); The third part is the system platform.
===============================================
However, in the RC2 version, it is only necessary to--target=arm-linux this designation.

--enable-static: is to set up a static connection, do not need a bunch of chaotic dynamic library, especially for us, the novice is a lot of trouble. If you set this parameter, you do not have to set--prefix, and you do not have to perform the make install.
--prefix=/tmp/mplayer-rc2:make Install, the executable program is installed in the/TMP/MPLAYER-RC2 directory, do not write the executable program installed under the current directory.
--disable-win32dll: Disables Win32 dynamic link library support. In the pre release, this parameter is
--disable-dvdread: Disables Libdvdread.
--enable-fbdev: Support Fbdev, this must be selected.
--disable-mp3lib and--enable-mad:arm series of CPUs, generally no floating-point unit, and MPlayer MP3 decoding default use Mp3lib, this is a floating-point arithmetic library, on arm must not run, Using Ffmp3 or Libmad (requires external library Libmad support) should be fine. So we need to prohibit mencoder and enable Libmad.
--disable-mencoder: Disable encoding function. This feature is not required on the project and is forbidden to reduce the size. And I heard that compiling mencoder here will have a problem, I heard it, did not try.
--disable-live: Prohibit live 555 streaming media. (I don't know what to do with it.)
--enable-libavcodec_a: Enables static LIBAVCODEC decoding. In the pre release, this parameter is--enable-libavcodec.
--disable-armv5te--disable-armv6: Disables armv5te, armv6 instruction extension.
--with-extraincdir and-with-extralibdir: Specify the path to Libmad and Mad.h. The path of mad is added after the compile parameter-I and-l, which need to be specified after replacing Libmad (this path is the include and LIB directories generated when the first cross-compiling Libmad, it is critical that the first cross-compilation is not specified here, the error occurs).
Note: The--HOST-CC=GCC configuration parameter needs to be specified in the pre release. To compile some intermediate files that need to be executed on the host, such as CODEC-CFG, remember that they cannot be missing. However, this parameter can be omitted in the RC2 version.

(3). Cross-compilation MPlayer (run)
After the/configure, make is started.
$ make
There are a lot of errors during compilation, and here are some of the errors I compile and how to fix them.
Error (1)
./codec-cfg./etc/codecs.conf > Codecs.conf.h
./codec-cfg:1: Syntax Error:word Unexpected (expecting ")")
Workaround: Add--HOST-CC=GCC at Configure to resolve

Error (2)
MAKE[1]: * * * [ARMV4L/DSPUTIL_ARM_S.O] Error 1
MAKE[1]: Leaving directory '/root/mplayer-1.0rc2/libavcodec '
Make: * * [LIBAVCODEC/LIBAVCODEC.A] Error 2
The reason for the error is that the PLD instruction is only valid in ARMv5TE or above and invalid in 2440 (armv4l)
Pre-read PLD instructions
Function: Cache pre-read (Pld,preload), using PLD to instruct the storage system to read from the memory address specified in the following instructions, the storage system can use this method to speed up future memory access.
Workaround: Modify the MPLAYER-1.0RC2/LIBMPEG2/MOTION_COMP_ARM_S.S and MPLAYER-1.0RC2/LIBAVCODEC/ARMV4L/DSPUTIL_ARM_S.S the two error files, On the previous add:
#ifndef HAVE_PLD
. macro PLD Reg
. endm
#endif
and make it again.

(4) Cross-compile to generate executable program MPlayer, mounted with NFS file system Launch Development Board, mplayer support playing video files mp4,avi,asf, my own Board LCD screen is the same, so use video Converter to convert video resolution.
Start running MPlayer.
$./mplayer TEST.AVI-FRAMEDROP-QUIET-VF rotate=1,scale=320:240

MPlayer porting on ARM (s5pv210 Development Board)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.