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:=967d481c98161582d149aced6e3b2f31
92 file http pipe rtp tcp udp
94 PKG_CONFIG_DEPENDS:= \
95 $(patsubst %,CONFIG_FFMPEG_ENCODER_%,$(FFMPEG_ENCODERS)) \
96 $(patsubst %,CONFIG_FFMPEG_DECODER_%,$(FFMPEG_DECODERS)) \
97 $(patsubst %,CONFIG_FFMPEG_MUXER_%,$(FFMPEG_DEMUXERS)) \
98 $(patsubst %,CONFIG_FFMPEG_DEMUXER_%,$(FFMPEG_DEMUXERS)) \
99 $(patsubst %,CONFIG_FFMPEG_PARSER_%,$(FFMPEG_PARSERS)) \
100 $(patsubst %,CONFIG_FFMPEG_PROTOCOL_%,$(FFMPEG_PROTOCOLS))
102 include $(INCLUDE_DIR)/package.mk
104 define Package/ffmpeg/Default
106 URL:=http://ffmpeg.mplayerhq.hu/
109 define Package/ffmpeg/Default/description
110 FFmpeg is a a software package that can record, convert and stream digital
111 audio and video in numerous formats.
114 define Package/ffmpeg
115 $(call Package/ffmpeg/Default)
119 DEPENDS+= +libpthread +libffmpeg +libpostproc +libswscale
122 define Package/ffmpeg/description
123 $(call Package/ffmpeg/Default/description)
125 This package contains the FFmpeg command line tool.
128 define Package/ffprobe
129 $(call Package/ffmpeg/Default)
132 TITLE+= CLI media identifier
136 define Package/ffprobe/description
137 $(call Package/ffmpeg/Default/description)
139 This package contains the FFprobe command line tool.
142 define Package/ffserver
143 $(call Package/ffserver/Default)
146 TITLE+= streaming server
147 DEPENDS+= +libpthread +libffmpeg +@FFMPEG_FFSERVER_SUPPORT
150 define Package/ffserver/description
151 $(call Package/ffmpeg/Default/description)
153 This package contains the FFmpeg streaming server.
156 define Package/libffmpeg
157 $(call Package/ffmpeg/Default)
161 DEPENDS+= +libpthread +zlib
165 define Package/libffmpeg/config
166 source "$(SOURCE)/Config.in"
169 define Package/libffmpeg/description
170 $(call Package/ffmpeg/Default/description)
172 This package contains FFmpeg shared libraries.
175 define Package/libpostproc
179 URL:=http://ffmpeg.mplayerhq.hu/
183 define Package/libswscale
187 URL:=http://ffmpeg.mplayerhq.hu/
193 $(if $(CONFIG_FFMPEG_$(1)_$(c)),--enable-$(2)="$(c)") \
196 FFMPEG_CONFIGURE_ENCODERS:=$(call FILTER_CONFIG,ENCODER,encoder,$(FFMPEG_ENCODERS))
197 FFMPEG_CONFIGURE_DECODERS:=$(call FILTER_CONFIG,DECODER,decoder,$(FFMPEG_DECODERS))
198 FFMPEG_CONFIGURE_MUXERS:=$(call FILTER_CONFIG,MUXER,muxer,$(FFMPEG_MUXERS))
199 FFMPEG_CONFIGURE_DEMUXERS:=$(call FILTER_CONFIG,DEMUXER,demuxer,$(FFMPEG_DEMUXERS))
200 FFMPEG_CONFIGURE_PARSERS:=$(call FILTER_CONFIG,PARSER,parser,$(FFMPEG_PARSERS))
201 FFMPEG_CONFIGURE_PROTOCOLS:=$(call FILTER_CONFIG,PROTOCOL,protocol,$(FFMPEG_PROTOCOLS))
203 ifneq ($(CONFIG_TARGET_x86),)
204 TARGET_CFLAGS += -fomit-frame-pointer
207 # XXX: add --disable-mmx & --disable-mmx2 to fix build failure on x86
208 # libpostproc/postprocess_template.c:2195: error: can't find a register in class 'GENERAL_REGS' while reloading 'asm'
209 # libpostproc/postprocess_template.c:3124: error: can't find a register in class 'GENERAL_REGS' while reloading 'asm'
210 # libpostproc/postprocess_template.c:3207: error: can't find a register in class 'GENERAL_REGS' while reloading 'asm'
212 define Build/Configure
213 # this is *NOT* GNU configure
214 ( cd $(PKG_BUILD_DIR); \
215 CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS) $(FPIC)" \
216 LDFLAGS="$(TARGET_LDFLAGS)" \
218 --enable-cross-compile \
219 --cross-prefix="$(TARGET_CROSS)" \
235 --disable-optimizations \
237 --disable-stripping \
242 $(if $(CONFIG_FFMPEG_BSFS),,--disable-bsfs) \
243 $(if $(CONFIG_FFMPEG_OUTDEVS),,--disable-outdevs) \
244 $(if $(CONFIG_FFMPEG_INDEVS),,--disable-indevs) \
245 $(if $(CONFIG_FFMPEG_FILTERS),,--disable-filters) \
246 $(if $(CONFIG_FFMPEG_HWACCELS),,--disable-hwaccels) \
247 $(if $(CONFIG_FFMPEG_PARSERS),,--disable-parsers) \
248 $(if $(CONFIG_FFMPEG_PROTOCOLS),,--disable-protocols) \
249 $(if $(CONFIG_FFMPEG_ENCODE),,--disable-encoders --disable-muxers) \
250 $(if $(CONFIG_FFMPEG_DECODE),,--disable-decoders --disable-demuxers) \
251 $(FFMPEG_CONFIGURE_ENCODERS) \
252 $(FFMPEG_CONFIGURE_DECODERS) \
253 $(FFMPEG_CONFIGURE_MUXERS) \
254 $(FFMPEG_CONFIGURE_DEMUXERS) \
255 $(FFMPEG_CONFIGURE_PARSERS) \
256 $(FFMPEG_CONFIGURE_PROTOCOLS) \
258 $(if $(CONFIG_PACKAGE_ffmpeg),,--disable-ffmpeg) \
260 $(if $(CONFIG_PACKAGE_ffprobe),,--disable-ffprobe) \
261 $(if $(CONFIG_PACKAGE_ffserver),,--disable-ffserver) \
267 $(MAKE) -C $(PKG_BUILD_DIR) \
268 DESTDIR="$(PKG_INSTALL_DIR)" \
272 define Build/InstallDev
273 $(INSTALL_DIR) $(1)/usr/include
274 $(CP) $(PKG_INSTALL_DIR)/usr/include/libav{codec,device,format,util} $(1)/usr/include/
275 $(CP) $(PKG_INSTALL_DIR)/usr/include/libpostproc $(1)/usr/include/
276 $(INSTALL_DIR) $(1)/usr/lib
277 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libav{codec,device,format,util}.{a,so*} $(1)/usr/lib/
278 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpostproc.{a,so*} $(1)/usr/lib/
279 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libswscale.{a,so*} $(1)/usr/lib/
280 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
281 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libav{codec,device,format,util}.pc $(1)/usr/lib/pkgconfig/
282 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libpostproc.pc $(1)/usr/lib/pkgconfig/
283 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libswscale.pc $(1)/usr/lib/pkgconfig/
286 define Package/ffmpeg/install
287 $(INSTALL_DIR) $(1)/usr/bin
288 $(CP) $(PKG_INSTALL_DIR)/usr/bin/ffmpeg $(1)/usr/bin/
291 define Package/ffprobe/install
292 $(INSTALL_DIR) $(1)/usr/bin
293 $(CP) $(PKG_INSTALL_DIR)/usr/bin/ffprobe $(1)/usr/bin/
296 define Package/ffserver/install
297 $(INSTALL_DIR) $(1)/usr/bin
298 $(CP) $(PKG_INSTALL_DIR)/usr/bin/ffserver $(1)/usr/bin/
301 define Package/libffmpeg/install
302 $(INSTALL_DIR) $(1)/usr/lib
303 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libav{codec,device,format,util}.so.* $(1)/usr/lib/
306 define Package/libpostproc/install
307 $(INSTALL_DIR) $(1)/usr/lib
308 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpostproc.so.* $(1)/usr/lib/
311 define Package/libswscale/install
312 $(INSTALL_DIR) $(1)/usr/lib
313 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libswscale.so.* $(1)/usr/lib/
316 $(eval $(call BuildPackage,ffmpeg))
317 $(eval $(call BuildPackage,ffprobe))
318 $(eval $(call BuildPackage,ffserver))
319 $(eval $(call BuildPackage,libffmpeg))
320 $(eval $(call BuildPackage,libpostproc))
321 $(eval $(call BuildPackage,libswscale))