-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-ffmpeg-arm.sh
executable file
·60 lines (50 loc) · 1.8 KB
/
build-ffmpeg-arm.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/sh
FF_VERSION="3.4.2"
FF_SOURCE=`pwd`/"ffmpeg-$FF_VERSION"
FF_PREFIX=`pwd`/FFmpeg-arm
X264_PATH=`pwd`/x264-arm
ARM_GCC=arm-buildroot-linux-gnueabi
mkdir -p $FF_PREFIX && rm $FF_PREFIX/* -rf
cd $FF_SOURCE
echo "ffmpeg_Sources:$FF_SOURCE"
echo "ffmpeg_Prefix:$FF_PREFIX"
CONFIGURE_FLAGS="--disable-encoders --disable-decoders --disable-demuxers --disable-muxers --disable-parsers --disable-filters --enable-avfilter --disable-indevs --disable-outdevs --disable-postproc --enable-filter=anull --enable-encoder=h264,aac --enable-decoder=h264,aac --enable-muxer=h264,aac,flv --enable-demuxer=h264,aac,flv --enable-parser=h264,aac --disable-protocol=rtp --disable-protocol=sctp --disable-protocol=ftp --disable-protocol=hls --disable-protocol=concat --disable-protocol=icecast --disable-bsfs --enable-bsf=aac_adtstoasc --enable-bsf=h264_mp4toannexb --enable-bsf=null --enable-bsf=noise"
CONFIGURE_CFLAGS=""
CONFIGURE_LDFLAGS=""
if [ "$X264_PATH" ]
then
CONFIGURE_FLAGS="$CONFIGURE_FLAGS --enable-gpl --enable-libx264 --enable-encoder=libx264"
CONFIGURE_CFLAGS="-I$CONFIGURE_CFLAGS$X264_PATH/include"
CONFIGURE_LDFLAGS="-L$CONFIGURE_LDFLAGS$X264_PATH/lib"
echo "x264_cflags:$CONFIGURE_CFLAGS"
echo "x264_ldflags:$CONFIGURE_LDFLAGS"
fi
./configure \
--cc=$ARM_GCC-gcc \
--prefix=$FF_PREFIX \
--cross-prefix=$ARM_GCC- \
--enable-cross-compile \
--target-os=linux \
--arch=arm \
--disable-static \
--enable-shared \
--disable-debug \
--disable-programs \
--disable-ffplay \
--disable-ffmpeg \
--disable-ffserver \
--disable-ffprobe \
--disable-doc \
--enable-pic \
--enable-gpl \
--enable-nonfree \
--disable-armv5te \
--disable-armv6 \
--disable-armv6t2 \
--disable-stripping \
--disable-x86asm \
$CONFIGURE_FLAGS \
--extra-cflags=$CONFIGURE_CFLAGS \
--extra-ldflags=$CONFIGURE_LDFLAGS
make && make install
exit 0