Closed Kevin111369 closed 7 months ago
It seems to be an environment variable or configure setting issue. Please refer to the official documentation, as well as BtbN/FFmpeg-Builds to learn how to cross-compile FFmpeg correctly.
sudo apt install pkg-config
@Kevin111369 You can try something like this. I tested on WSL2 (Ubuntu 22.04).
PKG_CONFIG_SYSROOT_DIR=/root/mtea-tech/rk3568l/buildroot/output/rockchip_rk3568/host/aarch64-buildroot-linux-gnu/sysroot \
PKG_CONFIG_PATH=/root/mtea-tech/rk3568l/buildroot/output/rockchip_rk3568/host/aarch64-buildroot-linux-gnu/sysroot/usr/lib/pkgconfig \
./configure --prefix=prefix --enable-gpl --enable-version3 --enable-libdrm --enable-rkmpp --enable-rkrga \
--cross-prefix=/root/mtea-tech/rk3588l/buildroot/output/rockchip_rk3588/host/bin/aarch64-linux- \
--arch=aarch64 --target-os=linux --enable-cross-compile --target-os=linux --disable-shared --pkg-config=pkg-config
@jacobbtbailey I added the paths to libdrm and mpp when configuring configure, and then successfully compiled ffmpeg-rockchip. The compilation script is as follows:
#!/bin/bash
# 设置路径变量
LIBDRM_PATH="/home/rk/linux/3rdparty/output/libdrm"
MPP_PATH="/home/rk/linux/3rdparty/output/mpp"
RGA_PATH="/home/rk/linux/3rdparty/output/librga"
TOOLCHAIN_PATH="/home/rk/linux/rk3588_sdk/prebuilts/gcc/linux-x86/aarch64/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-"
PREFIX_PATH="/home/rk/linux/3rdparty/output/ffmpeg"
# 设置 PKG_CONFIG_PATH
export PKG_CONFIG_PATH="$LIBDRM_PATH/lib/pkgconfig:$MPP_PATH/lib/pkgconfig:$PKG_CONFIG_PATH"
# 运行 configure 脚本
./configure \
--enable-shared \
--enable-static \
--prefix=$PREFIX_PATH \
--enable-cross-compile \
--cross-prefix=$TOOLCHAIN_PATH \
--arch=aarch64 \
--target-os=linux \
--enable-gpl \
--enable-version3 \
--enable-libdrm \
--enable-rkmpp \
--extra-cflags="-I$RGA_PATH/include" \
--extra-ldflags="-L$RGA_PATH/lib" \
--enable-rkrga \
--disable-stripping \
--pkg-config="pkg-config --static"
Thank you for your reply!
@Kevin111369 will you post all the build script (contain rkmpp and libdrm cross compile steps)
@Kevin111369 will you post all the build script (contain rkmpp and libdrm cross compile steps)
Sorry, I won't post these scripts, because I didn't use ffmpeg-rockchip in video development, but used ffmpeg+mpp
@Kevin111369 Thanks for your reply. Did you cross compile rkmpp and libdrm, can you provide steps?
Cross-compilation Error for ffmpeg-rockchip
libdrm and rockchip_mpp pkg-config Not Found
Build files for mpp, rga, and drm have been successfully generated through cross-compilation. Using the following commands, pkg-config files have been imported, and pkg-config information has been successfully queried, as shown below:
Then, attempting to compile ffmpeg with the following command:
Encountering the following errors: