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
:=7e2819c71484ffba1ba1a91dd5285643
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 @
!ALL
+libopus
+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
+libopus
+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 ($(CONFIG_CPU_TYPE
),"mips32")
403 FFMPEG_CONFIGURE
+=--disable-mips32r2
406 ifeq ($(BUILD_VARIANT
),custom
)
410 $(if
$($(3)_
$(c
)),--enable-
$(1)="$(c)") \
417 --disable-swresample \
419 --disable-everything \
420 $(call FFMPEG_ENABLE
,encoder
,$(FFMPEG_CUSTOM_ENCODERS
),CONFIG_FFMPEG_CUSTOM_ENCODER
) \
421 $(call FFMPEG_ENABLE
,decoder
,$(FFMPEG_CUSTOM_DECODERS
),CONFIG_FFMPEG_CUSTOM_DECODER
) \
422 $(call FFMPEG_ENABLE
,muxer
,$(FFMPEG_CUSTOM_MUXERS
),CONFIG_FFMPEG_CUSTOM_MUXER
) \
423 $(call FFMPEG_ENABLE
,demuxer
,$(FFMPEG_CUSTOM_DEMUXERS
),CONFIG_FFMPEG_CUSTOM_DEMUXER
) \
424 $(call FFMPEG_ENABLE
,parser
,$(FFMPEG_CUSTOM_PARSERS
),CONFIG_FFMPEG_CUSTOM_PARSER
) \
425 $(call FFMPEG_ENABLE
,protocol
,$(FFMPEG_CUSTOM_PROTOCOLS
),CONFIG_FFMPEG_CUSTOM_PROTOCOL
) \
427 ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_adpcm
),y
)
429 --enable-decoder
=adpcm_ima_wav \
430 --enable-decoder
=adpcm_ima_qt \
431 --enable-decoder
=adpcm_ms \
435 ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_libopus
),y
)
437 --enable-libopus
--enable-decoder
=libopus \
441 ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_speex
),y
)
443 --enable-libspeex
--enable-decoder
=libspeex \
449 ifeq ($(BUILD_VARIANT
),audio-dec
)
453 --enable-
$(1)="$(c)" \
460 --disable-swresample \
462 --disable-everything \
463 $(call FFMPEG_ENABLE
,decoder
,$(FFMPEG_AUDIO_DECODERS
)) \
464 $(call FFMPEG_ENABLE
,demuxer
,$(FFMPEG_AUDIO_DEMUXERS
)) \
465 $(call FFMPEG_ENABLE
,parser
,$(FFMPEG_AUDIO_PARSERS
)) \
466 $(call FFMPEG_ENABLE
,protocol
,$(FFMPEG_AUDIO_PROTOCOLS
)) \
467 --enable-libopus
--enable-decoder
=libopus \
468 --enable-libspeex
--enable-decoder
=libspeex \
469 --disable-decoder
=pcm_bluray
,pcm_dvd \
473 ifeq ($(BUILD_VARIANT
),mini
)
477 --enable-
$(1)="$(c)" \
485 --disable-swresample \
487 --disable-everything \
488 $(call FFMPEG_ENABLE
,decoder
,$(FFMPEG_MINI_DECODERS
)) \
489 $(call FFMPEG_ENABLE
,demuxer
,$(FFMPEG_MINI_DEMUXERS
)) \
490 $(call FFMPEG_ENABLE
,parser
,$(FFMPEG_MINI_PARSERS
)) \
491 $(call FFMPEG_ENABLE
,protocol
,$(FFMPEG_MINI_PROTOCOLS
)) \
495 ifneq ($(CONFIG_TARGET_x86
),)
496 TARGET_CFLAGS
+= -fomit-frame-pointer
499 define Build
/Configure
500 ( cd
$(PKG_BUILD_DIR
); $(FFMPEG_CONFIGURE
) )
504 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
505 DESTDIR
="$(PKG_INSTALL_DIR)" \
509 define Build
/InstallDev
/custom
510 $(INSTALL_DIR
) $(1)/usr
/include
511 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/lib
{avcodec
,avdevice
,avformat
,avutil
} $(1)/usr
/include/
512 $(INSTALL_DIR
) $(1)/usr
/lib
513 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/lib
{avcodec
,avdevice
,avformat
,avutil
}.
{a
,so
*} $(1)/usr
/lib
/
514 $(INSTALL_DIR
) $(1)/usr
/lib
/pkgconfig
515 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/pkgconfig
/lib
{avcodec
,avdevice
,avformat
,avutil
}.
pc $(1)/usr
/lib
/pkgconfig
/
518 define Build
/InstallDev
/full
519 $(INSTALL_DIR
) $(1)/usr
/include
520 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/lib
{avcodec
,avdevice
,avfilter
,avformat
,avutil
,postproc
,swresample
,swscale
} $(1)/usr
/include/
521 $(INSTALL_DIR
) $(1)/usr
/lib
522 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/lib
{avcodec
,avdevice
,avfilter
,avformat
,avutil
,postproc
,swresample
,swscale
}.
{a
,so
*} $(1)/usr
/lib
/
523 $(INSTALL_DIR
) $(1)/usr
/lib
/pkgconfig
524 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/pkgconfig
/lib
{avcodec
,avdevice
,avfilter
,avformat
,avutil
,postproc
,swresample
,swscale
}.
pc $(1)/usr
/lib
/pkgconfig
/
527 define Build
/InstallDev
/mini
528 $(INSTALL_DIR
) $(1)/usr
/include
529 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/lib
{avcodec
,avformat
,avutil
} $(1)/usr
/include/
530 $(INSTALL_DIR
) $(1)/usr
/lib
531 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/lib
{avcodec
,avformat
,avutil
}.
{a
,so
*} $(1)/usr
/lib
/
532 $(INSTALL_DIR
) $(1)/usr
/lib
/pkgconfig
533 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/pkgconfig
/lib
{avcodec
,avformat
,avutil
}.
pc $(1)/usr
/lib
/pkgconfig
/
536 Build
/InstallDev
/audio-dec
= $(Build
/InstallDev
/custom
)
538 # XXX: attempt at installing "best" dev files available
539 ifeq ($(BUILD_VARIANT
),custom
)
540 # XXX: only install "custom" dev files if -full & -mini are not selected
541 ifeq ($(CONFIG_PACKAGE_libffmpeg-full
)$(CONFIG_PACKAGE_libffmpeg-mini
),)
542 Build
/InstallDev
= $(Build
/InstallDev
/custom
)
545 ifeq ($(BUILD_VARIANT
),audio-dec
)
546 # XXX: only install "audio-dec" dev files if -full & -mini are not selected
547 ifeq ($(CONFIG_PACKAGE_libffmpeg-full
)$(CONFIG_PACKAGE_libffmpeg-mini
),)
548 Build
/InstallDev
= $(Build
/InstallDev
/audio-dec
)
551 ifeq ($(BUILD_VARIANT
),full
)
552 # XXX: always install "full" dev files if -full is selected
553 Build
/InstallDev
= $(Build
/InstallDev
/full
)
555 ifeq ($(BUILD_VARIANT
),mini
)
556 # XXX: only install "mini" dev files if -full is not selected
557 ifeq ($(CONFIG_PACKAGE_libffmpeg-full
),)
558 Build
/InstallDev
= $(Build
/InstallDev
/mini
)
562 define Package
/ffmpeg
/install
563 $(INSTALL_DIR
) $(1)/usr
/bin
564 $(CP
) $(PKG_INSTALL_DIR
)/usr
/bin
/ffmpeg
$(1)/usr
/bin
/
567 define Package
/ffprobe
/install
568 $(INSTALL_DIR
) $(1)/usr
/bin
569 $(CP
) $(PKG_INSTALL_DIR
)/usr
/bin
/ffprobe
$(1)/usr
/bin
/
572 define Package
/ffserver
/install
573 $(INSTALL_DIR
) $(1)/usr
/bin
574 $(CP
) $(PKG_INSTALL_DIR
)/usr
/bin
/ffserver
$(1)/usr
/bin
/
577 define Package
/libffmpeg-custom
/install
578 $(INSTALL_DIR
) $(1)/usr
/lib
579 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/lib
{avcodec
,avdevice
,avformat
,avutil
}.so.
* $(1)/usr
/lib
/
582 define Package
/libffmpeg-full
/install
583 $(INSTALL_DIR
) $(1)/usr
/lib
584 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/lib
{avcodec
,avdevice
,avfilter
,avformat
,avutil
,postproc
,swresample
,swscale
}.so.
* $(1)/usr
/lib
/
587 define Package
/libffmpeg-mini
/install
588 $(INSTALL_DIR
) $(1)/usr
/lib
589 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/lib
{avcodec
,avformat
,avutil
}.so.
* $(1)/usr
/lib
/
592 Package
/libffmpeg-audio-dec
/install = $(Package
/libffmpeg-custom
/install)
594 $(eval
$(call BuildPackage
,ffmpeg
))
595 $(eval
$(call BuildPackage
,ffprobe
))
596 $(eval
$(call BuildPackage
,ffserver
))
597 $(eval
$(call BuildPackage
,libffmpeg-custom
))
598 $(eval
$(call BuildPackage
,libffmpeg-full
))
599 $(eval
$(call BuildPackage
,libffmpeg-mini
))
600 $(eval
$(call BuildPackage
,libffmpeg-audio-dec
))