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
:=87e771cd0f5d465fbf1a0a4824b7cc24
94 file http pipe rtp tcp udp
96 PKG_CONFIG_DEPENDS
:= \
97 $(patsubst %,CONFIG_FFMPEG_ENCODER_
%,$(FFMPEG_ENCODERS
)) \
98 $(patsubst %,CONFIG_FFMPEG_DECODER_
%,$(FFMPEG_DECODERS
)) \
99 $(patsubst %,CONFIG_FFMPEG_MUXER_
%,$(FFMPEG_DEMUXERS
)) \
100 $(patsubst %,CONFIG_FFMPEG_DEMUXER_
%,$(FFMPEG_DEMUXERS
)) \
101 $(patsubst %,CONFIG_FFMPEG_PARSER_
%,$(FFMPEG_PARSERS
)) \
102 $(patsubst %,CONFIG_FFMPEG_PROTOCOL_
%,$(FFMPEG_PROTOCOLS
))
104 include $(INCLUDE_DIR
)/package.mk
106 define Package
/ffmpeg
/Default
108 URL
:=http
://ffmpeg.mplayerhq.hu
/
111 define Package
/ffmpeg
/Default
/description
112 FFmpeg is a a software package that can record
, convert and stream digital
113 audio and video in numerous formats.
116 define Package
/ffmpeg
117 $(call Package
/ffmpeg
/Default
)
121 DEPENDS
+= +libpthread
+libffmpeg
+libpostproc
+libswscale
124 define Package
/ffmpeg
/description
125 $(call Package
/ffmpeg
/Default
/description
)
127 This package contains the FFmpeg command line tool.
130 define Package
/ffserver
131 $(call Package
/ffserver
/Default
)
134 TITLE
+= streaming server
135 DEPENDS
+= +libpthread
+libffmpeg
+@FFMPEG_FFSERVER_SUPPORT
138 define Package
/ffserver
/description
139 $(call Package
/ffmpeg
/Default
/description
)
141 This package contains the FFmpeg streaming server.
144 define Package
/libffmpeg
145 $(call Package
/ffmpeg
/Default
)
149 DEPENDS
+= +libpthread
+zlib
153 define Package
/libffmpeg
/config
154 source
"$(SOURCE)/Config.in"
157 define Package
/libffmeg
/description
158 $(call Package
/ffmpeg
/Default
/description
)
160 This package contains FFmpeg shared libraries.
163 define Package
/libpostproc
167 URL
:=http
://ffmpeg.mplayerhq.hu
/
171 define Package
/libswscale
175 URL
:=http
://ffmpeg.mplayerhq.hu
/
181 $(if
$(CONFIG_FFMPEG_
$(1)_
$(c
)),--enable-
$(2)="$(c)") \
184 FFMPEG_CONFIGURE_ENCODERS
:=$(call FILTER_CONFIG
,ENCODER
,encoder
,$(FFMPEG_ENCODERS
))
185 FFMPEG_CONFIGURE_DECODERS
:=$(call FILTER_CONFIG
,DECODER
,decoder
,$(FFMPEG_DECODERS
))
186 FFMPEG_CONFIGURE_MUXERS
:=$(call FILTER_CONFIG
,MUXER
,muxer
,$(FFMPEG_MUXERS
))
187 FFMPEG_CONFIGURE_DEMUXERS
:=$(call FILTER_CONFIG
,DEMUXER
,demuxer
,$(FFMPEG_DEMUXERS
))
188 FFMPEG_CONFIGURE_PARSERS
:=$(call FILTER_CONFIG
,PARSER
,parser
,$(FFMPEG_PARSERS
))
189 FFMPEG_CONFIGURE_PROTOCOLS
:=$(call FILTER_CONFIG
,PROTOCOL
,protocol
,$(FFMPEG_PROTOCOLS
))
191 ifneq ($(CONFIG_TARGET_x86
),)
192 TARGET_CFLAGS
+= -fomit-frame-pointer
195 # XXX: add --disable-mmx & --disable-mmx2 to fix build failure on x86
196 # libpostproc/postprocess_template.c:2195: error: can't find a register in class 'GENERAL_REGS' while reloading 'asm'
197 # libpostproc/postprocess_template.c:3124: error: can't find a register in class 'GENERAL_REGS' while reloading 'asm'
198 # libpostproc/postprocess_template.c:3207: error: can't find a register in class 'GENERAL_REGS' while reloading 'asm'
200 define Build
/Configure
201 # this is *NOT* GNU configure
202 ( cd
$(PKG_BUILD_DIR
); \
203 CFLAGS
="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS) $(FPIC)" \
204 LDFLAGS
="$(TARGET_LDFLAGS)" \
206 --enable-cross-compile \
207 --cross-prefix
="$(TARGET_CROSS)" \
219 --disable-optimizations \
221 --disable-stripping \
227 $(if
$(CONFIG_PACKAGE_ffmpeg
),,--disable-ffmpeg
) \
228 $(if
$(CONFIG_PACKAGE_ffserver
),,--disable-ffserver
) \
229 $(if
$(CONFIG_FFMPEG_IPV6
),,--disable-ipv6
) \
234 $(FFMPEG_CONFIGURE_ENCODERS
) \
236 $(FFMPEG_CONFIGURE_DECODERS
) \
238 $(FFMPEG_CONFIGURE_MUXERS
) \
240 $(FFMPEG_CONFIGURE_DEMUXERS
) \
242 $(FFMPEG_CONFIGURE_PARSERS
) \
243 --disable-protocols \
244 $(FFMPEG_CONFIGURE_PROTOCOLS
) \
249 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
250 DESTDIR
="$(PKG_INSTALL_DIR)" \
254 define Build
/InstallDev
255 $(INSTALL_DIR
) $(1)/usr
/include
256 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/libav
{codec
,device
,format
,util
} $(1)/usr
/include/
257 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/libpostproc
$(1)/usr
/include/
258 $(INSTALL_DIR
) $(1)/usr
/lib
259 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libav
{codec
,device
,format
,util
}.
{a
,so
*} $(1)/usr
/lib
/
260 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libpostproc.
{a
,so
*} $(1)/usr
/lib
/
261 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libswscale.
{a
,so
*} $(1)/usr
/lib
/
262 $(INSTALL_DIR
) $(1)/usr
/lib
/pkgconfig
263 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/pkgconfig
/libav
{codec
,device
,format
,util
}.
pc $(1)/usr
/lib
/pkgconfig
/
264 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/pkgconfig
/libpostproc.
pc $(1)/usr
/lib
/pkgconfig
/
265 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/pkgconfig
/libswscale.
pc $(1)/usr
/lib
/pkgconfig
/
268 define Package
/ffmpeg
/install
269 $(INSTALL_DIR
) $(1)/usr
/bin
270 $(CP
) $(PKG_INSTALL_DIR
)/usr
/bin
/ffmpeg
$(1)/usr
/bin
/
273 define Package
/ffserver
/install
274 $(INSTALL_DIR
) $(1)/usr
/bin
275 $(CP
) $(PKG_INSTALL_DIR
)/usr
/bin
/ffserver
$(1)/usr
/bin
/
278 define Package
/libffmpeg
/install
279 $(INSTALL_DIR
) $(1)/usr
/lib
280 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libav
{codec
,device
,format
,util
}.so.
* $(1)/usr
/lib
/
283 define Package
/libpostproc
/install
284 $(INSTALL_DIR
) $(1)/usr
/lib
285 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libpostproc.so.
* $(1)/usr
/lib
/
288 define Package
/libswscale
/install
289 $(INSTALL_DIR
) $(1)/usr
/lib
290 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libswscale.so.
* $(1)/usr
/lib
/
293 $(eval
$(call BuildPackage
,ffmpeg
))
294 $(eval
$(call BuildPackage
,ffserver
))
295 $(eval
$(call BuildPackage
,libffmpeg
))
296 $(eval
$(call BuildPackage
,libpostproc
))
297 $(eval
$(call BuildPackage
,libswscale
))