2 # Copyright (C) 2006-2015 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
:=e2cc3c209f91393d35ab58598e41cf22
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 icecast 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 icecast 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 \
393 --disable-mipsdspr1 \
394 --disable-mipsdspr2 \
404 ifeq ($(BUILD_VARIANT
),custom
)
408 $(if
$($(3)_
$(c
)),--enable-
$(1)="$(c)") \
415 --disable-swresample \
417 --disable-everything \
418 $(call FFMPEG_ENABLE
,encoder
,$(FFMPEG_CUSTOM_ENCODERS
),CONFIG_FFMPEG_CUSTOM_ENCODER
) \
419 $(call FFMPEG_ENABLE
,decoder
,$(FFMPEG_CUSTOM_DECODERS
),CONFIG_FFMPEG_CUSTOM_DECODER
) \
420 $(call FFMPEG_ENABLE
,muxer
,$(FFMPEG_CUSTOM_MUXERS
),CONFIG_FFMPEG_CUSTOM_MUXER
) \
421 $(call FFMPEG_ENABLE
,demuxer
,$(FFMPEG_CUSTOM_DEMUXERS
),CONFIG_FFMPEG_CUSTOM_DEMUXER
) \
422 $(call FFMPEG_ENABLE
,parser
,$(FFMPEG_CUSTOM_PARSERS
),CONFIG_FFMPEG_CUSTOM_PARSER
) \
423 $(call FFMPEG_ENABLE
,protocol
,$(FFMPEG_CUSTOM_PROTOCOLS
),CONFIG_FFMPEG_CUSTOM_PROTOCOL
) \
425 ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_adpcm
),y
)
427 --enable-decoder
=adpcm_ima_wav \
428 --enable-decoder
=adpcm_ima_qt \
429 --enable-decoder
=adpcm_ms \
433 ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_libopus
),y
)
435 --enable-libopus
--enable-decoder
=libopus \
439 ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_speex
),y
)
441 --enable-libspeex
--enable-decoder
=libspeex \
447 ifeq ($(BUILD_VARIANT
),audio-dec
)
451 --enable-
$(1)="$(c)" \
458 --disable-swresample \
460 --disable-everything \
461 $(call FFMPEG_ENABLE
,decoder
,$(FFMPEG_AUDIO_DECODERS
)) \
462 $(call FFMPEG_ENABLE
,demuxer
,$(FFMPEG_AUDIO_DEMUXERS
)) \
463 $(call FFMPEG_ENABLE
,parser
,$(FFMPEG_AUDIO_PARSERS
)) \
464 $(call FFMPEG_ENABLE
,protocol
,$(FFMPEG_AUDIO_PROTOCOLS
)) \
465 --enable-libopus
--enable-decoder
=libopus \
466 --enable-libspeex
--enable-decoder
=libspeex \
467 --disable-decoder
=pcm_bluray
,pcm_dvd \
471 ifeq ($(BUILD_VARIANT
),mini
)
475 --enable-
$(1)="$(c)" \
483 --disable-swresample \
485 --disable-everything \
486 $(call FFMPEG_ENABLE
,decoder
,$(FFMPEG_MINI_DECODERS
)) \
487 $(call FFMPEG_ENABLE
,demuxer
,$(FFMPEG_MINI_DEMUXERS
)) \
488 $(call FFMPEG_ENABLE
,parser
,$(FFMPEG_MINI_PARSERS
)) \
489 $(call FFMPEG_ENABLE
,protocol
,$(FFMPEG_MINI_PROTOCOLS
)) \
493 ifneq ($(CONFIG_TARGET_x86
),)
494 TARGET_CFLAGS
+= -fomit-frame-pointer
497 define Build
/Configure
498 ( cd
$(PKG_BUILD_DIR
); $(FFMPEG_CONFIGURE
) )
502 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
503 DESTDIR
="$(PKG_INSTALL_DIR)" \
507 define Build
/InstallDev
/custom
508 $(INSTALL_DIR
) $(1)/usr
/include
509 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/lib
{avcodec
,avdevice
,avformat
,avutil
} $(1)/usr
/include/
510 $(INSTALL_DIR
) $(1)/usr
/lib
511 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/lib
{avcodec
,avdevice
,avformat
,avutil
}.
{a
,so
*} $(1)/usr
/lib
/
512 $(INSTALL_DIR
) $(1)/usr
/lib
/pkgconfig
513 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/pkgconfig
/lib
{avcodec
,avdevice
,avformat
,avutil
}.
pc $(1)/usr
/lib
/pkgconfig
/
516 define Build
/InstallDev
/full
517 $(INSTALL_DIR
) $(1)/usr
/include
518 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/lib
{avcodec
,avdevice
,avfilter
,avformat
,avutil
,postproc
,swresample
,swscale
} $(1)/usr
/include/
519 $(INSTALL_DIR
) $(1)/usr
/lib
520 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/lib
{avcodec
,avdevice
,avfilter
,avformat
,avutil
,postproc
,swresample
,swscale
}.
{a
,so
*} $(1)/usr
/lib
/
521 $(INSTALL_DIR
) $(1)/usr
/lib
/pkgconfig
522 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/pkgconfig
/lib
{avcodec
,avdevice
,avfilter
,avformat
,avutil
,postproc
,swresample
,swscale
}.
pc $(1)/usr
/lib
/pkgconfig
/
525 define Build
/InstallDev
/mini
526 $(INSTALL_DIR
) $(1)/usr
/include
527 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/lib
{avcodec
,avformat
,avutil
} $(1)/usr
/include/
528 $(INSTALL_DIR
) $(1)/usr
/lib
529 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/lib
{avcodec
,avformat
,avutil
}.
{a
,so
*} $(1)/usr
/lib
/
530 $(INSTALL_DIR
) $(1)/usr
/lib
/pkgconfig
531 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/pkgconfig
/lib
{avcodec
,avformat
,avutil
}.
pc $(1)/usr
/lib
/pkgconfig
/
534 Build
/InstallDev
/audio-dec
= $(Build
/InstallDev
/custom
)
536 # XXX: attempt at installing "best" dev files available
537 ifeq ($(BUILD_VARIANT
),custom
)
538 # XXX: only install "custom" dev files if -full & -mini are not selected
539 ifeq ($(CONFIG_PACKAGE_libffmpeg-full
)$(CONFIG_PACKAGE_libffmpeg-mini
),)
540 Build
/InstallDev
= $(Build
/InstallDev
/custom
)
543 ifeq ($(BUILD_VARIANT
),audio-dec
)
544 # XXX: only install "audio-dec" dev files if -full & -mini are not selected
545 ifeq ($(CONFIG_PACKAGE_libffmpeg-full
)$(CONFIG_PACKAGE_libffmpeg-mini
),)
546 Build
/InstallDev
= $(Build
/InstallDev
/audio-dec
)
549 ifeq ($(BUILD_VARIANT
),full
)
550 # XXX: always install "full" dev files if -full is selected
551 Build
/InstallDev
= $(Build
/InstallDev
/full
)
553 ifeq ($(BUILD_VARIANT
),mini
)
554 # XXX: only install "mini" dev files if -full is not selected
555 ifeq ($(CONFIG_PACKAGE_libffmpeg-full
),)
556 Build
/InstallDev
= $(Build
/InstallDev
/mini
)
560 define Package
/ffmpeg
/install
561 $(INSTALL_DIR
) $(1)/usr
/bin
562 $(CP
) $(PKG_INSTALL_DIR
)/usr
/bin
/ffmpeg
$(1)/usr
/bin
/
565 define Package
/ffprobe
/install
566 $(INSTALL_DIR
) $(1)/usr
/bin
567 $(CP
) $(PKG_INSTALL_DIR
)/usr
/bin
/ffprobe
$(1)/usr
/bin
/
570 define Package
/ffserver
/install
571 $(INSTALL_DIR
) $(1)/usr
/bin
572 $(CP
) $(PKG_INSTALL_DIR
)/usr
/bin
/ffserver
$(1)/usr
/bin
/
575 define Package
/libffmpeg-custom
/install
576 $(INSTALL_DIR
) $(1)/usr
/lib
577 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/lib
{avcodec
,avdevice
,avformat
,avutil
}.so.
* $(1)/usr
/lib
/
580 define Package
/libffmpeg-full
/install
581 $(INSTALL_DIR
) $(1)/usr
/lib
582 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/lib
{avcodec
,avdevice
,avfilter
,avformat
,avutil
,postproc
,swresample
,swscale
}.so.
* $(1)/usr
/lib
/
585 define Package
/libffmpeg-mini
/install
586 $(INSTALL_DIR
) $(1)/usr
/lib
587 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/lib
{avcodec
,avformat
,avutil
}.so.
* $(1)/usr
/lib
/
590 Package
/libffmpeg-audio-dec
/install = $(Package
/libffmpeg-custom
/install)
592 $(eval
$(call BuildPackage
,ffmpeg
))
593 $(eval
$(call BuildPackage
,ffprobe
))
594 $(eval
$(call BuildPackage
,ffserver
))
595 $(eval
$(call BuildPackage
,libffmpeg-custom
))
596 $(eval
$(call BuildPackage
,libffmpeg-full
))
597 $(eval
$(call BuildPackage
,libffmpeg-mini
))
598 $(eval
$(call BuildPackage
,libffmpeg-audio-dec
))