/contrib/ffmpeg.sh
Shell | 61 lines | 48 code | 12 blank | 1 comment | 7 complexity | 594c8a8b3fb7431e13531cf0936d3066 MD5 | raw file
Possible License(s): GPL-3.0, GPL-2.0
1#!/bin/sh
2
3cd `dirname $0`
4
5if [ ! -d "build" ] ; then
6 mkdir build
7fi
8cd build
9
10FFV="ffmpeg-1.0.7"
11ARC="$FFV.tar.gz"
12
13err()
14{
15 CDIR=`pwd`
16 echo "failed to download FFmpeg"
17 echo "please, download $DURL"
18 echo "to $CDIR"
19 exit 1
20}
21
22download()
23{
24 if [ -d "ffmpeg" ] ; then
25 return 0
26 fi
27
28 if [ ! -f "$ARC" ] ; then
29 DURL="http://ffmpeg.org/releases/$ARC"
30 DCMD=""
31
32 if which curl >/dev/null ; then
33 DCMD="curl -O"
34 elif which wget >/dev/null ; then
35 DCMD="wget"
36 elif which fetch >/dev/null ; then
37 DCMD="fetch"
38 else
39 err
40 fi
41
42 $DCMD $DURL
43 if [ $? -ne 0 ] ; then
44 err
45 fi
46 fi
47
48 tar -xf $ARC
49 mv $FFV ffmpeg
50}
51
52download
53cd ffmpeg
54
55if [ -f "version.h" ] ; then
56 echo "rebuild ffmpeg"
57 make distclean
58fi
59
60./configure --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver --disable-doc --disable-avdevice --disable-swresample --disable-swscale --disable-postproc --disable-network --disable-everything --enable-encoder=mp2,ac3 --enable-decoder=mp1,mp2,mp3,ac3 --disable-yasm \
61&& make