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
18 FFMPEG_CUSTOM_ENCODERS
:= \
30 FFMPEG_CUSTOM_DECODERS
:= \
52 FFMPEG_CUSTOM_MUXERS
:= \
64 FFMPEG_CUSTOM_DEMUXERS
:= \
83 FFMPEG_CUSTOM_PARSERS
:= \
91 FFMPEG_CUSTOM_PROTOCOLS
:= \
92 file http pipe rtp tcp udp
94 FFMPEG_MINI_ENCODERS
:= \
96 FFMPEG_MINI_DECODERS
:= \
113 FFMPEG_MINI_MUXERS
:= \
116 FFMPEG_MINI_DEMUXERS
:= \
131 FFMPEG_MINI_PARSERS
:= \
139 FFMPEG_MINI_PROTOCOLS
:= \
140 file http rtp tcp udp \
142 PKG_BUILD_DIR
:=$(BUILD_DIR
)/$(PKG_NAME
)-$(BUILD_VARIANT
)/$(PKG_NAME
)-$(PKG_VERSION
)
144 PKG_CONFIG_DEPENDS
:= \
145 $(patsubst %,CONFIG_FFMPEG_CUSTOM_ENCODER_
%,$(FFMPEG_CUSTOM_ENCODERS
)) \
146 $(patsubst %,CONFIG_FFMPEG_CUSTOM_DECODER_
%,$(FFMPEG_CUSTOM_DECODERS
)) \
147 $(patsubst %,CONFIG_FFMPEG_CUSTOM_MUXER_
%,$(FFMPEG_CUSTOM_DEMUXERS
)) \
148 $(patsubst %,CONFIG_FFMPEG_CUSTOM_DEMUXER_
%,$(FFMPEG_CUSTOM_DEMUXERS
)) \
149 $(patsubst %,CONFIG_FFMPEG_CUSTOM_PARSER_
%,$(FFMPEG_CUSTOM_PARSERS
)) \
150 $(patsubst %,CONFIG_FFMPEG_CUSTOM_PROTOCOL_
%,$(FFMPEG_CUSTOM_PROTOCOLS
))
152 include $(INCLUDE_DIR
)/package.mk
154 define Package
/ffmpeg
/Default
156 URL
:=http
://ffmpeg.mplayerhq.hu
/
159 define Package
/ffmpeg
/Default
/description
160 FFmpeg is a a software package that can record
, convert and stream digital
161 audio and video in numerous formats.
165 define Package
/ffmpeg
166 $(call Package
/ffmpeg
/Default
)
170 DEPENDS
+= +libpthread
+libffmpeg
174 define Package
/ffmpeg
/description
175 $(call Package
/ffmpeg
/Default
/description
)
177 This package contains the FFmpeg command line tool.
181 define Package
/ffprobe
182 $(call Package
/ffmpeg
/Default
)
185 TITLE
+= CLI media identifier
190 define Package
/ffprobe
/description
191 $(call Package
/ffmpeg
/Default
/description
)
193 This package contains the FFprobe command line tool.
197 define Package
/ffserver
198 $(call Package
/ffserver
/Default
)
201 TITLE
+= streaming server
202 DEPENDS
+= +libpthread
+libffmpeg
206 define Package
/ffserver
/description
207 $(call Package
/ffmpeg
/Default
/description
)
209 This package contains the FFmpeg streaming server.
213 define Package
/libffmpeg
/Default
214 $(call Package
/ffmpeg
/Default
)
218 DEPENDS
+= +libpthread
+zlib
223 define Package
/libffmpeg-custom
224 $(call Package
/libffmpeg
/Default
)
231 define Package
/libffmpeg-custom
/config
232 source
"$(SOURCE)/Config.in"
235 define Package
/libffmpeg-custom
/description
236 $(call Package
/ffmpeg
/Default
/description
)
238 This package contains customized FFmpeg shared libraries.
242 define Package
/libffmpeg-full
243 $(call Package
/libffmpeg
/Default
)
245 DEPENDS
+= @BUILD_PATENTED
+alsa-lib
249 define Package
/libffmpeg-full
/description
250 $(call Package
/ffmpeg
/Default
/description
)
252 This package contains full-featured FFmpeg shared libraries.
256 define Package
/libffmpeg-mini
257 $(call Package
/libffmpeg
/Default
)
259 DEPENDS
+= @BUILD_PATENTED
263 define Package
/libffmpeg-mini
/description
264 $(call Package
/ffmpeg
/Default
/description
)
266 This package contains minimal-featured FFmpeg shared libraries.
271 CFLAGS
="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS) $(FPIC)" \
272 LDFLAGS
="$(TARGET_LDFLAGS)" \
273 PKG_CONFIG
="pkg-config" \
275 --enable-cross-compile \
276 --cross-prefix
="$(TARGET_CROSS)" \
291 --disable-optimizations \
293 --disable-stripping \
296 ifeq ($(BUILD_VARIANT
),custom
)
300 $(if
$($(3)_
$(c
)),--enable-
$(1)="$(c)") \
311 --disable-everything \
312 $(call FFMPEG_ENABLE
,encoder
,$(FFMPEG_CUSTOM_ENCODERS
),CONFIG_FFMPEG_ENCODER
) \
313 $(call FFMPEG_ENABLE
,decoder
,$(FFMPEG_CUSTOM_DECODERS
),CONFIG_FFMPEG_DECODER
) \
314 $(call FFMPEG_ENABLE
,muxer
,$(FFMPEG_CUSTOM_MUXERS
),CONFIG_FFMPEG_MUXER
) \
315 $(call FFMPEG_ENABLE
,demuxer
,$(FFMPEG_CUSTOM_DEMUXERS
),CONFIG_FFMPEG_DEMUXER
) \
316 $(call FFMPEG_ENABLE
,parser
,$(FFMPEG_CUSTOM_PARSERS
),CONFIG_FFMPEG_PARSER
) \
317 $(call FFMPEG_ENABLE
,protocol
,$(FFMPEG_CUSTOM_PROTOCOLS
),CONFIG_FFMPEG_PROTOCOL
) \
321 ifeq ($(BUILD_VARIANT
),mini
)
325 --enable-
$(1)="$(c)" \
336 --disable-everything \
337 $(call FFMPEG_ENABLE
,encoder
,$(FFMPEG_MINI_ENCODERS
)) \
338 $(call FFMPEG_ENABLE
,decoder
,$(FFMPEG_MINI_DECODERS
)) \
339 $(call FFMPEG_ENABLE
,muxer
,$(FFMPEG_MINI_MUXERS
)) \
340 $(call FFMPEG_ENABLE
,demuxer
,$(FFMPEG_MINI_DEMUXERS
)) \
341 $(call FFMPEG_ENABLE
,parser
,$(FFMPEG_MINI_PARSERS
)) \
342 $(call FFMPEG_ENABLE
,protocol
,$(FFMPEG_MINI_PROTOCOLS
)) \
346 ifneq ($(CONFIG_TARGET_x86
),)
347 TARGET_CFLAGS
+= -fomit-frame-pointer
350 define Build
/Configure
351 ( cd
$(PKG_BUILD_DIR
); $(FFMPEG_CONFIGURE
) )
355 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
356 DESTDIR
="$(PKG_INSTALL_DIR)" \
360 define Build
/InstallDev
/custom
361 $(INSTALL_DIR
) $(1)/usr
/include
362 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/lib
{avcodec
,avdevice
,avformat
,avutil
} $(1)/usr
/include/
363 $(INSTALL_DIR
) $(1)/usr
/lib
364 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/lib
{avcodec
,avdevice
,avformat
,avutil
}.
{a
,so
*} $(1)/usr
/lib
/
365 $(INSTALL_DIR
) $(1)/usr
/lib
/pkgconfig
366 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/pkgconfig
/lib
{avcodec
,avdevice
,avformat
,avutil
}.
pc $(1)/usr
/lib
/pkgconfig
/
369 define Build
/InstallDev
/full
370 $(INSTALL_DIR
) $(1)/usr
/include
371 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/lib
{avcodec
,avdevice
,avfilter
,avformat
,avutil
,postproc
,swscale
} $(1)/usr
/include/
372 $(INSTALL_DIR
) $(1)/usr
/lib
373 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/lib
{avcodec
,avdevice
,avfilter
,avformat
,avutil
,postproc
,swscale
}.
{a
,so
*} $(1)/usr
/lib
/
374 $(INSTALL_DIR
) $(1)/usr
/lib
/pkgconfig
375 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/pkgconfig
/lib
{avcodec
,avdevice
,avfilter
,avformat
,avutil
,postproc
,swscale
}.
pc $(1)/usr
/lib
/pkgconfig
/
378 Build
/InstallDev
/mini
= $(Build
/InstallDev
/custom
)
380 # XXX: attempt at installing "best" dev files available
381 ifeq ($(BUILD_VARIANT
),custom
)
382 # XXX: only install "custom" dev files if -full & -mini are not selected
383 ifeq ($(CONFIG_PACKAGE_libffmpeg-full
)$(CONFIG_PACKAGE_libffmpeg-mini
),)
384 Build
/InstallDev
= $(Build
/InstallDev
/custom
)
387 ifeq ($(BUILD_VARIANT
),full
)
388 # XXX: always install "full" dev files if -full is selected
389 Build
/InstallDev
= $(Build
/InstallDev
/full
)
391 ifeq ($(BUILD_VARIANT
),mini
)
392 # XXX: only install "mini" dev files if -full is not selected
393 ifeq ($(CONFIG_PACKAGE_libffmpeg-full
),)
394 Build
/InstallDev
= $(Build
/InstallDev
/mini
)
398 define Package
/ffmpeg
/install
399 $(INSTALL_DIR
) $(1)/usr
/bin
400 $(CP
) $(PKG_INSTALL_DIR
)/usr
/bin
/ffmpeg
$(1)/usr
/bin
/
403 define Package
/ffprobe
/install
404 $(INSTALL_DIR
) $(1)/usr
/bin
405 $(CP
) $(PKG_INSTALL_DIR
)/usr
/bin
/ffprobe
$(1)/usr
/bin
/
408 define Package
/ffserver
/install
409 $(INSTALL_DIR
) $(1)/usr
/bin
410 $(CP
) $(PKG_INSTALL_DIR
)/usr
/bin
/ffserver
$(1)/usr
/bin
/
413 define Package
/libffmpeg-custom
/install
414 $(INSTALL_DIR
) $(1)/usr
/lib
415 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/lib
{avcodec
,avdevice
,avformat
,avutil
}.so.
* $(1)/usr
/lib
/
418 define Package
/libffmpeg-full
/install
419 $(INSTALL_DIR
) $(1)/usr
/lib
420 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/lib
{avcodec
,avdevice
,avfilter
,avformat
,avutil
,postproc
,swscale
}.so.
* $(1)/usr
/lib
/
423 Package
/libffmpeg-mini
/install = $(Package
/libffmpeg-custom
/install)
425 $(eval
$(call BuildPackage
,ffmpeg
))
426 $(eval
$(call BuildPackage
,ffprobe
))
427 $(eval
$(call BuildPackage
,ffserver
))
428 $(eval
$(call BuildPackage
,libffmpeg-custom
))
429 $(eval
$(call BuildPackage
,libffmpeg-full
))
430 $(eval
$(call BuildPackage
,libffmpeg-mini
))