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 \
247 --disable-protocols \
248 $(if
$(CONFIG_FFMPEG_ENCODE
),,--disable-encoders
--disable-muxers
) \
249 $(if
$(CONFIG_FFMPEG_DECODE
),,--disable-decoders
--disable-demuxers
) \
250 $(FFMPEG_CONFIGURE_ENCODERS
) \
251 $(FFMPEG_CONFIGURE_DECODERS
) \
252 $(FFMPEG_CONFIGURE_MUXERS
) \
253 $(FFMPEG_CONFIGURE_DEMUXERS
) \
254 $(FFMPEG_CONFIGURE_PARSERS
) \
255 $(FFMPEG_CONFIGURE_PROTOCOLS
) \
257 $(if
$(CONFIG_PACKAGE_ffmpeg
),,--disable-ffmpeg
) \
259 $(if
$(CONFIG_PACKAGE_ffprobe
),,--disable-ffprobe
) \
260 $(if
$(CONFIG_PACKAGE_ffserver
),,--disable-ffserver
) \
266 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
267 DESTDIR
="$(PKG_INSTALL_DIR)" \
271 define Build
/InstallDev
272 $(INSTALL_DIR
) $(1)/usr
/include
273 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/libav
{codec
,device
,format
,util
} $(1)/usr
/include/
274 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/libpostproc
$(1)/usr
/include/
275 $(INSTALL_DIR
) $(1)/usr
/lib
276 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libav
{codec
,device
,format
,util
}.
{a
,so
*} $(1)/usr
/lib
/
277 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libpostproc.
{a
,so
*} $(1)/usr
/lib
/
278 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libswscale.
{a
,so
*} $(1)/usr
/lib
/
279 $(INSTALL_DIR
) $(1)/usr
/lib
/pkgconfig
280 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/pkgconfig
/libav
{codec
,device
,format
,util
}.
pc $(1)/usr
/lib
/pkgconfig
/
281 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/pkgconfig
/libpostproc.
pc $(1)/usr
/lib
/pkgconfig
/
282 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/pkgconfig
/libswscale.
pc $(1)/usr
/lib
/pkgconfig
/
285 define Package
/ffmpeg
/install
286 $(INSTALL_DIR
) $(1)/usr
/bin
287 $(CP
) $(PKG_INSTALL_DIR
)/usr
/bin
/ffmpeg
$(1)/usr
/bin
/
290 define Package
/ffprobe
/install
291 $(INSTALL_DIR_
$(1)/usr
/bin
292 $(CP
) $(PKG_INSTALL_DIR
)/usr
/bin
/ffprobe
$(1)/usr
/bin
/
295 define Package
/ffserver
/install
296 $(INSTALL_DIR
) $(1)/usr
/bin
297 $(CP
) $(PKG_INSTALL_DIR
)/usr
/bin
/ffserver
$(1)/usr
/bin
/
300 define Package
/libffmpeg
/install
301 $(INSTALL_DIR
) $(1)/usr
/lib
302 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libav
{codec
,device
,format
,util
}.so.
* $(1)/usr
/lib
/
305 define Package
/libpostproc
/install
306 $(INSTALL_DIR
) $(1)/usr
/lib
307 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libpostproc.so.
* $(1)/usr
/lib
/
310 define Package
/libswscale
/install
311 $(INSTALL_DIR
) $(1)/usr
/lib
312 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libswscale.so.
* $(1)/usr
/lib
/
315 $(eval
$(call BuildPackage
,ffmpeg
))
316 $(eval
$(call BuildPackage
,ffprobe
))
317 $(eval
$(call BuildPackage
,ffserver
))
318 $(eval
$(call BuildPackage
,libffmpeg
))
319 $(eval
$(call BuildPackage
,libpostproc
))
320 $(eval
$(call BuildPackage
,libswscale
))