After tossing the board for two days, I can finally play the video on the board.
First summarize a few points and put everyone in the pit:
1. To compile ffplay with the latest version of FFmpeg-3.4, use the SDL2 version, and the SDL1.2 version can no longer be used;
2. By viewing the source code, it is found that ffmpeg-3.0.11 and below use SDL1.2, but this version is still a bit high and has not been compiled in the past;
3. After cross-compiling the latest version of ffmpeg-3.4 and running it on the board, the following error appears: Could not initialize SDL - No available video device
(Did you set the DISPLAY variable?);
4. If the experiment of the latest version fails, choose the ffmpeg-2.4.14. version. When choosing the libx264 library, the latest version will also make an error. It seems incompatible, so choose x264-snapshot-20150630-2245-stable.tar.bz2;
Into the title:
libx264 cross compile
Download path https://download.videolan.org/pub/videolan/x264/snapshots/
Unzip, enter the directory
2015 version
CC=arm-linux-gnueabi-gcc ./configure --host=arm-linux-gnueabi -- prefix=/home/cui/allwinner/a83t/ffmpeg/libout/x264_2015 --cross-prefix=arm-linux-gnueabi- --enable-static --enable-shared --disable-opencl
make
make install
install successfully, generate The file is under /home/cui/allwinner/a83t/ffmpeg/libout/libx264
交叉编译SDL,然后再生成ffplay
编译SDL1.2
./configure --prefix=/home/cui/allwinner/a83t/ffmpeg/libout/sdl --host=arm-linux-gnueabi --enable-shared --disable-video-aalib --enable-video-dummy --enable-video-x11 --enable-video-fbcon --disable-video-directfb --disable-video-nanox --enable-video-qtopia --disable-video-ggi --enable-video-svga --enable-video-dga --disable-arts --disable-esd --disable-nasm --disable-joystick --disable-input-tslib --enable-alsa --disable-pulseaudio
make
make install
Compile ffmpeg2.4
./configure --cross-prefix=arm-linux-gnueabi- --enable-cross-compile --target-os=linux --cc=arm-linux-gnueabi-gcc --arch=arm --prefix=/home/cui/allwinner/a83t/ffmpeg/libout/ffmpeg2.4 --enable-shared --enable-static --enable-gpl --enable-nonfree --enable-ffmpeg --enable-ffprobe --enable-ffplay --enable-ffserver --enable-swscale --enable-pthreads --enable-avresample --disable-yasm --disable-stripping --enable-libx264 --extra-cflags=-I/home/cui/allwinner/a83t/ffmpeg/libout/x264_2015/include --extra-cflags=-I/home/cui/allwinner/a83t/ffmpeg/libout/sdl/include/SDL --extra-ldflags=-L/home/cui/allwinner/a83t/ffmpeg/libout/x264_2015/lib --extra-ldflags=-L/home/cui/allwinner/a83t/ffmpeg/libout/sdl/lib --extra-libs=-lSDL
Modify config.mak
Put SDL and FFPLAY in front of the configuration! remove;
make
make install
Then copy the generated library and ffplay to the development board, run, OK;
The development board runs:
ffplay /home/movie.mp4
Video can be played; a single error occurs, Audio write: Input/output error 375KB vq= 0KB sq= 0B f=0/0
If the voice is wrong, it may be because there is no voice library added, then cancel the voice,
ffplay -autoexit -an /home/movie.mp4
Exit after normal playback;
Also loop playback plus option
-loop 0 an infinite number of times
-loop 2 twice