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)" \
217 --disable-amd3dnowext \
221 --disable-optimizations \
223 --disable-stripping \
229 $(if
$(CONFIG_PACKAGE_ffmpeg
),,--disable-ffmpeg
) \
230 $(if
$(CONFIG_PACKAGE_ffserver
),,--disable-ffserver
) \
231 $(if
$(CONFIG_FFMPEG_IPV6
),,--disable-ipv6
) \
236 $(FFMPEG_CONFIGURE_ENCODERS
) \
238 $(FFMPEG_CONFIGURE_DECODERS
) \
240 $(FFMPEG_CONFIGURE_MUXERS
) \
242 $(FFMPEG_CONFIGURE_DEMUXERS
) \
244 $(FFMPEG_CONFIGURE_PARSERS
) \
245 --disable-protocols \
246 $(FFMPEG_CONFIGURE_PROTOCOLS
) \
251 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
252 DESTDIR
="$(PKG_INSTALL_DIR)" \
256 define Build
/InstallDev
257 $(INSTALL_DIR
) $(1)/usr
/include
258 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/libav
{codec
,device
,format
,util
} $(1)/usr
/include/
259 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/libpostproc
$(1)/usr
/include/
260 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/libswscale
$(1)/usr
/include/
261 $(INSTALL_DIR
) $(1)/usr
/lib
262 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libav
{codec
,device
,format
,util
}.
{a
,so
*} $(1)/usr
/lib
/
263 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libpostproc.
{a
,so
*} $(1)/usr
/lib
/
264 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libswscale.
{a
,so
*} $(1)/usr
/lib
/
265 $(INSTALL_DIR
) $(1)/usr
/lib
/pkgconfig
266 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/pkgconfig
/libav
{codec
,device
,format
,util
}.
pc $(1)/usr
/lib
/pkgconfig
/
267 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/pkgconfig
/libpostproc.
pc $(1)/usr
/lib
/pkgconfig
/
268 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/pkgconfig
/libswscale.
pc $(1)/usr
/lib
/pkgconfig
/
271 define Package
/ffmpeg
/install
272 $(INSTALL_DIR
) $(1)/usr
/bin
273 $(CP
) $(PKG_INSTALL_DIR
)/usr
/bin
/ffmpeg
$(1)/usr
/bin
/
276 define Package
/ffserver
/install
277 $(INSTALL_DIR
) $(1)/usr
/bin
278 $(CP
) $(PKG_INSTALL_DIR
)/usr
/bin
/ffserver
$(1)/usr
/bin
/
281 define Package
/libffmpeg
/install
282 $(INSTALL_DIR
) $(1)/usr
/lib
283 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libav
{codec
,device
,format
,util
}.so.
* $(1)/usr
/lib
/
286 define Package
/libpostproc
/install
287 $(INSTALL_DIR
) $(1)/usr
/lib
288 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libpostproc.so.
* $(1)/usr
/lib
/
291 define Package
/libswscale
/install
292 $(INSTALL_DIR
) $(1)/usr
/lib
293 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libswscale.so.
* $(1)/usr
/lib
/
296 $(eval
$(call BuildPackage
,ffmpeg
))
297 $(eval
$(call BuildPackage
,ffserver
))
298 $(eval
$(call BuildPackage
,libffmpeg
))
299 $(eval
$(call BuildPackage
,libpostproc
))
300 $(eval
$(call BuildPackage
,libswscale
))