加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
linux_rpi.sh 2.56 KB
一键复制 编辑 原始数据 按行查看 历史
#!/bin/bash
echo "Building Raspberry Pi 2 - ARMv7 ffmpeg"
echo "For right build u must have installed CrossTool-ng tools"
echo "WARNING! CrossTool must be compiled for hard float!!!"
ARCH=$(uname -m)
set -e
if [ "$ARCH" == "armv7l" ]; then
echo "U cant compile FFMPEG on Raspberry! I must compile on any Linux distr."
exit
fi
GENERAL="\
--enable-cross-compile \
--extra-libs="-lgcc" \
--arch=arm \
--cc=/opt/cross/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-gcc \
--cross-prefix=/opt/cross/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi- \
--nm=/opt/cross/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-nm"
MODULES="\
--disable-avdevice \
--disable-filters \
--disable-programs \
--disable-network \
--disable-avfilter \
--disable-postproc \
--disable-encoders \
--disable-protocols \
--disable-hwaccels \
--disable-doc"
VIDEO_DECODERS="\
--enable-decoder=h264 \
--enable-decoder=mpeg4 \
--enable-decoder=mpeg2video \
--enable-decoder=mjpeg \
--enable-decoder=mjpegb"
AUDIO_DECODERS="\
--enable-decoder=aac \
--enable-decoder=aac_latm \
--enable-decoder=atrac3 \
--enable-decoder=atrac3p \
--enable-decoder=mp3 \
--enable-decoder=pcm_s16le \
--enable-decoder=pcm_s8"
DEMUXERS="\
--enable-demuxer=h264 \
--enable-demuxer=m4v \
--enable-demuxer=mpegvideo \
--enable-demuxer=mpegps \
--enable-demuxer=mp3 \
--enable-demuxer=avi \
--enable-demuxer=aac \
--enable-demuxer=pmp \
--enable-demuxer=oma \
--enable-demuxer=pcm_s16le \
--enable-demuxer=pcm_s8 \
--enable-demuxer=wav"
VIDEO_ENCODERS="\
--enable-encoder=huffyuv \
--enable-encoder=ffv1 \
--enable-encoder=mjpeg"
AUDIO_ENCODERS="\
--enable-encoder=pcm_s16le"
MUXERS="\
--enable-muxer=avi"
PARSERS="\
--enable-parser=h264 \
--enable-parser=mpeg4video \
--enable-parser=mpegaudio \
--enable-parser=mpegvideo \
--enable-parser=aac \
--enable-parser=aac_latm"
function build_ARMv7
{
./configure --target-os=linux \
--prefix=./linux/armv7 \
${GENERAL} \
--extra-cflags=" -O3 -fasm -Wno-psabi -fno-short-enums -fno-strict-aliasing -finline-limit=300 -mfpu=neon -marm -march=armv7-a" \
--disable-shared \
--enable-static \
--enable-zlib \
--disable-everything \
${MODULES} \
${VIDEO_DECODERS} \
${AUDIO_DECODERS} \
${VIDEO_ENCODERS} \
${AUDIO_ENCODERS} \
${DEMUXERS} \
${MUXERS} \
${PARSERS}
make clean
make install
}
build_ARMv7
echo Linux RPI builds finished
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化