Preparation
To compile the mplayer player, you need to download the source code first
zlib library source code http://zlib.net/ choose the latest version here
Then download the mplayer source code
mplayer source code http://www.mplayerhq.hu/MPlayer/releases/I choose version 1.2 here
Another point is that because my board is a 32-bit linux system, I also chose a 32-bit image for the virtual machine environment. If I choose a 64-bit image, I may need to install some 32-bit libraries when compiling.
Ubuntu 16.04.7 LTS (Xenial Xerus) https://releases.ubuntu.com/16.04/
Finally, the choice of the cross compiler is the latest version of the decompressed version of arm-none-linux-gnueabi-gcc
[ARM-Linux development] arm-none-Linux-gnueabi-gcc download and install - ZhangPYi - Blog Park (cnblogs.com) https://www.cnblogs.com/huty/p/8517621.html will not be installed in a virtual machine You can refer to this article of mine
zlib compile
First put the source code into the virtual machine, unzip it in any folder, and then create a folder zlib on the desktop to store the compiled library files
Go to the unzipped source code folder and cut it first
./configure --prefix=/home/lhh/桌面/zlib --shared --static
--prefix: Indicates the generated file storage path
After cutting, a makfile will be generated, open the mkfile, and change the compiler to arm-none-linux-gnueabi-gcc
then execute
make
make install
The file we want will be generated in the previously created zlib file.
mplayer compile
Open the decompressed mplayer source file
Also crop first
./configure --cc=arm-none-linux-gnueabi-gcc --ar=arm-none-linux-gnueabi-ar --ranlib=arm-none-linux-gnueabi-ranlib --disable-gui --target=arm-none-linux-gnueabi --host-cc=gcc --extra-cflags="-I/home/lhh/桌面/zlib/include" --extra-ldflags="-L/home/lhh/桌面/zlib/lib -Iz" --enable-fbdev --disable-mencoder
--extra-cflags: Linked files (ie just compiled zlib files)
directly after no problem
make -j4
Four threads compile together
Finally, an mplayer file will be generated in the current directory
actual effect
Finally, put the generated mplayer file into the development board/bin directory
Then you can play the video, I won’t talk about mplayer commands, there are a lot of them on the Internet