• To develop audio and video capture and streaming functionality on the RK3568 platform, compile and install FFmpeg and its dependency, the x264 library.
Dependency Installation
x264 Compilation and Installation
Extracting Source Code
tar xf x264-snapshot-20191217-2245-stable.tar.bz2
cd x264-snapshot-20191217-2245-stable/
Modify Configuration File
vi config.mak # Modify content to support cross-compilation
CC=aarch64-linux-gcc
LD=aarch64-linux-gcc -o
AR=aarch64-linux-ar rc
RANLIB=aarch64-linux-ranlib
STRIP=aarch64-linux-strip
Configuration and Compilation
./configure --host=arm-linux-gnueabihf --prefix=$PWD/tmp --enable-shared --disable-asm
make && make install
Compilation Error: aarch64-linux-ar: two different operation options specified
# Compilation error
aarch64-linux-ar: two different operation options specified
# Solution:
AR=aarch64-linux-ar cr # Using 'rc' will cause the above compilation error
Compilation Results
tree tmp/ # Generated bin/include/lib three folders and their contents
tmp/
├── bin
│ └── x264
├── include
│ ├── x264_config.h
│ └── x264.h
└── lib
├── libx264.so -> libx264.so.152
├── libx264.so.152
└── pkgconfig
└── x264.pc
FFmpeg Installation
Source Code
ney@test:~/tool$ tar xf ffmpeg-6.0.tar.bz2
ney@test:~/tool$ cd ffmpeg-6.0/
sudo ./configure --enable-cross-compile --cross-prefix=/home/ney/test/sdk419/RK356x/buildroot/output/rockchip_rk3568/host/bin/aarch64-linux- --arch=arm64 --target-os=linux --cc=/home/ney/test/sdk419/RK356x/buildroot/output/rockchip_rk3568/host/bin/aarch64-linux-gcc --prefix=$PWD/tmp --enable-pthreads --enable-ffmpeg --disable-ffplay --enable-swscale --disable-armv5te --disable-armv6 --disable-armv6t2 --disable-stripping --enable-libx264 --enable-gpl --extra-cflags=-I$PWD/../x264-snapshot-20191217-2245-stable/tmp/include --extra-ldflags=-L$PWD/../x264-snapshot-20191217-2245-stable/tmp/lib
Compilation Error: ERROR: x264 not found using pkg-config
# Copy x264.pc
cp ../x264-snapshot-20191217-2245-stable/tmp/lib/pkgconfig/x264.pc /usr/share/pkgconfig/
make && make install
ls -l tmp/ # Generated bin/include/lib/share four folders and their contents
make