T31交叉编译ffmpeg

下载ffmpeg

https://github.com/FFmpeg/FFmpeg/blob/release/4.4/configure

这个是4.4版本的ffmpeg,看自己需求下载。

编译ffmpeg

解压ffmpeg源码,进入源码目录进行编译。

./configure --prefix=$PWD/_install_uclibc --enable-cross-compile --cross-prefix=mips-linux-gnu- --arch=mips --target-os=linux --disable-asm --enable-mips32r2 --disable-mips32r5 --disable-mips32r6 --disable-mips64r2 --disable-mips64r6 --disable-mipsdsp --disable-mipsdspr2 --extra-cflags='-muclibc -march=mips32r2 -fPIC' --extra-cxxflags='-muclibc -march=mips32r2 -fPIC' --extra-ldflags='-muclibc -march=mips32r2 -fPIC' --enable-static --enable-shared --enable-small --disable-programs --disable-network --disable-everything --disable-decoders --enable-decoder=aac --enable-decoder=aac_fixed --enable-decoder=aac_latm --enable-decoder=h264 --enable-decoder=hevc --disable-encoders --enable-encoder=aac --enable-encoder=mpeg4 --disable-hwaccels --disable-parsers --disable-demuxers --enable-demuxer=aac --enable-demuxer=h264 --enable-demuxer=hevc --enable-demuxer=mov --disable-muxers --enable-muxer=mp4 --enable-muxer=hevc --enable-muxer=h264 --enable-muxer=adts --disable-protocols --enable-protocol=file --disable-filters --disable-bsfs --enable-bsf=aac_adtstoasc --enable-bsf=hevc_mp4toannexb --enable-bsf=h264_mp4toannexb --disable-devices --disable-debug make make install

生成资源位于_install_uclibc下

前面可能会报tools no such Makefile在这个文件,但是进入到tools文件夹发现是有的,这个时候我们再执行一次make就可以了。

如果编译报ffmpeg的例子的时候报,这个错的话,这个问题是环境问题,需要注意,编译器使能mips架构,然后对应的开发板的架构。

lib/ffmpeg/lib/libavformat.so: undefined reference to `__sync_fetch_and_sub_8'

lib/ffmpeg/lib/libavformat.so: undefined reference to `__sync_fetch_and_add_8'

mips架构参数

下面这个自行去翻译

--enable-mips32r2 --disable-mips32r5 --disable-mips32r6 --disable-mips64r2 --disable-mips64r6 --disable-mipsdsp --disable-mipsdspr2 --extra-cflags='-muclibc -march=mips32r2 -fPIC ' --extra-cxxflags='-muclibc -march=mips32r2 -fPIC' --extra-ldflags='-muclibc -march=mips32r2 -fPIC

It looks like you've provided a set of options that might be used with a compiler or build system for configuring the compilation process of a software project. Let me break down what each of these options does:

  1. --enable-mips32r2

: This option is likely enabling support for the MIPS32 Release 2 (R2) architecture.

  1. --disable-mips32r5

and --disable-mips32r6: These options are disabling support for the MIPS32 Release 5 (R5) and Release 6 (R6) architectures, respectively.

  1. --disable-mips64r2

and --disable-mips64r6: Similar to the previous ones, these options are disabling support for the MIPS64 Release 2 (R2) and Release 6 (R6) architectures, respectively.

  1. --disable-mipsdsp

and --disable-mipsdspr2: These options might be disabling support for certain DSP (Digital Signal Processing) extensions on the MIPS architecture.

  1. --extra-cflags='-muclibc -march=mips32r2 -fPIC'

: These extra C compiler flags are being added to the compilation process. The flags are:

    • -muclibc
    • -march=mips32r2
    • -fPIC
  1. --extra-cxxflags='-muclibc -march=mips32r2 -fPIC'

: Similar to the previous flags, these extra C++ compiler flags are being added to the compilation process for C++ code.

  1. --extra-ldflags='-muclibc -march=mips32r2 -fPIC'

: These extra linker flags are being added to the linking process. They likely match the compiler flags mentioned above and ensure that the linker produces an executable that is compatible with the specified uClibc and MIPS32 R2 architecture.

In summary, it seems like you're configuring the compilation process for a software project to target the MIPS32 R2 architecture while using the uClibc C library and generating position-independent code. This configuration is designed to optimize the software for a specific MIPS architecture and runtime environment.

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
T31是一种型号的芯片,裁剪kernel通常是指在Linux操作系统中裁剪内核(kernel)的配置,以满足特定设备或应用的需求。裁剪kernel可以减小内核的体积,提高系统的性能和效率。 要裁剪T31的kernel,您需要进行以下步骤: 1. 获取T31芯片的相关资料和开发工具,包括kernel源码和交叉编译工具链。 2. 配置交叉编译工具链,确保能够在主机上编译T31的kernel。 3. 打开kernel源码目录,在终端中运行`make menuconfig`命令,进入配置界面。 4. 在配置界面中,可以通过勾选或取消勾选不同的选项来裁剪内核。通常可以通过以下方式进行裁剪: - 去除不需要的设备驱动程序。根据T31的硬件特性,可以去除不需要的设备驱动程序,以减小内核体积。 - 禁用不需要的功能和子系统。根据实际需求,可以禁用一些不需要的功能和子系统,以减小内核体积。 - 调整内核配置参数。根据T31的性能和需求,可以调整一些内核配置参数,以提高系统性能和效率。 5. 完成配置后,保存并退出配置界面。 6. 在终端中运行`make`命令,开始编译裁剪后的kernel。 7. 编译完成后,将生成的kernel镜像文件烧录到T31芯片中,即可使用裁剪后的kernel。 请注意,在裁剪kernel时需要谨慎操作,确保不要去除必要的模块和功能,以免导致系统无法正常运行。建议在裁剪前备份原始的kernel源码和配置文件,以便需要时能够还原。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值