MPlayer 1.0 has brought most of the decoding libraries, such as FFmpeg, But the audio library that comes with it is very bad in s3c2440. It's good to use Libmad. So the simplest transplant for mplayer in Arm-linux only needs to be ported. The character interface is played after the transplant.
However, the full version requires the following libraries. If subtitles support is required. The FreeType library needs to be ported. Support JPG skins need libjpeg library, open DVD disc format, need Dvdread,dvdnav etc, support PNM library need LIBPNM MPlayer's skin is mainly supported by X11. But porting X11 requires a lot of work. The MPlayer also supports SDL, but the actual measurements do not support skin display. Normally turn it off. ARM version can also join LIVE555 support, support remote RTSP streaming Media Player, the method is similar to version X86.simple transplant of MPlayerIn accordance with the migration specification, Libmad in the Libs directory, mplayer itself under the project directory.Transplant of LibmadCC=ARM-LINUX-GCC./configure--prefix= $PWD/.. /.. /output/arm_linux--enable-fpm=arm --host=arm-linux--disable-debugging--enable-shared--enable-static Modify makefile Remove 129 lines-fforce-memFlag, because the Arm-eabi compiler does not support this option, otherwise it will be an error. Make make InstallTransplant of MPlayer 0. DownloadMPlayer V1.0RC2
http://www1.mplayerhq.hu/MPlayer/releases/MPlayer-1.0rc2.tar.bz2Compilation Environment:In ARM-LINUX-GCC 3.3.2 +arm-linux 2.6.13. ARM-LINUX-GCC 4.3.2 + arm-linux 2.6.29 arm-linux-gcc 4.3.3 + arm-linux 2.6.30 are tested.1. Generate Makefile
./configure--prefix= $PWD/.. /output/arm_linux--cc=arm-linux-gcc --ar=arm-linux-ar / --ranlib=arm-linux-ranlib-- disable-gui / --target=arm-armv4-linux--host-cc=gcc --disable-freetype / --enable-fbdev --disable-mencoder--disable-sdl--disable-live --disable-dvdread/ --disable-libdvdcss-internal--disable-x11 --enable-cross-compile -- Disable-mp3lib / --enable-mad --with-extraincdir= "$PWD/... /output/arm_linux/include " --with-extralibdir=" $PWD/.. /output/arm_linux/lib "/ --disable-dvdnav --disable-dvdread-internal -- Disable-jpeg--disable-tga/ --disable-dvbhead--disable-pnm--disable-tv--DISABLE-IVTV/ -- Disable-fontconfig--disable-xanim--disable-win32dll--disable-armv5te--disable-armv6 |
Transplant note. MPlayer does not support common--host to modify the compilation tool prefix. It must be modified with--CC,--ar,--ranlib such parameters. and cross-compiling.
--enable-cross-compileis a must. --disable-gui close the graphical interface, only using the character interface control--disable-mp3lib is to turn off the default MP3 decoding library,--Enable-mad is to use Libmad support. --disable-dvbhead--disable-dvdread--disable-dvdnav--disable-dvdread-internal are DVD-related libraries, the basic version can not be installed. --disable-x11
--enable-fbdevTurn off the X11 video output and turn on framebuffer support. ARM development boards are required. --enable-static if the use of static compilation size is about 8M, dynamic compilation is more than 6M, this may be either way of compiling, MPlayer will bring the decoding library to itself, more than 2M should be the size of the system standard library.
2. Compiling:
If there is a compilation error, modify the source code under some compiler, will be prompted to find the intptr_t definition, if this is the libavcodec/bitstream.h:181 line, add the following statement.
#if defined (arch_armv4l) typedef int32_t intptr_t; /* Add by Andrew huang*/ #endif
|
Otherwise, the following compilation error is generated, intptr_t is defined in standard C, but is not found here, so it is defined directly:
Arm-linux-gcc-i. /libswscale-i. /libavcodec-dhave_av_config_h-d_file_offset_bits=64-d_largefile_source-d_isoc9x_source-i. -I.. -I.. /libavutil-wdisabled-optimization-wno-pointer-sign-wdeclaration-after-statement-i.-I.. -I.. /libavutil-wall-wno-switch-wpointer-arith-wredundant-decls-o4-pipe-ffast-math-fomit-frame-pointer-d_largefile_ Source-d_file_offset_bits=64-d_largefile64_source-dhave_config_h-i/usr/x11r6/include-c-O cyuv.o cyuv.c Cc1:warning:include location "/usr/x11r6/include" are unsafe for cross-compilation In file included from Mpegvideo.h:32, From cyuv.c:38: bitstream.h:in function ' put_bits ': bitstream.h:233:error: ' intptr_t ' undeclared ( first use of this function) Bitstream.h:233:error: (Each undeclared identifier was reported only once Bitstream.h:233:error:for each function it appears in.) Bitstream.h:233:error:expected ') ' before ' bitstream.h:in function ' init_get_bits ': Bitstream.h:777:error: ' intptr_t ' undeclared (first use of this function) Bitstream.h:777:error:expected ') ' before ' ' buffer ' Bitstream.h:778:error:expected ') ' before ' ' buffer ' MAKE[1]: * * * [CYUV.O] Error 1 |
Remove support from arm PLD instructions
Modify Source LIBAVCODEC/ARMV4L/DSPUTIL_ARM_S.S, LIBMPEG2/MOTION_COMP_ARM_S.S
At the beginning of its accession, this code means to define an empty ARM assembly macro PLD, so that when the code appears PLD instruction, it becomes an empty instruction
#ifndef HAVE_PLD . macro PLD Reg . endm #endif |
The PLD directive is only valid for versions above ARMv5TE and 2440 (armv4l) is invalid. Must be canceled, the format of this instruction is
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.Format: Pld[rn,{offset}] which The base register of the Rn memory. Offset added to the RN. Meaning the same as 3. 2. 3 Section 1th instruction. |
If not canceled, the following error will be generated
Arm-linux-gcc-i. /libswscale-i. /libavcodec -dhave_av_config_h-d_file_offset _bits=64 -d_largefile_source-d_isoc9x_source-i. -I.. -I.. /libavutil-wdisable D-optimization-wno-pointer-sign- Wdeclaration-after-statement-i.-I.. -I.. /lib & nbsp; Avutil-wall-wno-switch-wpointer-arith- wredundant-decls-o4 -pipe-ffast-ma TH- fomit-frame-pointer-d_reentrant-dhave_config_h-i/home/workspace/mplayer/m player-1.0rc2/. /output/linux_arm/include-i/usr/x11r6/include -c-o armv4l/dsp UTIL_ARM_S.O ARMV4L/DSPUTIL_ARM_S.S Cc1:warning:include location "/usr/x11r6/include" are unsafe for Cross-compilat Ion Armv4l/dsputil_arm_s.s:assembler messages: Armv4l/dsputil_arm_s.s:79:error:selected processor does not support ' PLD [R1] ' Armv4l/dsputil_arm_s.s:90:error:selected processor does not support ' PLD [R1] ' Armv4l/dsputil_arm_s.s:100:error:selected processor does not support ' PLD [R1] '' Armv4l/dsputil_arm_s.s:111:error:selected processor does not support ' PLD [R1] '' Armv4l/dsputil_arm_s.s:122:error:selected processor does not support ' PLD [R1] '' Armv4l/dsputil_arm_s.s:141:error:selected processor does not support ' PLD [R1] |
Make
Modify the Make install bug
When you execute make install, you are prompted
install-m 755-s mplayer/home/hxy/mplayer/ mplayer-1.0rc2/. /output/arm_linux/bin strip:unable to recognise the format of the input file '/home/hxy/mplayer/mplayer-1.0rc2/. /output/arm_linux/bin/mplayer ' |
Check the data to see the install with the-s parameter will automatically call strip to strip the application. But the arm compiles to call Arm-linux-strip to handle correctly. The workaround is to cancel the-s parameter and view makefile to find that-S is as follows
$ (INSTALL)-M 755 $ (Installstrip) mplayer$ (Exesuf) $ (BINDIR)
Installstrip is set, it defaults to-s, so as long as simple in front of the makefile (95 lines) to join
Installstrip: = #将其置为空即可惟
4. implementation :
Export Ld_library_path=${lib};. /mplayer -ac Mad Demo.mpg
Where $lib is the path to the library that holds the MPlayer required-ac mad is a must, which means to force decoding with Libmad.
This is my successful execution of a script:
Export App_root=/mnt/nfs/mplayer/output/arm_linux
|
The test mpg,avi,mp3,mp4 can be played, which by default is played at the original resolution of the video. If you want MPlayer to be fully displayed on the LCD, you can use the video filter parameter scale to set
./MPLAYER-VF scale=240:320
Someone else tested hair now has some development boards under it. After the MPlayer is played, the output interferes with subsequent shell execution lines. Use the following long parameters generally nothing
Export app_root=/mnt/nfs/mplayer/output/arm_linux
export ld_library_path= $APP _root,oot/lib;. /mplayer-ac Mad 2.mpg-quiet/ |
If you are unsure of your resolution, you can use the-fullscreen parameter in MPlayer. Or execute the busybox shell command Fbset View the resolution of self-n plates