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
+libswscale
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 ifneq ($(CONFIG_TARGET_x86
),)
186 TARGET_CFLAGS
+= -fomit-frame-pointer
189 # XXX: add --disable-mmx & --disable-mmx2 to fix build failure on x86
190 # libpostproc/postprocess_template.c:2195: error: can't find a register in class 'GENERAL_REGS' while reloading 'asm'
191 # libpostproc/postprocess_template.c:3124: error: can't find a register in class 'GENERAL_REGS' while reloading 'asm'
192 # libpostproc/postprocess_template.c:3207: error: can't find a register in class 'GENERAL_REGS' while reloading 'asm'
194 define Build
/Configure
195 # this is *NOT* GNU configure
196 ( cd
$(PKG_BUILD_DIR
); \
197 CFLAGS
="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS) $(FPIC)" \
198 LDFLAGS
="$(TARGET_LDFLAGS)" \
200 --enable-cross-compile \
201 --cross-prefix
="$(TARGET_CROSS)" \
212 --disable-optimizations \
214 --disable-stripping \
220 $(if
$(CONFIG_PACKAGE_ffmpeg
),,--disable-ffmpeg
) \
221 $(if
$(CONFIG_PACKAGE_ffserver
),,--disable-ffserver
) \
222 $(if
$(CONFIG_FFMPEG_IPV6
),,--disable-ipv6
) \
227 $(FFMPEG_CONFIGURE_ENCODERS
) \
229 $(FFMPEG_CONFIGURE_DECODERS
) \
231 $(FFMPEG_CONFIGURE_MUXERS
) \
233 $(FFMPEG_CONFIGURE_DEMUXERS
) \
235 $(FFMPEG_CONFIGURE_PARSERS
) \
236 --disable-protocols \
237 $(FFMPEG_CONFIGURE_PROTOCOLS
) \
242 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
243 DESTDIR
="$(PKG_INSTALL_DIR)" \
247 define Build
/InstallDev
248 $(INSTALL_DIR
) $(1)/usr
/include
249 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/libav
{codec
,device
,format
,util
} $(1)/usr
/include/
250 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/libpostproc
$(1)/usr
/include/
251 $(INSTALL_DIR
) $(1)/usr
/lib
252 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libav
{codec
,device
,format
,util
}.
{a
,so
*} $(1)/usr
/lib
/
253 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libpostproc.
{a
,so
*} $(1)/usr
/lib
/
254 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libswscale.
{a
,so
*} $(1)/usr
/lib
/
255 $(INSTALL_DIR
) $(1)/usr
/lib
/pkgconfig
256 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/pkgconfig
/libav
{codec
,device
,format
,util
}.
pc $(1)/usr
/lib
/pkgconfig
/
257 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/pkgconfig
/libpostproc.
pc $(1)/usr
/lib
/pkgconfig
/
258 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/pkgconfig
/libswscale.
pc $(1)/usr
/lib
/pkgconfig
/
261 define Package
/ffmpeg
/install
262 $(INSTALL_DIR
) $(1)/usr
/bin
263 $(CP
) $(PKG_INSTALL_DIR
)/usr
/bin
/ffmpeg
$(1)/usr
/bin
/
266 define Package
/ffserver
/install
267 $(INSTALL_DIR
) $(1)/usr
/bin
268 $(CP
) $(PKG_INSTALL_DIR
)/usr
/bin
/ffserver
$(1)/usr
/bin
/
271 define Package
/libffmpeg
/install
272 $(INSTALL_DIR
) $(1)/usr
/lib
273 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libav
{codec
,device
,format
,util
}.so.
* $(1)/usr
/lib
/
276 define Package
/libpostproc
/install
277 $(INSTALL_DIR
) $(1)/usr
/lib
278 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libpostproc.so.
* $(1)/usr
/lib
/
281 define Package
/libswscale
/install
282 $(INSTALL_DIR
) $(1)/usr
/lib
283 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libswscale.so.
* $(1)/usr
/lib
/
286 $(eval
$(call BuildPackage
,ffmpeg
))
287 $(eval
$(call BuildPackage
,ffserver
))
288 $(eval
$(call BuildPackage
,libffmpeg
))
289 $(eval
$(call BuildPackage
,libpostproc
))
290 $(eval
$(call BuildPackage
,libswscale
))