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
:=efba7c5cfbea9ce58ff693cd08f90ffa
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 \
393 --disable-mipsdspr1 \
394 --disable-mipsdspr2 \
403 ifeq ($(BUILD_VARIANT
),custom
)
407 $(if
$($(3)_
$(c
)),--enable-
$(1)="$(c)") \
414 --disable-swresample \
416 --disable-everything \
417 $(call FFMPEG_ENABLE
,encoder
,$(FFMPEG_CUSTOM_ENCODERS
),CONFIG_FFMPEG_CUSTOM_ENCODER
) \
418 $(call FFMPEG_ENABLE
,decoder
,$(FFMPEG_CUSTOM_DECODERS
),CONFIG_FFMPEG_CUSTOM_DECODER
) \
419 $(call FFMPEG_ENABLE
,muxer
,$(FFMPEG_CUSTOM_MUXERS
),CONFIG_FFMPEG_CUSTOM_MUXER
) \
420 $(call FFMPEG_ENABLE
,demuxer
,$(FFMPEG_CUSTOM_DEMUXERS
),CONFIG_FFMPEG_CUSTOM_DEMUXER
) \
421 $(call FFMPEG_ENABLE
,parser
,$(FFMPEG_CUSTOM_PARSERS
),CONFIG_FFMPEG_CUSTOM_PARSER
) \
422 $(call FFMPEG_ENABLE
,protocol
,$(FFMPEG_CUSTOM_PROTOCOLS
),CONFIG_FFMPEG_CUSTOM_PROTOCOL
) \
424 ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_adpcm
),y
)
426 --enable-decoder
=adpcm_ima_wav \
427 --enable-decoder
=adpcm_ima_qt \
428 --enable-decoder
=adpcm_ms \
432 ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_libopus
),y
)
434 --enable-libopus
--enable-decoder
=libopus \
438 ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_speex
),y
)
440 --enable-libspeex
--enable-decoder
=libspeex \
446 ifeq ($(BUILD_VARIANT
),audio-dec
)
450 --enable-
$(1)="$(c)" \
457 --disable-swresample \
459 --disable-everything \
460 $(call FFMPEG_ENABLE
,decoder
,$(FFMPEG_AUDIO_DECODERS
)) \
461 $(call FFMPEG_ENABLE
,demuxer
,$(FFMPEG_AUDIO_DEMUXERS
)) \
462 $(call FFMPEG_ENABLE
,parser
,$(FFMPEG_AUDIO_PARSERS
)) \
463 $(call FFMPEG_ENABLE
,protocol
,$(FFMPEG_AUDIO_PROTOCOLS
)) \
464 --enable-libopus
--enable-decoder
=libopus \
465 --enable-libspeex
--enable-decoder
=libspeex \
466 --disable-decoder
=pcm_bluray
,pcm_dvd \
470 ifeq ($(BUILD_VARIANT
),mini
)
474 --enable-
$(1)="$(c)" \
482 --disable-swresample \
484 --disable-everything \
485 $(call FFMPEG_ENABLE
,decoder
,$(FFMPEG_MINI_DECODERS
)) \
486 $(call FFMPEG_ENABLE
,demuxer
,$(FFMPEG_MINI_DEMUXERS
)) \
487 $(call FFMPEG_ENABLE
,parser
,$(FFMPEG_MINI_PARSERS
)) \
488 $(call FFMPEG_ENABLE
,protocol
,$(FFMPEG_MINI_PROTOCOLS
)) \
492 ifneq ($(CONFIG_TARGET_x86
),)
493 TARGET_CFLAGS
+= -fomit-frame-pointer
496 define Build
/Configure
497 ( cd
$(PKG_BUILD_DIR
); $(FFMPEG_CONFIGURE
) )
501 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
502 DESTDIR
="$(PKG_INSTALL_DIR)" \
506 define Build
/InstallDev
/custom
507 $(INSTALL_DIR
) $(1)/usr
/include
508 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/lib
{avcodec
,avdevice
,avformat
,avutil
} $(1)/usr
/include/
509 $(INSTALL_DIR
) $(1)/usr
/lib
510 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/lib
{avcodec
,avdevice
,avformat
,avutil
}.
{a
,so
*} $(1)/usr
/lib
/
511 $(INSTALL_DIR
) $(1)/usr
/lib
/pkgconfig
512 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/pkgconfig
/lib
{avcodec
,avdevice
,avformat
,avutil
}.
pc $(1)/usr
/lib
/pkgconfig
/
515 define Build
/InstallDev
/full
516 $(INSTALL_DIR
) $(1)/usr
/include
517 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/lib
{avcodec
,avdevice
,avfilter
,avformat
,avutil
,postproc
,swresample
,swscale
} $(1)/usr
/include/
518 $(INSTALL_DIR
) $(1)/usr
/lib
519 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/lib
{avcodec
,avdevice
,avfilter
,avformat
,avutil
,postproc
,swresample
,swscale
}.
{a
,so
*} $(1)/usr
/lib
/
520 $(INSTALL_DIR
) $(1)/usr
/lib
/pkgconfig
521 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/pkgconfig
/lib
{avcodec
,avdevice
,avfilter
,avformat
,avutil
,postproc
,swresample
,swscale
}.
pc $(1)/usr
/lib
/pkgconfig
/
524 define Build
/InstallDev
/mini
525 $(INSTALL_DIR
) $(1)/usr
/include
526 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/lib
{avcodec
,avformat
,avutil
} $(1)/usr
/include/
527 $(INSTALL_DIR
) $(1)/usr
/lib
528 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/lib
{avcodec
,avformat
,avutil
}.
{a
,so
*} $(1)/usr
/lib
/
529 $(INSTALL_DIR
) $(1)/usr
/lib
/pkgconfig
530 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/pkgconfig
/lib
{avcodec
,avformat
,avutil
}.
pc $(1)/usr
/lib
/pkgconfig
/
533 Build
/InstallDev
/audio-dec
= $(Build
/InstallDev
/custom
)
535 # XXX: attempt at installing "best" dev files available
536 ifeq ($(BUILD_VARIANT
),custom
)
537 # XXX: only install "custom" dev files if -full & -mini are not selected
538 ifeq ($(CONFIG_PACKAGE_libffmpeg-full
)$(CONFIG_PACKAGE_libffmpeg-mini
),)
539 Build
/InstallDev
= $(Build
/InstallDev
/custom
)
542 ifeq ($(BUILD_VARIANT
),audio-dec
)
543 # XXX: only install "audio-dec" dev files if -full & -mini are not selected
544 ifeq ($(CONFIG_PACKAGE_libffmpeg-full
)$(CONFIG_PACKAGE_libffmpeg-mini
),)
545 Build
/InstallDev
= $(Build
/InstallDev
/audio-dec
)
548 ifeq ($(BUILD_VARIANT
),full
)
549 # XXX: always install "full" dev files if -full is selected
550 Build
/InstallDev
= $(Build
/InstallDev
/full
)
552 ifeq ($(BUILD_VARIANT
),mini
)
553 # XXX: only install "mini" dev files if -full is not selected
554 ifeq ($(CONFIG_PACKAGE_libffmpeg-full
),)
555 Build
/InstallDev
= $(Build
/InstallDev
/mini
)
559 define Package
/ffmpeg
/install
560 $(INSTALL_DIR
) $(1)/usr
/bin
561 $(CP
) $(PKG_INSTALL_DIR
)/usr
/bin
/ffmpeg
$(1)/usr
/bin
/
564 define Package
/ffprobe
/install
565 $(INSTALL_DIR
) $(1)/usr
/bin
566 $(CP
) $(PKG_INSTALL_DIR
)/usr
/bin
/ffprobe
$(1)/usr
/bin
/
569 define Package
/ffserver
/install
570 $(INSTALL_DIR
) $(1)/usr
/bin
571 $(CP
) $(PKG_INSTALL_DIR
)/usr
/bin
/ffserver
$(1)/usr
/bin
/
574 define Package
/libffmpeg-custom
/install
575 $(INSTALL_DIR
) $(1)/usr
/lib
576 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/lib
{avcodec
,avdevice
,avformat
,avutil
}.so.
* $(1)/usr
/lib
/
579 define Package
/libffmpeg-full
/install
580 $(INSTALL_DIR
) $(1)/usr
/lib
581 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/lib
{avcodec
,avdevice
,avfilter
,avformat
,avutil
,postproc
,swresample
,swscale
}.so.
* $(1)/usr
/lib
/
584 define Package
/libffmpeg-mini
/install
585 $(INSTALL_DIR
) $(1)/usr
/lib
586 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/lib
{avcodec
,avformat
,avutil
}.so.
* $(1)/usr
/lib
/
589 Package
/libffmpeg-audio-dec
/install = $(Package
/libffmpeg-custom
/install)
591 $(eval
$(call BuildPackage
,ffmpeg
))
592 $(eval
$(call BuildPackage
,ffprobe
))
593 $(eval
$(call BuildPackage
,ffserver
))
594 $(eval
$(call BuildPackage
,libffmpeg-custom
))
595 $(eval
$(call BuildPackage
,libffmpeg-full
))
596 $(eval
$(call BuildPackage
,libffmpeg-mini
))
597 $(eval
$(call BuildPackage
,libffmpeg-audio-dec
))