2 # Copyright (C) 2006-2014 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
:=bb02e99c39941d7f3dc56658b9324a2b
17 PKG_MAINTAINER
:=Ted Hess
<thess@kitschensync.net
>
19 PKG_LICENSE
:=LGPL-2.1
+ GPL-2
+ LGPL-3
20 PKG_LICENSE_FILES
:=COPYING.GPLv2 COPYING.GPLv3 COPYING.LGPLv2.1 COPYING.LGPLv3
22 FFMPEG_CUSTOM_ENCODERS
:= \
34 FFMPEG_CUSTOM_DECODERS
:= \
63 FFMPEG_CUSTOM_MUXERS
:= \
75 FFMPEG_CUSTOM_DEMUXERS
:= \
101 FFMPEG_CUSTOM_PARSERS
:= \
110 FFMPEG_CUSTOM_PROTOCOLS
:= \
111 file http pipe rtp tcp udp
113 FFMPEG_MINI_DECODERS
:= \
128 FFMPEG_MINI_DEMUXERS
:= \
140 FFMPEG_MINI_PARSERS
:= \
147 FFMPEG_MINI_PROTOCOLS
:= \
150 FFMPEG_AUDIO_DECODERS
:= \
174 FFMPEG_AUDIO_DEMUXERS
:= \
197 FFMPEG_AUDIO_PARSERS
:= \
204 FFMPEG_AUDIO_PROTOCOLS
:= \
205 file http rtp tcp udp
208 PKG_BUILD_DIR
:=$(BUILD_DIR
)/$(PKG_NAME
)-$(BUILD_VARIANT
)/$(PKG_NAME
)-$(PKG_VERSION
)
210 PKG_CONFIG_DEPENDS
:= \
211 $(patsubst %,CONFIG_FFMPEG_CUSTOM_ENCODER_
%,$(FFMPEG_CUSTOM_ENCODERS
)) \
212 $(patsubst %,CONFIG_FFMPEG_CUSTOM_DECODER_
%,$(FFMPEG_CUSTOM_DECODERS
)) \
213 $(patsubst %,CONFIG_FFMPEG_CUSTOM_MUXER_
%,$(FFMPEG_CUSTOM_DEMUXERS
)) \
214 $(patsubst %,CONFIG_FFMPEG_CUSTOM_DEMUXER_
%,$(FFMPEG_CUSTOM_DEMUXERS
)) \
215 $(patsubst %,CONFIG_FFMPEG_CUSTOM_PARSER_
%,$(FFMPEG_CUSTOM_PARSERS
)) \
216 $(patsubst %,CONFIG_FFMPEG_CUSTOM_PROTOCOL_
%,$(FFMPEG_CUSTOM_PROTOCOLS
))
218 include $(INCLUDE_DIR
)/package.mk
220 define Package
/ffmpeg
/Default
222 URL
:=http
://ffmpeg.mplayerhq.hu
/
225 define Package
/ffmpeg
/Default
/description
226 FFmpeg is a a software package that can record
, convert and stream digital
227 audio and video in numerous formats.
231 define Package
/ffmpeg
232 $(call Package
/ffmpeg
/Default
)
236 DEPENDS
+= +libpthread
+libffmpeg-full
240 define Package
/ffmpeg
/description
241 $(call Package
/ffmpeg
/Default
/description
)
243 This package contains the FFmpeg command line tool.
247 define Package
/ffprobe
248 $(call Package
/ffmpeg
/Default
)
251 TITLE
+= CLI media identifier
252 DEPENDS
+= +libffmpeg-full
256 define Package
/ffprobe
/description
257 $(call Package
/ffmpeg
/Default
/description
)
259 This package contains the FFprobe command line tool.
263 define Package
/ffserver
264 $(call Package
/ffserver
/Default
)
267 TITLE
+= streaming server
268 DEPENDS
+= +libpthread
+libffmpeg-full
272 define Package
/ffserver
/description
273 $(call Package
/ffmpeg
/Default
/description
)
275 This package contains the FFmpeg streaming server.
279 define Package
/libffmpeg
/Default
280 $(call Package
/ffmpeg
/Default
)
284 DEPENDS
+= +libpthread
+zlib
+libbz2
289 define Package
/libffmpeg-custom
290 $(call Package
/libffmpeg
/Default
)
292 DEPENDS
+= @DEVEL
+libspeex
297 define Package
/libffmpeg-custom
/config
298 source
"$(SOURCE)/Config.in"
301 define Package
/libffmpeg-custom
/description
302 $(call Package
/ffmpeg
/Default
/description
)
304 This package contains customized FFmpeg shared libraries.
308 define Package
/libffmpeg-audio-dec
309 $(call Package
/libffmpeg
/Default
)
311 DEPENDS
+= @DEVEL
+libspeex
315 define Package
/libffmpeg-audio-dec
/description
316 $(call Package
/ffmpeg
/Default
/description
)
318 This package contains FFmpeg shared libraries for audio decoding
322 define Package
/libffmpeg-full
323 $(call Package
/libffmpeg
/Default
)
325 DEPENDS
+= @BUILD_PATENTED
+alsa-lib
329 define Package
/libffmpeg-full
/description
330 $(call Package
/ffmpeg
/Default
/description
)
332 This package contains full-featured FFmpeg shared libraries.
336 define Package
/libffmpeg-mini
337 $(call Package
/libffmpeg
/Default
)
339 DEPENDS
+= @BUILD_PATENTED
343 define Package
/libffmpeg-mini
/description
344 $(call Package
/ffmpeg
/Default
/description
)
346 This package contains minimal-featured FFmpeg shared libraries.
351 CFLAGS
="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS) $(FPIC)" \
352 LDFLAGS
="$(TARGET_LDFLAGS)" \
354 --enable-cross-compile \
355 --cross-prefix
="$(TARGET_CROSS)" \
359 --pkg-config
="pkg-config" \
365 --disable-runtime-cpudetect \
374 --disable-amd3dnowext \
390 --disable-inline-asm \
392 --disable-mipsdspr1 \
393 --disable-mipsdspr2 \
402 ifeq ($(BUILD_VARIANT
),custom
)
406 $(if
$($(3)_
$(c
)),--enable-
$(1)="$(c)") \
413 --disable-swresample \
415 --disable-everything \
416 $(call FFMPEG_ENABLE
,encoder
,$(FFMPEG_CUSTOM_ENCODERS
),CONFIG_FFMPEG_CUSTOM_ENCODER
) \
417 $(call FFMPEG_ENABLE
,decoder
,$(FFMPEG_CUSTOM_DECODERS
),CONFIG_FFMPEG_CUSTOM_DECODER
) \
418 $(call FFMPEG_ENABLE
,muxer
,$(FFMPEG_CUSTOM_MUXERS
),CONFIG_FFMPEG_CUSTOM_MUXER
) \
419 $(call FFMPEG_ENABLE
,demuxer
,$(FFMPEG_CUSTOM_DEMUXERS
),CONFIG_FFMPEG_CUSTOM_DEMUXER
) \
420 $(call FFMPEG_ENABLE
,parser
,$(FFMPEG_CUSTOM_PARSERS
),CONFIG_FFMPEG_CUSTOM_PARSER
) \
421 $(call FFMPEG_ENABLE
,protocol
,$(FFMPEG_CUSTOM_PROTOCOLS
),CONFIG_FFMPEG_CUSTOM_PROTOCOL
) \
423 ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_adpcm
),y
)
425 --enable-decoder
=adpcm_ima_wav \
426 --enable-decoder
=adpcm_ima_qt \
427 --enable-decoder
=adpcm_ms \
431 ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_speex
),y
)
433 --enable-libspeex
--enable-decoder
=libspeex \
439 ifeq ($(BUILD_VARIANT
),audio-dec
)
443 --enable-
$(1)="$(c)" \
450 --disable-swresample \
452 --disable-everything \
453 $(call FFMPEG_ENABLE
,decoder
,$(FFMPEG_AUDIO_DECODERS
)) \
454 $(call FFMPEG_ENABLE
,demuxer
,$(FFMPEG_AUDIO_DEMUXERS
)) \
455 $(call FFMPEG_ENABLE
,parser
,$(FFMPEG_AUDIO_PARSERS
)) \
456 $(call FFMPEG_ENABLE
,protocol
,$(FFMPEG_AUDIO_PROTOCOLS
)) \
457 --enable-libspeex
--enable-decoder
=libspeex \
458 --disable-decoder
=pcm_bluray
,pcm_dvd \
462 ifeq ($(BUILD_VARIANT
),mini
)
466 --enable-
$(1)="$(c)" \
474 --disable-swresample \
476 --disable-everything \
477 $(call FFMPEG_ENABLE
,decoder
,$(FFMPEG_MINI_DECODERS
)) \
478 $(call FFMPEG_ENABLE
,demuxer
,$(FFMPEG_MINI_DEMUXERS
)) \
479 $(call FFMPEG_ENABLE
,parser
,$(FFMPEG_MINI_PARSERS
)) \
480 $(call FFMPEG_ENABLE
,protocol
,$(FFMPEG_MINI_PROTOCOLS
)) \
484 ifneq ($(CONFIG_TARGET_x86
),)
485 TARGET_CFLAGS
+= -fomit-frame-pointer
488 define Build
/Configure
489 ( cd
$(PKG_BUILD_DIR
); $(FFMPEG_CONFIGURE
) )
493 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
494 DESTDIR
="$(PKG_INSTALL_DIR)" \
498 define Build
/InstallDev
/custom
499 $(INSTALL_DIR
) $(1)/usr
/include
500 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/lib
{avcodec
,avdevice
,avformat
,avutil
} $(1)/usr
/include/
501 $(INSTALL_DIR
) $(1)/usr
/lib
502 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/lib
{avcodec
,avdevice
,avformat
,avutil
}.
{a
,so
*} $(1)/usr
/lib
/
503 $(INSTALL_DIR
) $(1)/usr
/lib
/pkgconfig
504 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/pkgconfig
/lib
{avcodec
,avdevice
,avformat
,avutil
}.
pc $(1)/usr
/lib
/pkgconfig
/
507 define Build
/InstallDev
/full
508 $(INSTALL_DIR
) $(1)/usr
/include
509 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/lib
{avcodec
,avdevice
,avfilter
,avformat
,avutil
,postproc
,swresample
,swscale
} $(1)/usr
/include/
510 $(INSTALL_DIR
) $(1)/usr
/lib
511 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/lib
{avcodec
,avdevice
,avfilter
,avformat
,avutil
,postproc
,swresample
,swscale
}.
{a
,so
*} $(1)/usr
/lib
/
512 $(INSTALL_DIR
) $(1)/usr
/lib
/pkgconfig
513 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/pkgconfig
/lib
{avcodec
,avdevice
,avfilter
,avformat
,avutil
,postproc
,swresample
,swscale
}.
pc $(1)/usr
/lib
/pkgconfig
/
516 define Build
/InstallDev
/mini
517 $(INSTALL_DIR
) $(1)/usr
/include
518 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/lib
{avcodec
,avformat
,avutil
} $(1)/usr
/include/
519 $(INSTALL_DIR
) $(1)/usr
/lib
520 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/lib
{avcodec
,avformat
,avutil
}.
{a
,so
*} $(1)/usr
/lib
/
521 $(INSTALL_DIR
) $(1)/usr
/lib
/pkgconfig
522 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/pkgconfig
/lib
{avcodec
,avformat
,avutil
}.
pc $(1)/usr
/lib
/pkgconfig
/
525 Build
/InstallDev
/audio-dec
= $(Build
/InstallDev
/custom
)
527 # XXX: attempt at installing "best" dev files available
528 ifeq ($(BUILD_VARIANT
),custom
)
529 # XXX: only install "custom" dev files if -full & -mini are not selected
530 ifeq ($(CONFIG_PACKAGE_libffmpeg-full
)$(CONFIG_PACKAGE_libffmpeg-mini
),)
531 Build
/InstallDev
= $(Build
/InstallDev
/custom
)
534 ifeq ($(BUILD_VARIANT
),audio-dec
)
535 # XXX: only install "audio-dec" dev files if -full & -mini are not selected
536 ifeq ($(CONFIG_PACKAGE_libffmpeg-full
)$(CONFIG_PACKAGE_libffmpeg-mini
),)
537 Build
/InstallDev
= $(Build
/InstallDev
/audio-dec
)
540 ifeq ($(BUILD_VARIANT
),full
)
541 # XXX: always install "full" dev files if -full is selected
542 Build
/InstallDev
= $(Build
/InstallDev
/full
)
544 ifeq ($(BUILD_VARIANT
),mini
)
545 # XXX: only install "mini" dev files if -full is not selected
546 ifeq ($(CONFIG_PACKAGE_libffmpeg-full
),)
547 Build
/InstallDev
= $(Build
/InstallDev
/mini
)
551 define Package
/ffmpeg
/install
552 $(INSTALL_DIR
) $(1)/usr
/bin
553 $(CP
) $(PKG_INSTALL_DIR
)/usr
/bin
/ffmpeg
$(1)/usr
/bin
/
556 define Package
/ffprobe
/install
557 $(INSTALL_DIR
) $(1)/usr
/bin
558 $(CP
) $(PKG_INSTALL_DIR
)/usr
/bin
/ffprobe
$(1)/usr
/bin
/
561 define Package
/ffserver
/install
562 $(INSTALL_DIR
) $(1)/usr
/bin
563 $(CP
) $(PKG_INSTALL_DIR
)/usr
/bin
/ffserver
$(1)/usr
/bin
/
566 define Package
/libffmpeg-custom
/install
567 $(INSTALL_DIR
) $(1)/usr
/lib
568 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/lib
{avcodec
,avdevice
,avformat
,avutil
}.so.
* $(1)/usr
/lib
/
571 define Package
/libffmpeg-full
/install
572 $(INSTALL_DIR
) $(1)/usr
/lib
573 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/lib
{avcodec
,avdevice
,avfilter
,avformat
,avutil
,postproc
,swresample
,swscale
}.so.
* $(1)/usr
/lib
/
576 define Package
/libffmpeg-mini
/install
577 $(INSTALL_DIR
) $(1)/usr
/lib
578 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/lib
{avcodec
,avformat
,avutil
}.so.
* $(1)/usr
/lib
/
581 Package
/libffmpeg-audio-dec
/install = $(Package
/libffmpeg-custom
/install)
583 $(eval
$(call BuildPackage
,ffmpeg
))
584 $(eval
$(call BuildPackage
,ffprobe
))
585 $(eval
$(call BuildPackage
,ffserver
))
586 $(eval
$(call BuildPackage
,libffmpeg-custom
))
587 $(eval
$(call BuildPackage
,libffmpeg-full
))
588 $(eval
$(call BuildPackage
,libffmpeg-mini
))
589 $(eval
$(call BuildPackage
,libffmpeg-audio-dec
))