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
:=ea25fc252c132141f12988ed5506bfe8
17 PKG_MAINTAINER
:=Ted Hess
<thess@kitschensync.net
>
19 PKG_LICENSE
:=LGPLv2.1
+ GPLv2
+ LGPLv3
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_ENCODERS
:= \
115 FFMPEG_MINI_DECODERS
:= \
132 FFMPEG_MINI_MUXERS
:= \
135 FFMPEG_MINI_DEMUXERS
:= \
151 FFMPEG_MINI_PARSERS
:= \
159 FFMPEG_MINI_PROTOCOLS
:= \
160 file http rtp tcp udp \
162 FFMPEG_AUDIO_DECODERS
:= \
186 FFMPEG_AUDIO_DEMUXERS
:= \
209 FFMPEG_AUDIO_PARSERS
:= \
216 FFMPEG_AUDIO_PROTOCOLS
:= \
217 file http rtp tcp udp
220 PKG_BUILD_DIR
:=$(BUILD_DIR
)/$(PKG_NAME
)-$(BUILD_VARIANT
)/$(PKG_NAME
)-$(PKG_VERSION
)
222 PKG_CONFIG_DEPENDS
:= \
223 $(patsubst %,CONFIG_FFMPEG_CUSTOM_ENCODER_
%,$(FFMPEG_CUSTOM_ENCODERS
)) \
224 $(patsubst %,CONFIG_FFMPEG_CUSTOM_DECODER_
%,$(FFMPEG_CUSTOM_DECODERS
)) \
225 $(patsubst %,CONFIG_FFMPEG_CUSTOM_MUXER_
%,$(FFMPEG_CUSTOM_DEMUXERS
)) \
226 $(patsubst %,CONFIG_FFMPEG_CUSTOM_DEMUXER_
%,$(FFMPEG_CUSTOM_DEMUXERS
)) \
227 $(patsubst %,CONFIG_FFMPEG_CUSTOM_PARSER_
%,$(FFMPEG_CUSTOM_PARSERS
)) \
228 $(patsubst %,CONFIG_FFMPEG_CUSTOM_PROTOCOL_
%,$(FFMPEG_CUSTOM_PROTOCOLS
))
230 include $(INCLUDE_DIR
)/package.mk
232 define Package
/ffmpeg
/Default
234 URL
:=http
://ffmpeg.mplayerhq.hu
/
237 define Package
/ffmpeg
/Default
/description
238 FFmpeg is a a software package that can record
, convert and stream digital
239 audio and video in numerous formats.
243 define Package
/ffmpeg
244 $(call Package
/ffmpeg
/Default
)
248 DEPENDS
+= +libpthread
+libffmpeg-full
252 define Package
/ffmpeg
/description
253 $(call Package
/ffmpeg
/Default
/description
)
255 This package contains the FFmpeg command line tool.
259 define Package
/ffprobe
260 $(call Package
/ffmpeg
/Default
)
263 TITLE
+= CLI media identifier
264 DEPENDS
+= +libffmpeg-full
268 define Package
/ffprobe
/description
269 $(call Package
/ffmpeg
/Default
/description
)
271 This package contains the FFprobe command line tool.
275 define Package
/ffserver
276 $(call Package
/ffserver
/Default
)
279 TITLE
+= streaming server
280 DEPENDS
+= +libpthread
+libffmpeg-full
284 define Package
/ffserver
/description
285 $(call Package
/ffmpeg
/Default
/description
)
287 This package contains the FFmpeg streaming server.
291 define Package
/libffmpeg
/Default
292 $(call Package
/ffmpeg
/Default
)
296 DEPENDS
+= +libpthread
+zlib
+libbz2
301 define Package
/libffmpeg-custom
302 $(call Package
/libffmpeg
/Default
)
304 DEPENDS
+= @DEVEL
+libspeex
309 define Package
/libffmpeg-custom
/config
310 source
"$(SOURCE)/Config.in"
313 define Package
/libffmpeg-custom
/description
314 $(call Package
/ffmpeg
/Default
/description
)
316 This package contains customized FFmpeg shared libraries.
320 define Package
/libffmpeg-audio-dec
321 $(call Package
/libffmpeg
/Default
)
323 DEPENDS
+= @DEVEL
+libspeex
327 define Package
/libffmpeg-audio-dec
/description
328 $(call Package
/ffmpeg
/Default
/description
)
330 This package contains FFmpeg shared libraries for audio decoding
334 define Package
/libffmpeg-full
335 $(call Package
/libffmpeg
/Default
)
337 DEPENDS
+= @BUILD_PATENTED
+alsa-lib
341 define Package
/libffmpeg-full
/description
342 $(call Package
/ffmpeg
/Default
/description
)
344 This package contains full-featured FFmpeg shared libraries.
348 define Package
/libffmpeg-mini
349 $(call Package
/libffmpeg
/Default
)
351 DEPENDS
+= @BUILD_PATENTED
355 define Package
/libffmpeg-mini
/description
356 $(call Package
/ffmpeg
/Default
/description
)
358 This package contains minimal-featured FFmpeg shared libraries.
363 CFLAGS
="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS) $(FPIC)" \
364 LDFLAGS
="$(TARGET_LDFLAGS)" \
366 --enable-cross-compile \
367 --cross-prefix
="$(TARGET_CROSS)" \
374 --pkg-config
="pkg-config" \
384 --disable-optimizations \
386 --disable-stripping \
390 ifeq ($(BUILD_VARIANT
),custom
)
394 $(if
$($(3)_
$(c
)),--enable-
$(1)="$(c)") \
404 --disable-swresample \
406 --disable-everything \
407 $(call FFMPEG_ENABLE
,encoder
,$(FFMPEG_CUSTOM_ENCODERS
),CONFIG_FFMPEG_CUSTOM_ENCODER
) \
408 $(call FFMPEG_ENABLE
,decoder
,$(FFMPEG_CUSTOM_DECODERS
),CONFIG_FFMPEG_CUSTOM_DECODER
) \
409 $(call FFMPEG_ENABLE
,muxer
,$(FFMPEG_CUSTOM_MUXERS
),CONFIG_FFMPEG_CUSTOM_MUXER
) \
410 $(call FFMPEG_ENABLE
,demuxer
,$(FFMPEG_CUSTOM_DEMUXERS
),CONFIG_FFMPEG_CUSTOM_DEMUXER
) \
411 $(call FFMPEG_ENABLE
,parser
,$(FFMPEG_CUSTOM_PARSERS
),CONFIG_FFMPEG_CUSTOM_PARSER
) \
412 $(call FFMPEG_ENABLE
,protocol
,$(FFMPEG_CUSTOM_PROTOCOLS
),CONFIG_FFMPEG_CUSTOM_PROTOCOL
) \
414 ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_adpcm
),y
)
416 --enable-decoder
=adpcm_ima_wav \
417 --enable-decoder
=adpcm_ima_qt \
418 --enable-decoder
=adpcm_ms \
422 ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_speex
),y
)
424 --enable-libspeex
--enable-decoder
=libspeex \
430 ifeq ($(BUILD_VARIANT
),audio-dec
)
434 --enable-
$(1)="$(c)" \
444 --disable-swresample \
446 --disable-everything \
447 $(call FFMPEG_ENABLE
,decoder
,$(FFMPEG_AUDIO_DECODERS
)) \
448 $(call FFMPEG_ENABLE
,demuxer
,$(FFMPEG_AUDIO_DEMUXERS
)) \
449 $(call FFMPEG_ENABLE
,parser
,$(FFMPEG_AUDIO_PARSERS
)) \
450 $(call FFMPEG_ENABLE
,protocol
,$(FFMPEG_AUDIO_PROTOCOLS
)) \
451 --enable-libspeex
--enable-decoder
=libspeex \
452 --disable-decoder
=pcm_bluray
,pcm_dvd \
456 ifeq ($(BUILD_VARIANT
),mini
)
460 --enable-
$(1)="$(c)" \
471 --disable-swresample \
473 --disable-everything \
474 $(call FFMPEG_ENABLE
,encoder
,$(FFMPEG_MINI_ENCODERS
)) \
475 $(call FFMPEG_ENABLE
,decoder
,$(FFMPEG_MINI_DECODERS
)) \
476 $(call FFMPEG_ENABLE
,muxer
,$(FFMPEG_MINI_MUXERS
)) \
477 $(call FFMPEG_ENABLE
,demuxer
,$(FFMPEG_MINI_DEMUXERS
)) \
478 $(call FFMPEG_ENABLE
,parser
,$(FFMPEG_MINI_PARSERS
)) \
479 $(call FFMPEG_ENABLE
,protocol
,$(FFMPEG_MINI_PROTOCOLS
)) \
483 ifneq ($(CONFIG_TARGET_x86
),)
484 TARGET_CFLAGS
+= -fomit-frame-pointer
487 define Build
/Configure
488 ( cd
$(PKG_BUILD_DIR
); $(FFMPEG_CONFIGURE
) )
492 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
493 DESTDIR
="$(PKG_INSTALL_DIR)" \
497 define Build
/InstallDev
/custom
498 $(INSTALL_DIR
) $(1)/usr
/include
499 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/lib
{avcodec
,avdevice
,avformat
,avutil
} $(1)/usr
/include/
500 $(INSTALL_DIR
) $(1)/usr
/lib
501 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/lib
{avcodec
,avdevice
,avformat
,avutil
}.
{a
,so
*} $(1)/usr
/lib
/
502 $(INSTALL_DIR
) $(1)/usr
/lib
/pkgconfig
503 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/pkgconfig
/lib
{avcodec
,avdevice
,avformat
,avutil
}.
pc $(1)/usr
/lib
/pkgconfig
/
506 define Build
/InstallDev
/full
507 $(INSTALL_DIR
) $(1)/usr
/include
508 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/lib
{avcodec
,avdevice
,avfilter
,avformat
,avutil
,postproc
,swresample
,swscale
} $(1)/usr
/include/
509 $(INSTALL_DIR
) $(1)/usr
/lib
510 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/lib
{avcodec
,avdevice
,avfilter
,avformat
,avutil
,postproc
,swresample
,swscale
}.
{a
,so
*} $(1)/usr
/lib
/
511 $(INSTALL_DIR
) $(1)/usr
/lib
/pkgconfig
512 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/pkgconfig
/lib
{avcodec
,avdevice
,avfilter
,avformat
,avutil
,postproc
,swresample
,swscale
}.
pc $(1)/usr
/lib
/pkgconfig
/
515 Build
/InstallDev
/mini
= $(Build
/InstallDev
/custom
)
516 Build
/InstallDev
/audio-dec
= $(Build
/InstallDev
/custom
)
518 # XXX: attempt at installing "best" dev files available
519 ifeq ($(BUILD_VARIANT
),custom
)
520 # XXX: only install "custom" dev files if -full & -mini are not selected
521 ifeq ($(CONFIG_PACKAGE_libffmpeg-full
)$(CONFIG_PACKAGE_libffmpeg-mini
),)
522 Build
/InstallDev
= $(Build
/InstallDev
/custom
)
525 ifeq ($(BUILD_VARIANT
),audio-dec
)
526 # XXX: only install "audio-dec" dev files if -full & -mini are not selected
527 ifeq ($(CONFIG_PACKAGE_libffmpeg-full
)$(CONFIG_PACKAGE_libffmpeg-mini
),)
528 Build
/InstallDev
= $(Build
/InstallDev
/audio-dec
)
531 ifeq ($(BUILD_VARIANT
),full
)
532 # XXX: always install "full" dev files if -full is selected
533 Build
/InstallDev
= $(Build
/InstallDev
/full
)
535 ifeq ($(BUILD_VARIANT
),mini
)
536 # XXX: only install "mini" dev files if -full is not selected
537 ifeq ($(CONFIG_PACKAGE_libffmpeg-full
),)
538 Build
/InstallDev
= $(Build
/InstallDev
/mini
)
542 define Package
/ffmpeg
/install
543 $(INSTALL_DIR
) $(1)/usr
/bin
544 $(CP
) $(PKG_INSTALL_DIR
)/usr
/bin
/ffmpeg
$(1)/usr
/bin
/
547 define Package
/ffprobe
/install
548 $(INSTALL_DIR
) $(1)/usr
/bin
549 $(CP
) $(PKG_INSTALL_DIR
)/usr
/bin
/ffprobe
$(1)/usr
/bin
/
552 define Package
/ffserver
/install
553 $(INSTALL_DIR
) $(1)/usr
/bin
554 $(CP
) $(PKG_INSTALL_DIR
)/usr
/bin
/ffserver
$(1)/usr
/bin
/
557 define Package
/libffmpeg-custom
/install
558 $(INSTALL_DIR
) $(1)/usr
/lib
559 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/lib
{avcodec
,avdevice
,avformat
,avutil
}.so.
* $(1)/usr
/lib
/
562 define Package
/libffmpeg-full
/install
563 $(INSTALL_DIR
) $(1)/usr
/lib
564 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/lib
{avcodec
,avdevice
,avfilter
,avformat
,avutil
,postproc
,swresample
,swscale
}.so.
* $(1)/usr
/lib
/
567 define Package
/libffmpeg-mini
/install
568 $(INSTALL_DIR
) $(1)/usr
/lib
569 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/lib
{avcodec
,avformat
,avutil
}.so.
* $(1)/usr
/lib
/
572 Package
/libffmpeg-audio-dec
/install = $(Package
/libffmpeg-custom
/install)
574 $(eval
$(call BuildPackage
,ffmpeg
))
575 $(eval
$(call BuildPackage
,ffprobe
))
576 $(eval
$(call BuildPackage
,ffserver
))
577 $(eval
$(call BuildPackage
,libffmpeg-custom
))
578 $(eval
$(call BuildPackage
,libffmpeg-full
))
579 $(eval
$(call BuildPackage
,libffmpeg-mini
))
580 $(eval
$(call BuildPackage
,libffmpeg-audio-dec
))