2 # Copyright (C) 2006-2011 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR)/rules.mk
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15 PKG_SOURCE_URL:=http://ffmpeg.org/releases/
16 PKG_MD5SUM:=451eb428ca97a72c00555d50944cdb24
88 file http pipe rtp tcp udp
90 PKG_CONFIG_DEPENDS:= \
91 $(patsubst %,CONFIG_FFMPEG_ENCODER_%,$(FFMPEG_ENCODERS)) \
92 $(patsubst %,CONFIG_FFMPEG_DECODER_%,$(FFMPEG_DECODERS)) \
93 $(patsubst %,CONFIG_FFMPEG_MUXER_%,$(FFMPEG_DEMUXERS)) \
94 $(patsubst %,CONFIG_FFMPEG_DEMUXER_%,$(FFMPEG_DEMUXERS)) \
95 $(patsubst %,CONFIG_FFMPEG_PARSER_%,$(FFMPEG_PARSERS)) \
96 $(patsubst %,CONFIG_FFMPEG_PROTOCOL_%,$(FFMPEG_PROTOCOLS))
98 include $(INCLUDE_DIR)/package.mk
100 define Package/ffmpeg/Default
102 URL:=http://ffmpeg.mplayerhq.hu/
105 define Package/ffmpeg/Default/description
106 FFmpeg is a a software package that can record, convert and stream digital
107 audio and video in numerous formats.
110 define Package/ffmpeg
111 $(call Package/ffmpeg/Default)
115 DEPENDS+= +libpthread +libffmpeg +libpostproc
118 define Package/ffmpeg/description
119 $(call Package/ffmpeg/Default/description)
121 This package contains the FFmpeg command line tool.
124 define Package/ffserver
125 $(call Package/ffserver/Default)
128 TITLE+= streaming server
129 DEPENDS+= +libpthread +libffmpeg +@FFMPEG_FFSERVER_SUPPORT
132 define Package/ffserver/description
133 $(call Package/ffmpeg/Default/description)
135 This package contains the FFmpeg streaming server.
138 define Package/libffmpeg
139 $(call Package/ffmpeg/Default)
143 DEPENDS+= +libpthread +zlib
147 define Package/libffmpeg/config
148 source "$(SOURCE)/Config.in"
151 define Package/libffmeg/description
152 $(call Package/ffmpeg/Default/description)
154 This package contains FFmpeg shared libraries.
157 define Package/libpostproc
161 URL:=http://ffmpeg.mplayerhq.hu/
165 define Package/libswscale
169 URL:=http://ffmpeg.mplayerhq.hu/
175 $(if $(CONFIG_FFMPEG_$(1)_$(c)),--enable-$(2)="$(c)") \
178 FFMPEG_CONFIGURE_ENCODERS:=$(call FILTER_CONFIG,ENCODER,encoder,$(FFMPEG_ENCODERS))
179 FFMPEG_CONFIGURE_DECODERS:=$(call FILTER_CONFIG,DECODER,decoder,$(FFMPEG_DECODERS))
180 FFMPEG_CONFIGURE_MUXERS:=$(call FILTER_CONFIG,MUXER,muxer,$(FFMPEG_MUXERS))
181 FFMPEG_CONFIGURE_DEMUXERS:=$(call FILTER_CONFIG,DEMUXER,demuxer,$(FFMPEG_DEMUXERS))
182 FFMPEG_CONFIGURE_PARSERS:=$(call FILTER_CONFIG,PARSER,parser,$(FFMPEG_PARSERS))
183 FFMPEG_CONFIGURE_PROTOCOLS:=$(call FILTER_CONFIG,PROTOCOL,protocol,$(FFMPEG_PROTOCOLS))
185 # XXX: add --disable-mmx & --disable-mmx2 to fix build failure on x86
186 # libpostproc/postprocess_template.c:2195: error: can't find a register in class 'GENERAL_REGS' while reloading 'asm'
187 # libpostproc/postprocess_template.c:3124: error: can't find a register in class 'GENERAL_REGS' while reloading 'asm'
188 # libpostproc/postprocess_template.c:3207: error: can't find a register in class 'GENERAL_REGS' while reloading 'asm'
190 define Build/Configure
191 # this is *NOT* GNU configure
192 ( cd $(PKG_BUILD_DIR); \
193 CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS) $(FPIC)" \
194 LDFLAGS="$(TARGET_LDFLAGS)" \
196 --enable-cross-compile \
197 --cross-prefix="$(TARGET_CROSS)" \
208 --disable-optimizations \
210 --disable-stripping \
216 $(if $(CONFIG_PACKAGE_ffmpeg),,--disable-ffmpeg) \
217 $(if $(CONFIG_PACKAGE_ffserver),,--disable-ffserver) \
218 $(if $(CONFIG_FFMPEG_IPV6),,--disable-ipv6) \
223 $(FFMPEG_CONFIGURE_ENCODERS) \
225 $(FFMPEG_CONFIGURE_DECODERS) \
227 $(FFMPEG_CONFIGURE_MUXERS) \
229 $(FFMPEG_CONFIGURE_DEMUXERS) \
231 $(FFMPEG_CONFIGURE_PARSERS) \
232 --disable-protocols \
233 $(FFMPEG_CONFIGURE_PROTOCOLS) \
238 $(MAKE) -C $(PKG_BUILD_DIR) \
239 DESTDIR="$(PKG_INSTALL_DIR)" \
243 define Build/InstallDev
244 $(INSTALL_DIR) $(1)/usr/include
245 $(CP) $(PKG_INSTALL_DIR)/usr/include/libav{codec,device,format,util} $(1)/usr/include/
246 $(CP) $(PKG_INSTALL_DIR)/usr/include/libpostproc $(1)/usr/include/
247 $(INSTALL_DIR) $(1)/usr/lib
248 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libav{codec,device,format,util}.{a,so*} $(1)/usr/lib/
249 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpostproc.{a,so*} $(1)/usr/lib/
250 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libswscale.{a,so*} $(1)/usr/lib/
251 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
252 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libav{codec,device,format,util}.pc $(1)/usr/lib/pkgconfig/
253 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libpostproc.pc $(1)/usr/lib/pkgconfig/
254 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libswscale.pc $(1)/usr/lib/pkgconfig/
257 define Package/ffmpeg/install
258 $(INSTALL_DIR) $(1)/usr/bin
259 $(CP) $(PKG_INSTALL_DIR)/usr/bin/ffmpeg $(1)/usr/bin/
262 define Package/ffserver/install
263 $(INSTALL_DIR) $(1)/usr/bin
264 $(CP) $(PKG_INSTALL_DIR)/usr/bin/ffserver $(1)/usr/bin/
267 define Package/libffmpeg/install
268 $(INSTALL_DIR) $(1)/usr/lib
269 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libav{codec,device,format,util}.so.* $(1)/usr/lib/
272 define Package/libpostproc/install
273 $(INSTALL_DIR) $(1)/usr/lib
274 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpostproc.so.* $(1)/usr/lib/
277 define Package/libswcale/install
278 $(INSTALL_DIR) $(1)/usr/lib
279 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libswscale.so.* $(1)/usr/lib/
282 $(eval $(call BuildPackage,ffmpeg))
283 $(eval $(call BuildPackage,ffserver))
284 $(eval $(call BuildPackage,libffmpeg))
285 $(eval $(call BuildPackage,libpostproc))
286 $(eval $(call BuildPackage,libswscale))