35dba7c26643fcff2cfd4c0dbf0068820b4cb385
[openwrt/svn-archive/archive.git] / multimedia / ffmpeg / Makefile
1 #
2 # Copyright (C) 2006-2009 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=ffmpeg
11 PKG_VERSION:=20080419
12 PKG_RELEASE:=2
13
14 PKG_SOURCE:=$(PKG_NAME)-export-snapshot-$(PKG_VERSION).tar.bz2
15 PKG_SOURCE_URL:=http://downloads.openwrt.org/sources/
16 PKG_MD5SUM:=63aeb859941b96ed3ef7b0c7a643bf4d
17
18 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-export-2008-04-19
19
20 include $(INCLUDE_DIR)/package.mk
21
22 define Package/ffmpeg/Default
23 TITLE:=FFmpeg
24 URL:=http://ffmpeg.mplayerhq.hu/
25 endef
26
27 define Package/ffmpeg/Default/description
28 FFmpeg is a a software package that can record, convert and stream digital
29 audio and video in numerous formats.
30 endef
31
32 define Package/ffmpeg
33 $(call Package/ffmpeg/Default)
34 SECTION:=multimedia
35 CATEGORY:=Multimedia
36 TITLE+= program
37 DEPENDS+= +libpthread +libffmpeg
38 endef
39
40 define Package/ffmpeg/description
41 $(call Package/ffmpeg/Default/description)
42 .
43 This package contains the FFmpeg command line tool.
44 endef
45
46 define Package/ffserver
47 $(call Package/ffserver/Default)
48 SECTION:=multimedia
49 CATEGORY:=Multimedia
50 TITLE+= streaming server
51 DEPENDS+= +libpthread +libffmpeg
52 endef
53
54 define Package/ffserver/description
55 $(call Package/ffmpeg/Default/description)
56 .
57 This package contains the FFmpeg streaming server.
58 endef
59
60 define Package/libffmpeg
61 $(call Package/ffmpeg/Default)
62 SECTION:=libs
63 CATEGORY:=Libraries
64 TITLE+= libraries
65 DEPENDS+= +libpthread +libfaad2 +zlib
66 MENU:=1
67 endef
68
69 define Package/libffmpeg/config
70 menu "Configuration"
71 depends on PACKAGE_libffmpeg
72 source "$(SOURCE)/Config.in"
73 endmenu
74 endef
75
76 define Package/libffmeg/description
77 $(call Package/ffmpeg/Default/description)
78 .
79 This package contains FFmpeg shared libraries.
80 endef
81
82 define Package/libpostproc
83 SECTION:=libs
84 CATEGORY:=Libraries
85 TITLE:=libpostproc
86 URL:=http://ffmpeg.mplayerhq.hu/
87 DEPENDS:=+libffmpeg
88 endef
89
90 FFMPEG_ENCODERS:= \
91 ac3 \
92 jpegls \
93 mpeg1video \
94 mpeg2video \
95 mpeg4 \
96 png \
97 zlib \
98
99 FFMPEG_DECODERS:= \
100 ac3 \
101 atrac3 \
102 gif \
103 h264 \
104 jpegls \
105 mp3 \
106 mpeg1video \
107 mpeg2video \
108 mpeg4 \
109 mpeg4aac \
110 mpegvideo \
111 png \
112 wmav1 \
113 wmav2 \
114 zlib \
115
116 FFMPEG_MUXERS:= \
117 ac3 \
118 ffm \
119 h264 \
120 mp3 \
121 mp4 \
122 mpeg1video \
123 mpeg2video \
124 mpegts \
125 rtp \
126
127 FFMPEG_DEMUXERS:= \
128 ac3 \
129 ffm \
130 h264 \
131 mp3 \
132 mpegps \
133 mpegts \
134 mpegvideo \
135 rtsp \
136 sdp \
137 v4l2 \
138
139 FFMPEG_PARSERS:= \
140 ac3 \
141 h264 \
142 mpegaudio \
143 mpegvideo \
144 mpeg4video \
145
146 FFMPEG_PROTOCOLS:= \
147 file http pipe rtp tcp udp \
148
149 FFMPEG_CONFIGURE_ENCODERS:= \
150 $(foreach c, $(FFMPEG_ENCODERS), \
151 $(if $(CONFIG_FFMPEG_ENCODER_$(c)),--enable-encoder="$(c)") \
152 )
153
154 FFMPEG_CONFIGURE_DECODERS:= \
155 $(foreach c, $(FFMPEG_DECODERS), \
156 $(if $(CONFIG_FFMPEG_DECODER_$(c)),--enable-decoder="$(c)") \
157 )
158
159 FFMPEG_CONFIGURE_MUXERS:= \
160 $(foreach c, $(FFMPEG_MUXERS), \
161 $(if $(CONFIG_FFMPEG_MUXER_$(c)),--enable-muxer="$(c)") \
162 )
163
164 FFMPEG_CONFIGURE_DEMUXERS:= \
165 $(foreach c, $(FFMPEG_DEMUXERS), \
166 $(if $(CONFIG_FFMPEG_DEMUXER_$(c)),--enable-demuxer="$(c)") \
167 )
168
169 FFMPEG_CONFIGURE_PARSERS:= \
170 $(foreach c, $(FFMPEG_PARSERS), \
171 $(if $(CONFIG_FFMPEG_PARSER_$(c)),--enable-parser="$(c)") \
172 )
173
174 FFMPEG_CONFIGURE_PROTOCOLS:= \
175 $(foreach c, $(FFMPEG_PROTOCOLS), \
176 $(if $(CONFIG_FFMPEG_PROTOCOL_$(c)),--enable-protocol="$(c)") \
177 )
178
179 define Build/Configure
180 # this is *NOT* GNU configure
181 ( cd $(PKG_BUILD_DIR); \
182 CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
183 LDFLAGS="$(TARGET_LDFLAGS)" \
184 ./configure \
185 --enable-cross-compile \
186 --cross-prefix="$(TARGET_CROSS)" \
187 --arch="$(ARCH)" \
188 --prefix="/usr" \
189 --enable-shared \
190 --enable-static \
191 --disable-debug \
192 --enable-ffmpeg \
193 --enable-ffserver \
194 --enable-gpl \
195 --enable-libfaad \
196 --enable-pthreads \
197 --disable-optimizations \
198 --enable-small \
199 --disable-stripping \
200 --disable-vhook \
201 --enable-zlib \
202 --enable-postproc \
203 \
204 --disable-encoders \
205 $(FFMPEG_CONFIGURE_ENCODERS) \
206 --disable-decoders \
207 $(FFMPEG_CONFIGURE_DECODERS) \
208 --disable-muxers \
209 $(FFMPEG_CONFIGURE_MUXERS) \
210 --disable-demuxers \
211 $(FFMPEG_CONFIGURE_DEMUXERS) \
212 --disable-parsers \
213 $(FFMPEG_CONFIGURE_PARSERS) \
214 --disable-bsfs \
215 --disable-protocols \
216 $(FFMPEG_CONFIGURE_PROTOCOLS) \
217 )
218 endef
219
220 define Build/Compile
221 $(MAKE) -C $(PKG_BUILD_DIR) \
222 DESTDIR="$(PKG_INSTALL_DIR)" \
223 all install
224 endef
225
226 define Build/InstallDev
227 $(INSTALL_DIR) $(1)/usr/include
228 $(CP) $(PKG_INSTALL_DIR)/usr/include/libav{codec,device,format,util} $(1)/usr/include/
229 $(CP) $(PKG_INSTALL_DIR)/usr/include/libpostproc $(1)/usr/include/
230 $(INSTALL_DIR) $(1)/usr/lib
231 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libav{codec,device,format,util}.{a,so*} $(1)/usr/lib/
232 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpostproc.{a,so*} $(1)/usr/lib/
233 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
234 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libav{codec,device,format,util}.pc $(1)/usr/lib/pkgconfig/
235 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libpostproc.pc $(1)/usr/lib/pkgconfig/
236 endef
237
238 define Package/ffmpeg/install
239 $(INSTALL_DIR) $(1)/usr/bin
240 $(CP) $(PKG_INSTALL_DIR)/usr/bin/ffmpeg $(1)/usr/bin/
241 endef
242
243 define Package/ffserver/install
244 $(INSTALL_DIR) $(1)/usr/bin
245 $(CP) $(PKG_INSTALL_DIR)/usr/bin/ffserver $(1)/usr/bin/
246 endef
247
248 define Package/libffmpeg/install
249 $(INSTALL_DIR) $(1)/usr/lib
250 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libav{codec,device,format,util}.so.* $(1)/usr/lib/
251 endef
252
253 define Package/libpostproc/install
254 $(INSTALL_DIR) $(1)/usr/lib
255 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpostproc.so.* $(1)/usr/lib/
256 endef
257
258 $(eval $(call BuildPackage,ffmpeg))
259 $(eval $(call BuildPackage,ffserver))
260 $(eval $(call BuildPackage,libffmpeg))
261 $(eval $(call BuildPackage,libpostproc))