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.xz
15 PKG_SOURCE_URL
:=http
://ffmpeg.org
/releases
/
16 PKG_MD5SUM
:=dea35a30de724e1851a94680fc209a0d
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
:= \
175 FFMPEG_AUDIO_DEMUXERS
:= \
198 FFMPEG_AUDIO_PARSERS
:= \
206 FFMPEG_AUDIO_PROTOCOLS
:= \
207 file http icecast rtp tcp udp
210 PKG_BUILD_DIR
:=$(BUILD_DIR
)/$(PKG_NAME
)-$(BUILD_VARIANT
)/$(PKG_NAME
)-$(PKG_VERSION
)
212 PKG_CONFIG_DEPENDS
:= \
213 $(patsubst %,CONFIG_FFMPEG_CUSTOM_ENCODER_
%,$(FFMPEG_CUSTOM_ENCODERS
)) \
214 $(patsubst %,CONFIG_FFMPEG_CUSTOM_DECODER_
%,$(FFMPEG_CUSTOM_DECODERS
)) \
215 $(patsubst %,CONFIG_FFMPEG_CUSTOM_MUXER_
%,$(FFMPEG_CUSTOM_DEMUXERS
)) \
216 $(patsubst %,CONFIG_FFMPEG_CUSTOM_DEMUXER_
%,$(FFMPEG_CUSTOM_DEMUXERS
)) \
217 $(patsubst %,CONFIG_FFMPEG_CUSTOM_PARSER_
%,$(FFMPEG_CUSTOM_PARSERS
)) \
218 $(patsubst %,CONFIG_FFMPEG_CUSTOM_PROTOCOL_
%,$(FFMPEG_CUSTOM_PROTOCOLS
))
220 include $(INCLUDE_DIR
)/package.mk
222 define Package
/ffmpeg
/Default
224 URL
:=http
://ffmpeg.mplayerhq.hu
/
227 define Package
/ffmpeg
/Default
/description
228 FFmpeg is a a software package that can record
, convert and stream digital
229 audio and video in numerous formats.
233 define Package
/ffmpeg
234 $(call Package
/ffmpeg
/Default
)
238 DEPENDS
+= +libpthread
+libffmpeg-full
242 define Package
/ffmpeg
/description
243 $(call Package
/ffmpeg
/Default
/description
)
245 This package contains the FFmpeg command line tool.
249 define Package
/ffprobe
250 $(call Package
/ffmpeg
/Default
)
253 TITLE
+= CLI media identifier
254 DEPENDS
+= +libffmpeg-full
258 define Package
/ffprobe
/description
259 $(call Package
/ffmpeg
/Default
/description
)
261 This package contains the FFprobe command line tool.
265 define Package
/ffserver
266 $(call Package
/ffserver
/Default
)
269 TITLE
+= streaming server
270 DEPENDS
+= +libpthread
+libffmpeg-full
274 define Package
/ffserver
/description
275 $(call Package
/ffmpeg
/Default
/description
)
277 This package contains the FFmpeg streaming server.
281 define Package
/libffmpeg
/Default
282 $(call Package
/ffmpeg
/Default
)
286 DEPENDS
+= +libpthread
+zlib
+libbz2
291 define Package
/libffmpeg-custom
292 $(call Package
/libffmpeg
/Default
)
294 DEPENDS
+= @DEVEL @
!ALL
+libopus
+libspeex
299 define Package
/libffmpeg-custom
/config
300 source
"$(SOURCE)/Config.in"
303 define Package
/libffmpeg-custom
/description
304 $(call Package
/ffmpeg
/Default
/description
)
306 This package contains customized FFmpeg shared libraries.
310 define Package
/libffmpeg-audio-dec
311 $(call Package
/libffmpeg
/Default
)
313 DEPENDS
+= @BUILD_PATENTED
+libspeex
317 define Package
/libffmpeg-audio-dec
/description
318 $(call Package
/ffmpeg
/Default
/description
)
320 This package contains FFmpeg shared libraries for audio decoding
324 define Package
/libffmpeg-full
325 $(call Package
/libffmpeg
/Default
)
327 DEPENDS
+= @BUILD_PATENTED
+alsa-lib
331 define Package
/libffmpeg-full
/description
332 $(call Package
/ffmpeg
/Default
/description
)
334 This package contains full-featured FFmpeg shared libraries.
338 define Package
/libffmpeg-mini
339 $(call Package
/libffmpeg
/Default
)
341 DEPENDS
+= @BUILD_PATENTED
345 define Package
/libffmpeg-mini
/description
346 $(call Package
/ffmpeg
/Default
/description
)
348 This package contains minimal-featured FFmpeg shared libraries.
353 CFLAGS
="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS) $(FPIC)" \
354 LDFLAGS
="$(TARGET_LDFLAGS)" \
356 --enable-cross-compile \
357 --cross-prefix
="$(TARGET_CROSS)" \
361 --pkg-config
="pkg-config" \
367 --disable-runtime-cpudetect \
376 --disable-amd3dnowext \
392 --disable-inline-asm \
395 --disable-mipsdspr1 \
396 --disable-mipsdspr2 \
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-libspeex
--enable-decoder
=libspeex \
468 --disable-decoder
=pcm_bluray
,pcm_dvd \
472 ifeq ($(BUILD_VARIANT
),mini
)
476 --enable-
$(1)="$(c)" \
484 --disable-swresample \
486 --disable-everything \
487 $(call FFMPEG_ENABLE
,decoder
,$(FFMPEG_MINI_DECODERS
)) \
488 $(call FFMPEG_ENABLE
,demuxer
,$(FFMPEG_MINI_DEMUXERS
)) \
489 $(call FFMPEG_ENABLE
,parser
,$(FFMPEG_MINI_PARSERS
)) \
490 $(call FFMPEG_ENABLE
,protocol
,$(FFMPEG_MINI_PROTOCOLS
)) \
494 ifneq ($(CONFIG_TARGET_x86
),)
495 TARGET_CFLAGS
+= -fomit-frame-pointer
498 define Build
/Configure
499 ( cd
$(PKG_BUILD_DIR
); $(FFMPEG_CONFIGURE
) )
503 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
504 DESTDIR
="$(PKG_INSTALL_DIR)" \
508 define Build
/InstallDev
/custom
509 $(INSTALL_DIR
) $(1)/usr
/include
510 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/lib
{avcodec
,avdevice
,avformat
,avutil
} $(1)/usr
/include/
511 $(INSTALL_DIR
) $(1)/usr
/lib
512 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/lib
{avcodec
,avdevice
,avformat
,avutil
}.
{a
,so
*} $(1)/usr
/lib
/
513 $(INSTALL_DIR
) $(1)/usr
/lib
/pkgconfig
514 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/pkgconfig
/lib
{avcodec
,avdevice
,avformat
,avutil
}.
pc $(1)/usr
/lib
/pkgconfig
/
517 define Build
/InstallDev
/full
518 $(INSTALL_DIR
) $(1)/usr
/include
519 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/lib
{avcodec
,avdevice
,avfilter
,avformat
,avutil
,postproc
,swresample
,swscale
} $(1)/usr
/include/
520 $(INSTALL_DIR
) $(1)/usr
/lib
521 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/lib
{avcodec
,avdevice
,avfilter
,avformat
,avutil
,postproc
,swresample
,swscale
}.
{a
,so
*} $(1)/usr
/lib
/
522 $(INSTALL_DIR
) $(1)/usr
/lib
/pkgconfig
523 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/pkgconfig
/lib
{avcodec
,avdevice
,avfilter
,avformat
,avutil
,postproc
,swresample
,swscale
}.
pc $(1)/usr
/lib
/pkgconfig
/
526 define Build
/InstallDev
/mini
527 $(INSTALL_DIR
) $(1)/usr
/include
528 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/lib
{avcodec
,avformat
,avutil
} $(1)/usr
/include/
529 $(INSTALL_DIR
) $(1)/usr
/lib
530 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/lib
{avcodec
,avformat
,avutil
}.
{a
,so
*} $(1)/usr
/lib
/
531 $(INSTALL_DIR
) $(1)/usr
/lib
/pkgconfig
532 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/pkgconfig
/lib
{avcodec
,avformat
,avutil
}.
pc $(1)/usr
/lib
/pkgconfig
/
535 Build
/InstallDev
/audio-dec
= $(Build
/InstallDev
/custom
)
537 # XXX: attempt at installing "best" dev files available
538 ifeq ($(BUILD_VARIANT
),custom
)
539 # XXX: only install "custom" dev files if -full & -mini are not selected
540 ifeq ($(CONFIG_PACKAGE_libffmpeg-full
)$(CONFIG_PACKAGE_libffmpeg-mini
),)
541 Build
/InstallDev
= $(Build
/InstallDev
/custom
)
544 ifeq ($(BUILD_VARIANT
),audio-dec
)
545 # XXX: only install "audio-dec" dev files if -full & -mini are not selected
546 ifeq ($(CONFIG_PACKAGE_libffmpeg-full
)$(CONFIG_PACKAGE_libffmpeg-mini
),)
547 Build
/InstallDev
= $(Build
/InstallDev
/audio-dec
)
550 ifeq ($(BUILD_VARIANT
),full
)
551 # XXX: always install "full" dev files if -full is selected
552 Build
/InstallDev
= $(Build
/InstallDev
/full
)
554 ifeq ($(BUILD_VARIANT
),mini
)
555 # XXX: only install "mini" dev files if -full is not selected
556 ifeq ($(CONFIG_PACKAGE_libffmpeg-full
),)
557 Build
/InstallDev
= $(Build
/InstallDev
/mini
)
561 define Package
/ffmpeg
/install
562 $(INSTALL_DIR
) $(1)/usr
/bin
563 $(CP
) $(PKG_INSTALL_DIR
)/usr
/bin
/ffmpeg
$(1)/usr
/bin
/
566 define Package
/ffprobe
/install
567 $(INSTALL_DIR
) $(1)/usr
/bin
568 $(CP
) $(PKG_INSTALL_DIR
)/usr
/bin
/ffprobe
$(1)/usr
/bin
/
571 define Package
/ffserver
/install
572 $(INSTALL_DIR
) $(1)/usr
/bin
573 $(CP
) $(PKG_INSTALL_DIR
)/usr
/bin
/ffserver
$(1)/usr
/bin
/
576 define Package
/libffmpeg-custom
/install
577 $(INSTALL_DIR
) $(1)/usr
/lib
578 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/lib
{avcodec
,avdevice
,avformat
,avutil
}.so.
* $(1)/usr
/lib
/
581 define Package
/libffmpeg-full
/install
582 $(INSTALL_DIR
) $(1)/usr
/lib
583 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/lib
{avcodec
,avdevice
,avfilter
,avformat
,avutil
,postproc
,swresample
,swscale
}.so.
* $(1)/usr
/lib
/
586 define Package
/libffmpeg-mini
/install
587 $(INSTALL_DIR
) $(1)/usr
/lib
588 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/lib
{avcodec
,avformat
,avutil
}.so.
* $(1)/usr
/lib
/
591 Package
/libffmpeg-audio-dec
/install = $(Package
/libffmpeg-custom
/install)
593 $(eval
$(call BuildPackage
,ffmpeg
))
594 $(eval
$(call BuildPackage
,ffprobe
))
595 $(eval
$(call BuildPackage
,ffserver
))
596 $(eval
$(call BuildPackage
,libffmpeg-custom
))
597 $(eval
$(call BuildPackage
,libffmpeg-full
))
598 $(eval
$(call BuildPackage
,libffmpeg-mini
))
599 $(eval
$(call BuildPackage
,libffmpeg-audio-dec
))