blob: 432e4cda09cd6ccc01c135e708788d2eb3f52529 [file] [log] [blame]
Alexandre Belloni8dfd59d2013-06-05 23:53:30 +00001################################################################################
Luca Ceresoli13293402010-06-14 21:41:42 +02002#
3# ffmpeg
4#
Alexandre Belloni8dfd59d2013-06-05 23:53:30 +00005################################################################################
Gustavo Zacarias1b269dd2011-03-01 13:20:00 -03006
Bernd Kuhls480e8f72018-02-12 17:51:06 +01007FFMPEG_VERSION = 3.4.2
Jerzy Grzegorek0a854ce2015-10-14 12:34:22 +02008FFMPEG_SOURCE = ffmpeg-$(FFMPEG_VERSION).tar.xz
Gustavo Zacarias1b269dd2011-03-01 13:20:00 -03009FFMPEG_SITE = http://ffmpeg.org/releases
Luca Ceresoli13293402010-06-14 21:41:42 +020010FFMPEG_INSTALL_STAGING = YES
Luca Ceresoli13293402010-06-14 21:41:42 +020011
Rahul Bedarkar30a3e8d2017-03-30 19:13:34 +053012FFMPEG_LICENSE = LGPL-2.1+, libjpeg license
Luca Ceresolia20aae62014-10-02 12:11:01 +020013FFMPEG_LICENSE_FILES = LICENSE.md COPYING.LGPLv2.1
Luca Ceresolia17d8942013-02-07 11:02:33 +000014ifeq ($(BR2_PACKAGE_FFMPEG_GPL),y)
Rahul Bedarkaraf31c302017-03-30 19:13:32 +053015FFMPEG_LICENSE += and GPL-2.0+
Luca Ceresolia17d8942013-02-07 11:02:33 +000016FFMPEG_LICENSE_FILES += COPYING.GPLv2
17endif
18
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +020019FFMPEG_CONF_OPTS = \
Bernd Kuhls79449c22014-10-03 11:50:46 +020020 --prefix=/usr \
Bernd Kuhls62ab07e2014-01-02 18:59:44 +010021 --enable-avfilter \
Bernd Kuhls62ab07e2014-01-02 18:59:44 +010022 --disable-version3 \
23 --enable-logging \
Bernd Kuhls62ab07e2014-01-02 18:59:44 +010024 --enable-optimizations \
25 --disable-extra-warnings \
Bernd Kuhls62ab07e2014-01-02 18:59:44 +010026 --enable-avdevice \
27 --enable-avcodec \
28 --enable-avformat \
Bernd Kuhls62ab07e2014-01-02 18:59:44 +010029 --enable-network \
30 --disable-gray \
31 --enable-swscale-alpha \
32 --disable-small \
33 --enable-dct \
34 --enable-fft \
35 --enable-mdct \
36 --enable-rdft \
37 --disable-crystalhd \
Bernd Kuhls62ab07e2014-01-02 18:59:44 +010038 --disable-dxva2 \
39 --enable-runtime-cpudetect \
40 --disable-hardcoded-tables \
Vicente Olivert Riera2893d2f2016-08-15 17:03:36 +020041 --disable-mipsdsp \
Vicente Olivert Rierab090dcb2015-10-14 16:58:22 +010042 --disable-mipsdspr2 \
Bernd Kuhls1ca32ad2015-07-24 20:13:47 +020043 --disable-msa \
Bernd Kuhls62ab07e2014-01-02 18:59:44 +010044 --enable-hwaccels \
Bernd Kuhls3b6fa452017-07-22 17:13:06 +020045 --disable-cuda \
46 --disable-cuvid \
47 --disable-nvenc \
Bernd Kuhls62ab07e2014-01-02 18:59:44 +010048 --disable-avisynth \
49 --disable-frei0r \
50 --disable-libopencore-amrnb \
51 --disable-libopencore-amrwb \
Bernd Kuhls62ab07e2014-01-02 18:59:44 +010052 --disable-libdc1394 \
Bernd Kuhls62ab07e2014-01-02 18:59:44 +010053 --disable-libgsm \
Bernd Kuhls632df1d2015-10-17 14:31:58 +020054 --disable-libilbc \
Bernd Kuhls62ab07e2014-01-02 18:59:44 +010055 --disable-libvo-amrwbenc \
Bernd Kuhls62ab07e2014-01-02 18:59:44 +010056 --disable-symver \
Thomas De Schampheleire7164a322014-02-05 14:50:56 +010057 --disable-doc
Luca Ceresoli13293402010-06-14 21:41:42 +020058
Bernd Kuhlsf6695c42017-12-18 07:29:10 +010059FFMPEG_DEPENDENCIES += host-pkgconf
Bernd Kuhls62ab07e2014-01-02 18:59:44 +010060
Luca Ceresoli13293402010-06-14 21:41:42 +020061ifeq ($(BR2_PACKAGE_FFMPEG_GPL),y)
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +020062FFMPEG_CONF_OPTS += --enable-gpl
Luca Ceresoli13293402010-06-14 21:41:42 +020063else
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +020064FFMPEG_CONF_OPTS += --disable-gpl
Luca Ceresoli13293402010-06-14 21:41:42 +020065endif
66
67ifeq ($(BR2_PACKAGE_FFMPEG_NONFREE),y)
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +020068FFMPEG_CONF_OPTS += --enable-nonfree
Luca Ceresoli13293402010-06-14 21:41:42 +020069else
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +020070FFMPEG_CONF_OPTS += --disable-nonfree
Luca Ceresoli13293402010-06-14 21:41:42 +020071endif
72
Luca Ceresoli5253efa2010-06-14 21:41:43 +020073ifeq ($(BR2_PACKAGE_FFMPEG_FFMPEG),y)
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +020074FFMPEG_CONF_OPTS += --enable-ffmpeg
Luca Ceresoli5253efa2010-06-14 21:41:43 +020075else
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +020076FFMPEG_CONF_OPTS += --disable-ffmpeg
Luca Ceresoli5253efa2010-06-14 21:41:43 +020077endif
78
79ifeq ($(BR2_PACKAGE_FFMPEG_FFPLAY),y)
Phil Eichingerd767ff82016-12-06 15:32:37 +010080FFMPEG_DEPENDENCIES += sdl2
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +020081FFMPEG_CONF_OPTS += --enable-ffplay
Phil Eichingerd767ff82016-12-06 15:32:37 +010082FFMPEG_CONF_ENV += SDL_CONFIG=$(STAGING_DIR)/usr/bin/sdl2-config
Luca Ceresoli5253efa2010-06-14 21:41:43 +020083else
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +020084FFMPEG_CONF_OPTS += --disable-ffplay
Luca Ceresoli5253efa2010-06-14 21:41:43 +020085endif
86
87ifeq ($(BR2_PACKAGE_FFMPEG_FFSERVER),y)
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +020088FFMPEG_CONF_OPTS += --enable-ffserver
Luca Ceresoli5253efa2010-06-14 21:41:43 +020089else
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +020090FFMPEG_CONF_OPTS += --disable-ffserver
Luca Ceresoli5253efa2010-06-14 21:41:43 +020091endif
92
Bernd Kuhlsf3765852014-10-14 20:28:24 +020093ifeq ($(BR2_PACKAGE_FFMPEG_AVRESAMPLE),y)
94FFMPEG_CONF_OPTS += --enable-avresample
95else
96FFMPEG_CONF_OPTS += --disable-avresample
97endif
98
Steve Kenton3b3b4f22014-12-01 18:55:35 -060099ifeq ($(BR2_PACKAGE_FFMPEG_FFPROBE),y)
100FFMPEG_CONF_OPTS += --enable-ffprobe
101else
102FFMPEG_CONF_OPTS += --disable-ffprobe
103endif
104
Peter Korsgaard4ff34552010-10-07 09:54:00 +0200105ifeq ($(BR2_PACKAGE_FFMPEG_POSTPROC),y)
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200106FFMPEG_CONF_OPTS += --enable-postproc
Peter Korsgaard4ff34552010-10-07 09:54:00 +0200107else
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200108FFMPEG_CONF_OPTS += --disable-postproc
Peter Korsgaard4ff34552010-10-07 09:54:00 +0200109endif
110
111ifeq ($(BR2_PACKAGE_FFMPEG_SWSCALE),y)
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200112FFMPEG_CONF_OPTS += --enable-swscale
Peter Korsgaard4ff34552010-10-07 09:54:00 +0200113else
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200114FFMPEG_CONF_OPTS += --disable-swscale
Peter Korsgaard4ff34552010-10-07 09:54:00 +0200115endif
116
Luca Ceresoli56e4d692010-06-14 21:41:44 +0200117ifneq ($(call qstrip,$(BR2_PACKAGE_FFMPEG_ENCODERS)),all)
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200118FFMPEG_CONF_OPTS += --disable-encoders \
Luca Ceresoli56e4d692010-06-14 21:41:44 +0200119 $(foreach x,$(call qstrip,$(BR2_PACKAGE_FFMPEG_ENCODERS)),--enable-encoder=$(x))
120endif
121
122ifneq ($(call qstrip,$(BR2_PACKAGE_FFMPEG_DECODERS)),all)
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200123FFMPEG_CONF_OPTS += --disable-decoders \
Luca Ceresoli56e4d692010-06-14 21:41:44 +0200124 $(foreach x,$(call qstrip,$(BR2_PACKAGE_FFMPEG_DECODERS)),--enable-decoder=$(x))
125endif
126
127ifneq ($(call qstrip,$(BR2_PACKAGE_FFMPEG_MUXERS)),all)
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200128FFMPEG_CONF_OPTS += --disable-muxers \
Luca Ceresoli56e4d692010-06-14 21:41:44 +0200129 $(foreach x,$(call qstrip,$(BR2_PACKAGE_FFMPEG_MUXERS)),--enable-muxer=$(x))
130endif
131
132ifneq ($(call qstrip,$(BR2_PACKAGE_FFMPEG_DEMUXERS)),all)
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200133FFMPEG_CONF_OPTS += --disable-demuxers \
Luca Ceresoli56e4d692010-06-14 21:41:44 +0200134 $(foreach x,$(call qstrip,$(BR2_PACKAGE_FFMPEG_DEMUXERS)),--enable-demuxer=$(x))
135endif
136
137ifneq ($(call qstrip,$(BR2_PACKAGE_FFMPEG_PARSERS)),all)
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200138FFMPEG_CONF_OPTS += --disable-parsers \
Luca Ceresoli56e4d692010-06-14 21:41:44 +0200139 $(foreach x,$(call qstrip,$(BR2_PACKAGE_FFMPEG_PARSERS)),--enable-parser=$(x))
140endif
141
142ifneq ($(call qstrip,$(BR2_PACKAGE_FFMPEG_BSFS)),all)
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200143FFMPEG_CONF_OPTS += --disable-bsfs \
Bernd Kuhls62ab07e2014-01-02 18:59:44 +0100144 $(foreach x,$(call qstrip,$(BR2_PACKAGE_FFMPEG_BSFS)),--enable-bsfs=$(x))
Luca Ceresoli56e4d692010-06-14 21:41:44 +0200145endif
146
147ifneq ($(call qstrip,$(BR2_PACKAGE_FFMPEG_PROTOCOLS)),all)
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200148FFMPEG_CONF_OPTS += --disable-protocols \
Luca Ceresoli56e4d692010-06-14 21:41:44 +0200149 $(foreach x,$(call qstrip,$(BR2_PACKAGE_FFMPEG_PROTOCOLS)),--enable-protocol=$(x))
150endif
151
152ifneq ($(call qstrip,$(BR2_PACKAGE_FFMPEG_FILTERS)),all)
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200153FFMPEG_CONF_OPTS += --disable-filters \
Luca Ceresoli56e4d692010-06-14 21:41:44 +0200154 $(foreach x,$(call qstrip,$(BR2_PACKAGE_FFMPEG_FILTERS)),--enable-filter=$(x))
155endif
156
157ifeq ($(BR2_PACKAGE_FFMPEG_INDEVS),y)
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200158FFMPEG_CONF_OPTS += --enable-indevs
Bernd Kuhlsca06ba22017-06-01 22:39:29 +0200159ifeq ($(BR2_PACKAGE_ALSA_LIB),y)
Bernd Kuhlsf6695c42017-12-18 07:29:10 +0100160FFMPEG_CONF_OPTS += --enable-alsa
Bernd Kuhlsca06ba22017-06-01 22:39:29 +0200161FFMPEG_DEPENDENCIES += alsa-lib
Bernd Kuhlsf6695c42017-12-18 07:29:10 +0100162else
163FFMPEG_CONF_OPTS += --disable-alsa
Bernd Kuhlsca06ba22017-06-01 22:39:29 +0200164endif
Luca Ceresoli56e4d692010-06-14 21:41:44 +0200165else
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200166FFMPEG_CONF_OPTS += --disable-indevs
Luca Ceresoli56e4d692010-06-14 21:41:44 +0200167endif
168
169ifeq ($(BR2_PACKAGE_FFMPEG_OUTDEVS),y)
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200170FFMPEG_CONF_OPTS += --enable-outdevs
Bernd Kuhlsca06ba22017-06-01 22:39:29 +0200171ifeq ($(BR2_PACKAGE_ALSA_LIB),y)
172FFMPEG_DEPENDENCIES += alsa-lib
173endif
Luca Ceresoli56e4d692010-06-14 21:41:44 +0200174else
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200175FFMPEG_CONF_OPTS += --disable-outdevs
Luca Ceresoli56e4d692010-06-14 21:41:44 +0200176endif
177
Thomas Petazzoni9eaad202010-12-13 17:27:44 +0100178ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y)
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200179FFMPEG_CONF_OPTS += --enable-pthreads
Thomas Petazzoni9eaad202010-12-13 17:27:44 +0100180else
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200181FFMPEG_CONF_OPTS += --disable-pthreads
Luca Ceresoli13293402010-06-14 21:41:42 +0200182endif
183
184ifeq ($(BR2_PACKAGE_ZLIB),y)
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200185FFMPEG_CONF_OPTS += --enable-zlib
Luca Ceresoli13293402010-06-14 21:41:42 +0200186FFMPEG_DEPENDENCIES += zlib
187else
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200188FFMPEG_CONF_OPTS += --disable-zlib
Luca Ceresoli13293402010-06-14 21:41:42 +0200189endif
190
Bernd Kuhls62ab07e2014-01-02 18:59:44 +0100191ifeq ($(BR2_PACKAGE_BZIP2),y)
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200192FFMPEG_CONF_OPTS += --enable-bzlib
Bernd Kuhls62ab07e2014-01-02 18:59:44 +0100193FFMPEG_DEPENDENCIES += bzip2
Arnout Vandecappelle (Essensium/Mind)4e20ad12012-01-22 13:04:16 +0100194else
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200195FFMPEG_CONF_OPTS += --disable-bzlib
Arnout Vandecappelle (Essensium/Mind)4e20ad12012-01-22 13:04:16 +0100196endif
Bernd Kuhls62ab07e2014-01-02 18:59:44 +0100197
Bernd Kuhls632df1d2015-10-17 14:31:58 +0200198ifeq ($(BR2_PACKAGE_FDK_AAC)$(BR2_PACKAGE_FFMPEG_NONFREE),yy)
199FFMPEG_CONF_OPTS += --enable-libfdk-aac
200FFMPEG_DEPENDENCIES += fdk-aac
201else
202FFMPEG_CONF_OPTS += --disable-libfdk-aac
203endif
204
Fabrice Fontainef66bd482018-04-02 10:46:17 +0200205ifeq ($(BR2_PACKAGE_FFMPEG_GPL)$(BR2_PACKAGE_LIBCDIO_PARANOIA),yy)
206FFMPEG_CONF_OPTS += --enable-libcdio
207FFMPEG_DEPENDENCIES += libcdio-paranoia
208else
209FFMPEG_CONF_OPTS += --disable-libcdio
210endif
211
Bernd Kuhls5f7411e2015-10-17 21:38:56 +0200212ifeq ($(BR2_PACKAGE_GNUTLS),y)
213FFMPEG_CONF_OPTS += --enable-gnutls --disable-openssl
214FFMPEG_DEPENDENCIES += gnutls
215else
216FFMPEG_CONF_OPTS += --disable-gnutls
Bernd Kuhls158eab12018-04-02 13:58:26 +0200217ifeq ($(BR2_PACKAGE_OPENSSL),y)
Peter Korsgaard457b6462014-01-13 13:11:39 +0100218# openssl isn't license compatible with GPL
219ifeq ($(BR2_PACKAGE_FFMPEG_GPL)x$(BR2_PACKAGE_FFMPEG_NONFREE),yx)
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200220FFMPEG_CONF_OPTS += --disable-openssl
Peter Korsgaard457b6462014-01-13 13:11:39 +0100221else
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200222FFMPEG_CONF_OPTS += --enable-openssl
Bernd Kuhls158eab12018-04-02 13:58:26 +0200223FFMPEG_DEPENDENCIES += openssl
Peter Korsgaard457b6462014-01-13 13:11:39 +0100224endif
Bernd Kuhls62ab07e2014-01-02 18:59:44 +0100225else
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200226FFMPEG_CONF_OPTS += --disable-openssl
Bernd Kuhls62ab07e2014-01-02 18:59:44 +0100227endif
Bernd Kuhls5f7411e2015-10-17 21:38:56 +0200228endif
Bernd Kuhls62ab07e2014-01-02 18:59:44 +0100229
Bernd Kuhlsaf127a62016-07-24 17:53:18 +0200230ifeq ($(BR2_PACKAGE_FFMPEG_GPL)$(BR2_PACKAGE_LIBEBUR128),yy)
231FFMPEG_DEPENDENCIES += libebur128
232endif
233
Bernd Kuhls632df1d2015-10-17 14:31:58 +0200234ifeq ($(BR2_PACKAGE_LIBOPENH264),y)
235FFMPEG_CONF_OPTS += --enable-libopenh264
236FFMPEG_DEPENDENCIES += libopenh264
237else
238FFMPEG_CONF_OPTS += --disable-libopenh264
239endif
240
Bernd Kuhls62ab07e2014-01-02 18:59:44 +0100241ifeq ($(BR2_PACKAGE_LIBVORBIS),y)
242FFMPEG_DEPENDENCIES += libvorbis
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200243FFMPEG_CONF_OPTS += \
Bernd Kuhls62ab07e2014-01-02 18:59:44 +0100244 --enable-libvorbis \
245 --enable-muxer=ogg \
246 --enable-encoder=libvorbis
247endif
248
Bernd Kuhls17240db2014-07-15 21:19:03 +0200249ifeq ($(BR2_PACKAGE_LIBVA),y)
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200250FFMPEG_CONF_OPTS += --enable-vaapi
Bernd Kuhls17240db2014-07-15 21:19:03 +0200251FFMPEG_DEPENDENCIES += libva
252else
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200253FFMPEG_CONF_OPTS += --disable-vaapi
Bernd Kuhls17240db2014-07-15 21:19:03 +0200254endif
255
Bernd Kuhlsc26132c2016-07-07 22:49:14 +0200256ifeq ($(BR2_PACKAGE_LIBVDPAU),y)
257FFMPEG_CONF_OPTS += --enable-vdpau
258FFMPEG_DEPENDENCIES += libvdpau
259else
260FFMPEG_CONF_OPTS += --disable-vdpau
261endif
262
Thomas Petazzoniba2b4112018-01-01 13:44:28 +0100263ifeq ($(BR2_PACKAGE_RPI_USERLAND),y)
Mahyar Koshkoueie66936e2017-09-14 16:01:56 +0100264FFMPEG_CONF_OPTS += --enable-mmal --enable-omx --enable-omx-rpi \
265 --extra-cflags=-I$(STAGING_DIR)/usr/include/IL
Thomas Petazzoniba2b4112018-01-01 13:44:28 +0100266FFMPEG_DEPENDENCIES += rpi-userland
Mahyar Koshkoueie66936e2017-09-14 16:01:56 +0100267else
268FFMPEG_CONF_OPTS += --disable-mmal --disable-omx --disable-omx-rpi
269endif
270
Bernd Kuhlsd9ea4642016-08-15 17:03:39 +0200271# To avoid a circular dependency only use opencv if opencv itself does
272# not depend on ffmpeg.
273ifeq ($(BR2_PACKAGE_OPENCV_LIB_IMGPROC)x$(BR2_PACKAGE_OPENCV_WITH_FFMPEG),yx)
274FFMPEG_CONF_OPTS += --enable-libopencv
275FFMPEG_DEPENDENCIES += opencv
Bernd Kuhls1b698552016-09-05 16:51:20 +0200276else ifeq ($(BR2_PACKAGE_OPENCV3_LIB_IMGPROC)x$(BR2_PACKAGE_OPENCV3_WITH_FFMPEG),yx)
277FFMPEG_CONF_OPTS += --enable-libopencv
278FFMPEG_DEPENDENCIES += opencv3
Bernd Kuhlsd9ea4642016-08-15 17:03:39 +0200279else
280FFMPEG_CONF_OPTS += --disable-libopencv
281endif
282
David du Colombierad58c882014-09-30 15:28:05 +0200283ifeq ($(BR2_PACKAGE_OPUS),y)
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200284FFMPEG_CONF_OPTS += --enable-libopus
David du Colombierad58c882014-09-30 15:28:05 +0200285FFMPEG_DEPENDENCIES += opus
286else
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200287FFMPEG_CONF_OPTS += --disable-libopus
David du Colombierad58c882014-09-30 15:28:05 +0200288endif
289
David du Colombier8a966c82014-09-30 15:28:04 +0200290ifeq ($(BR2_PACKAGE_LIBVPX),y)
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200291FFMPEG_CONF_OPTS += --enable-libvpx
David du Colombier8a966c82014-09-30 15:28:04 +0200292FFMPEG_DEPENDENCIES += libvpx
293else
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200294FFMPEG_CONF_OPTS += --disable-libvpx
David du Colombier8a966c82014-09-30 15:28:04 +0200295endif
296
Bernd Kuhls0c142592015-08-01 16:20:41 +0200297ifeq ($(BR2_PACKAGE_LIBASS),y)
298FFMPEG_CONF_OPTS += --enable-libass
299FFMPEG_DEPENDENCIES += libass
300else
301FFMPEG_CONF_OPTS += --disable-libass
302endif
303
304ifeq ($(BR2_PACKAGE_LIBBLURAY),y)
305FFMPEG_CONF_OPTS += --enable-libbluray
306FFMPEG_DEPENDENCIES += libbluray
307else
308FFMPEG_CONF_OPTS += --disable-libbluray
309endif
310
311ifeq ($(BR2_PACKAGE_RTMPDUMP),y)
312FFMPEG_CONF_OPTS += --enable-librtmp
313FFMPEG_DEPENDENCIES += rtmpdump
314else
315FFMPEG_CONF_OPTS += --disable-librtmp
316endif
317
318ifeq ($(BR2_PACKAGE_LAME),y)
319FFMPEG_CONF_OPTS += --enable-libmp3lame
320FFMPEG_DEPENDENCIES += lame
321else
322FFMPEG_CONF_OPTS += --disable-libmp3lame
323endif
324
325ifeq ($(BR2_PACKAGE_LIBMODPLUG),y)
326FFMPEG_CONF_OPTS += --enable-libmodplug
327FFMPEG_DEPENDENCIES += libmodplug
328else
329FFMPEG_CONF_OPTS += --disable-libmodplug
330endif
331
332ifeq ($(BR2_PACKAGE_SPEEX),y)
333FFMPEG_CONF_OPTS += --enable-libspeex
334FFMPEG_DEPENDENCIES += speex
335else
336FFMPEG_CONF_OPTS += --disable-libspeex
337endif
338
339ifeq ($(BR2_PACKAGE_LIBTHEORA),y)
340FFMPEG_CONF_OPTS += --enable-libtheora
341FFMPEG_DEPENDENCIES += libtheora
342else
343FFMPEG_CONF_OPTS += --disable-libtheora
344endif
345
346ifeq ($(BR2_PACKAGE_WAVPACK),y)
347FFMPEG_CONF_OPTS += --enable-libwavpack
348FFMPEG_DEPENDENCIES += wavpack
349else
350FFMPEG_CONF_OPTS += --disable-libwavpack
351endif
352
Bernd Kuhlsf6695c42017-12-18 07:29:10 +0100353ifeq ($(BR2_PACKAGE_LIBICONV),y)
354FFMPEG_CONF_OPTS += --enable-iconv
355FFMPEG_DEPENDENCIES += libiconv
356else
357FFMPEG_CONF_OPTS += --disable-iconv
358endif
359
Steve Kenton0ff42f12015-01-26 19:22:35 -0600360# ffmpeg freetype support require fenv.h which is only
Peter Korsgaard64a49802015-01-31 08:18:30 +0100361# available/working on glibc.
362# The microblaze variant doesn't provide the needed exceptions
363ifeq ($(BR2_PACKAGE_FREETYPE)$(BR2_TOOLCHAIN_USES_GLIBC)x$(BR2_microblaze),yyx)
Steve Kenton0ff42f12015-01-26 19:22:35 -0600364FFMPEG_CONF_OPTS += --enable-libfreetype
365FFMPEG_DEPENDENCIES += freetype
366else
367FFMPEG_CONF_OPTS += --disable-libfreetype
368endif
369
370ifeq ($(BR2_PACKAGE_FONTCONFIG),y)
371FFMPEG_CONF_OPTS += --enable-fontconfig
372FFMPEG_DEPENDENCIES += fontconfig
373else
374FFMPEG_CONF_OPTS += --disable-fontconfig
375endif
376
Bernd Kuhlsee4d8c62017-12-18 07:29:11 +0100377ifeq ($(BR2_PACKAGE_OPENJPEG),y)
378FFMPEG_CONF_OPTS += --enable-libopenjpeg
379FFMPEG_DEPENDENCIES += openjpeg
380else
381FFMPEG_CONF_OPTS += --disable-libopenjpeg
382endif
383
David du Colombier31820562014-10-05 18:29:57 +0200384ifeq ($(BR2_PACKAGE_X264)$(BR2_PACKAGE_FFMPEG_GPL),yy)
385FFMPEG_CONF_OPTS += --enable-libx264
386FFMPEG_DEPENDENCIES += x264
387else
388FFMPEG_CONF_OPTS += --disable-libx264
389endif
390
Bernd Kuhlsd6a69582015-11-01 19:47:29 +0100391ifeq ($(BR2_PACKAGE_X265)$(BR2_PACKAGE_FFMPEG_GPL),yy)
392FFMPEG_CONF_OPTS += --enable-libx265
393FFMPEG_DEPENDENCIES += x265
394else
395FFMPEG_CONF_OPTS += --disable-libx265
396endif
397
Bernd Kuhls62ab07e2014-01-02 18:59:44 +0100398ifeq ($(BR2_X86_CPU_HAS_MMX),y)
Bernd Kuhlsf6695c42017-12-18 07:29:10 +0100399FFMPEG_CONF_OPTS += --enable-x86asm
400FFMPEG_DEPENDENCIES += host-nasm
Bernd Kuhls62ab07e2014-01-02 18:59:44 +0100401else
Bernd Kuhlsf6695c42017-12-18 07:29:10 +0100402FFMPEG_CONF_OPTS += --disable-x86asm
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200403FFMPEG_CONF_OPTS += --disable-mmx
Bernd Kuhls62ab07e2014-01-02 18:59:44 +0100404endif
405
406ifeq ($(BR2_X86_CPU_HAS_SSE),y)
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200407FFMPEG_CONF_OPTS += --enable-sse
Bernd Kuhls62ab07e2014-01-02 18:59:44 +0100408else
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200409FFMPEG_CONF_OPTS += --disable-sse
Bernd Kuhls62ab07e2014-01-02 18:59:44 +0100410endif
411
412ifeq ($(BR2_X86_CPU_HAS_SSE2),y)
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200413FFMPEG_CONF_OPTS += --enable-sse2
Bernd Kuhls62ab07e2014-01-02 18:59:44 +0100414else
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200415FFMPEG_CONF_OPTS += --disable-sse2
Bernd Kuhls62ab07e2014-01-02 18:59:44 +0100416endif
417
418ifeq ($(BR2_X86_CPU_HAS_SSE3),y)
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200419FFMPEG_CONF_OPTS += --enable-sse3
Bernd Kuhls62ab07e2014-01-02 18:59:44 +0100420else
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200421FFMPEG_CONF_OPTS += --disable-sse3
Bernd Kuhls62ab07e2014-01-02 18:59:44 +0100422endif
423
424ifeq ($(BR2_X86_CPU_HAS_SSSE3),y)
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200425FFMPEG_CONF_OPTS += --enable-ssse3
Bernd Kuhls62ab07e2014-01-02 18:59:44 +0100426else
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200427FFMPEG_CONF_OPTS += --disable-ssse3
Gustavo Zacarias3f6aa3e2011-02-28 11:18:21 -0300428endif
429
Bernd Kuhls0e8e3c22014-01-02 18:59:45 +0100430ifeq ($(BR2_X86_CPU_HAS_SSE4),y)
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200431FFMPEG_CONF_OPTS += --enable-sse4
Bernd Kuhls0e8e3c22014-01-02 18:59:45 +0100432else
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200433FFMPEG_CONF_OPTS += --disable-sse4
Bernd Kuhls0e8e3c22014-01-02 18:59:45 +0100434endif
435
436ifeq ($(BR2_X86_CPU_HAS_SSE42),y)
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200437FFMPEG_CONF_OPTS += --enable-sse42
Bernd Kuhls0e8e3c22014-01-02 18:59:45 +0100438else
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200439FFMPEG_CONF_OPTS += --disable-sse42
Bernd Kuhls0e8e3c22014-01-02 18:59:45 +0100440endif
441
Steven Noonan1cd92d22015-03-18 15:01:11 -0700442ifeq ($(BR2_X86_CPU_HAS_AVX),y)
443FFMPEG_CONF_OPTS += --enable-avx
444else
445FFMPEG_CONF_OPTS += --disable-avx
446endif
447
448ifeq ($(BR2_X86_CPU_HAS_AVX2),y)
449FFMPEG_CONF_OPTS += --enable-avx2
450else
451FFMPEG_CONF_OPTS += --disable-avx2
452endif
453
Gustavo Zacarias9e77eaf2012-12-21 02:40:31 +0000454# Explicitly disable everything that doesn't match for ARM
455# FFMPEG "autodetects" by compiling an extended instruction via AS
456# This works on compilers that aren't built for generic by default
Thomas Petazzoni0ac115d2014-10-21 22:26:49 +0200457ifeq ($(BR2_ARM_CPU_ARMV4),y)
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200458FFMPEG_CONF_OPTS += --disable-armv5te
Gustavo Zacarias1b269dd2011-03-01 13:20:00 -0300459endif
Thomas Petazzoni0ac115d2014-10-21 22:26:49 +0200460ifeq ($(BR2_ARM_CPU_ARMV6)$(BR2_ARM_CPU_ARMV7A),y)
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200461FFMPEG_CONF_OPTS += --enable-armv6
Gustavo Zacarias9e77eaf2012-12-21 02:40:31 +0000462else
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200463FFMPEG_CONF_OPTS += --disable-armv6 --disable-armv6t2
Gustavo Zacarias1b269dd2011-03-01 13:20:00 -0300464endif
Thomas Petazzoni3300e002014-10-21 22:26:50 +0200465ifeq ($(BR2_ARM_CPU_HAS_VFPV2),y)
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200466FFMPEG_CONF_OPTS += --enable-vfp
Gustavo Zacarias9e77eaf2012-12-21 02:40:31 +0000467else
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200468FFMPEG_CONF_OPTS += --disable-vfp
Gustavo Zacarias1b269dd2011-03-01 13:20:00 -0300469endif
Peter Korsgaardce8a7d52012-12-13 23:25:30 +0100470ifeq ($(BR2_ARM_CPU_HAS_NEON),y)
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200471FFMPEG_CONF_OPTS += --enable-neon
Bernd Kuhls9de01002017-04-14 11:30:26 +0200472else ifeq ($(BR2_aarch64),y)
473FFMPEG_CONF_OPTS += --enable-neon
Thomas Petazzoniae7becf2016-08-10 23:29:03 +0200474else
475FFMPEG_CONF_OPTS += --disable-neon
Gustavo Zacarias1b269dd2011-03-01 13:20:00 -0300476endif
Gustavo Zacarias9e77eaf2012-12-21 02:40:31 +0000477
Thomas Petazzonifdd0f8d2016-08-10 23:29:04 +0200478ifeq ($(BR2_mips)$(BR2_mipsel)$(BR2_mips64)$(BR2_mips64el),y)
Bernd Kuhls0fff2502014-01-13 22:23:06 +0100479ifeq ($(BR2_MIPS_SOFT_FLOAT),y)
Vicente Olivert Riera9aee5572016-07-02 15:32:15 +0200480FFMPEG_CONF_OPTS += --disable-mipsfpu
Bernd Kuhls0fff2502014-01-13 22:23:06 +0100481else
Vicente Olivert Riera9aee5572016-07-02 15:32:15 +0200482FFMPEG_CONF_OPTS += --enable-mipsfpu
Bernd Kuhls0fff2502014-01-13 22:23:06 +0100483endif
Thomas Petazzonifdd0f8d2016-08-10 23:29:04 +0200484endif # MIPS
Bernd Kuhls0fff2502014-01-13 22:23:06 +0100485
Cody P Schafer40e58da2014-05-12 22:28:17 -0700486ifeq ($(BR2_POWERPC_CPU_HAS_ALTIVEC),y)
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200487FFMPEG_CONF_OPTS += --enable-altivec
Mike Williams29a07682011-05-12 16:12:40 -0400488else
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200489FFMPEG_CONF_OPTS += --disable-altivec
Mike Williams29a07682011-05-12 16:12:40 -0400490endif
Gustavo Zacarias1b269dd2011-03-01 13:20:00 -0300491
Bernd Kuhlsfc879812017-04-15 12:22:36 +0200492# Uses __atomic_fetch_add_4
493ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
494FFMPEG_CONF_OPTS += --extra-libs=-latomic
495endif
496
Thomas Petazzoni665e13c2014-12-03 22:41:29 +0100497ifeq ($(BR2_STATIC_LIBS),)
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200498FFMPEG_CONF_OPTS += --enable-pic
Danomi Manchego255aab72014-09-08 22:06:44 -0400499else
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200500FFMPEG_CONF_OPTS += --disable-pic
Bernd Kuhls62ab07e2014-01-02 18:59:44 +0100501endif
502
Vicente Olivert Riera30a87d32016-08-15 17:03:37 +0200503# Default to --cpu=generic for MIPS architecture, in order to avoid a
504# warning from ffmpeg's configure script.
505ifeq ($(BR2_mips)$(BR2_mipsel)$(BR2_mips64)$(BR2_mips64el),y)
506FFMPEG_CONF_OPTS += --cpu=generic
507else ifneq ($(call qstrip,$(BR2_GCC_TARGET_CPU)),)
Thomas Petazzoniae2850b2014-10-21 22:27:10 +0200508FFMPEG_CONF_OPTS += --cpu=$(BR2_GCC_TARGET_CPU)
Karoly Kaszad402daa2014-11-07 09:44:16 +0100509else ifneq ($(call qstrip,$(BR2_GCC_TARGET_ARCH)),)
Thomas Petazzoniae2850b2014-10-21 22:27:10 +0200510FFMPEG_CONF_OPTS += --cpu=$(BR2_GCC_TARGET_ARCH)
511endif
512
Vicente Olivert Riera8849e802015-10-15 13:22:55 +0100513FFMPEG_CONF_OPTS += $(call qstrip,$(BR2_PACKAGE_FFMPEG_EXTRACONF))
514
Luca Ceresoli13293402010-06-14 21:41:42 +0200515# Override FFMPEG_CONFIGURE_CMDS: FFmpeg does not support --target and others
516define FFMPEG_CONFIGURE_CMDS
517 (cd $(FFMPEG_SRCDIR) && rm -rf config.cache && \
518 $(TARGET_CONFIGURE_OPTS) \
519 $(TARGET_CONFIGURE_ARGS) \
Luca Ceresoli13293402010-06-14 21:41:42 +0200520 $(FFMPEG_CONF_ENV) \
521 ./configure \
Bernd Kuhls79449c22014-10-03 11:50:46 +0200522 --enable-cross-compile \
Luca Ceresoli13293402010-06-14 21:41:42 +0200523 --cross-prefix=$(TARGET_CROSS) \
524 --sysroot=$(STAGING_DIR) \
Peter Korsgaarde18087a2011-01-01 11:49:01 +0100525 --host-cc="$(HOSTCC)" \
Luca Ceresoli13293402010-06-14 21:41:42 +0200526 --arch=$(BR2_ARCH) \
Bernd Kuhls62ab07e2014-01-02 18:59:44 +0100527 --target-os="linux" \
Bernd Kuhls12a3ecf2014-08-10 14:46:46 +0200528 --disable-stripping \
Danomi Manchegoa9a5a812014-09-08 22:06:46 -0400529 --pkg-config="$(PKG_CONFIG_HOST_BINARY)" \
Luca Ceresoli97a42962011-06-20 17:59:54 +0200530 $(SHARED_STATIC_LIBS_OPTS) \
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200531 $(FFMPEG_CONF_OPTS) \
Luca Ceresoli13293402010-06-14 21:41:42 +0200532 )
533endef
534
Danomi Manchego194cb3f2017-02-15 22:13:29 -0500535define FFMPEG_REMOVE_EXAMPLE_SRC_FILES
536 rm -rf $(TARGET_DIR)/usr/share/ffmpeg/examples
537endef
538FFMPEG_POST_INSTALL_TARGET_HOOKS += FFMPEG_REMOVE_EXAMPLE_SRC_FILES
539
Arnout Vandecappelle (Essensium/Mind)e1502eb2012-07-03 00:07:32 +0200540$(eval $(autotools-package))