1 ################################################################################
5 ################################################################################
8 FFMPEG_SOURCE = ffmpeg-$(FFMPEG_VERSION).tar.bz2
9 FFMPEG_SITE = http://ffmpeg.org/releases
10 FFMPEG_INSTALL_STAGING = YES
12 FFMPEG_LICENSE = LGPLv2.1+, libjpeg license
13 FFMPEG_LICENSE_FILES = LICENSE.md COPYING.LGPLv2.1
14 ifeq ($(BR2_PACKAGE_FFMPEG_GPL),y)
15 FFMPEG_LICENSE += and GPLv2+
16 FFMPEG_LICENSE_FILES += COPYING.GPLv2
24 --enable-optimizations \
25 --disable-extra-warnings \
32 --enable-swscale-alpha \
41 --enable-runtime-cpudetect \
42 --disable-hardcoded-tables \
43 --disable-memalign-hack \
47 --disable-libopencore-amrnb \
48 --disable-libopencore-amrwb \
53 --disable-libmp3lame \
55 --disable-libopenjpeg \
57 --disable-libschroedinger \
60 --disable-libvo-aacenc \
61 --disable-libvo-amrwbenc \
65 FFMPEG_DEPENDENCIES += $(if $(BR2_PACKAGE_LIBICONV),libiconv) host-pkgconf
67 ifeq ($(BR2_PACKAGE_FFMPEG_GPL),y)
68 FFMPEG_CONF_OPTS += --enable-gpl
70 FFMPEG_CONF_OPTS += --disable-gpl
73 ifeq ($(BR2_PACKAGE_FFMPEG_NONFREE),y)
74 FFMPEG_CONF_OPTS += --enable-nonfree
76 FFMPEG_CONF_OPTS += --disable-nonfree
79 ifeq ($(BR2_PACKAGE_FFMPEG_FFMPEG),y)
80 FFMPEG_CONF_OPTS += --enable-ffmpeg
82 FFMPEG_CONF_OPTS += --disable-ffmpeg
85 ifeq ($(BR2_PACKAGE_FFMPEG_FFPLAY),y)
86 FFMPEG_DEPENDENCIES += sdl
87 FFMPEG_CONF_OPTS += --enable-ffplay
88 FFMPEG_CONF_ENV += SDL_CONFIG=$(STAGING_DIR)/usr/bin/sdl-config
90 FFMPEG_CONF_OPTS += --disable-ffplay
93 ifeq ($(BR2_PACKAGE_FFMPEG_FFSERVER),y)
94 FFMPEG_CONF_OPTS += --enable-ffserver
96 FFMPEG_CONF_OPTS += --disable-ffserver
99 ifeq ($(BR2_PACKAGE_FFMPEG_AVRESAMPLE),y)
100 FFMPEG_CONF_OPTS += --enable-avresample
102 FFMPEG_CONF_OPTS += --disable-avresample
105 ifeq ($(BR2_PACKAGE_FFMPEG_FFPROBE),y)
106 FFMPEG_CONF_OPTS += --enable-ffprobe
108 FFMPEG_CONF_OPTS += --disable-ffprobe
111 ifeq ($(BR2_PACKAGE_FFMPEG_POSTPROC),y)
112 FFMPEG_CONF_OPTS += --enable-postproc
114 FFMPEG_CONF_OPTS += --disable-postproc
117 ifeq ($(BR2_PACKAGE_FFMPEG_SWSCALE),y)
118 FFMPEG_CONF_OPTS += --enable-swscale
120 FFMPEG_CONF_OPTS += --disable-swscale
123 ifneq ($(call qstrip,$(BR2_PACKAGE_FFMPEG_ENCODERS)),all)
124 FFMPEG_CONF_OPTS += --disable-encoders \
125 $(foreach x,$(call qstrip,$(BR2_PACKAGE_FFMPEG_ENCODERS)),--enable-encoder=$(x))
128 ifneq ($(call qstrip,$(BR2_PACKAGE_FFMPEG_DECODERS)),all)
129 FFMPEG_CONF_OPTS += --disable-decoders \
130 $(foreach x,$(call qstrip,$(BR2_PACKAGE_FFMPEG_DECODERS)),--enable-decoder=$(x))
133 ifneq ($(call qstrip,$(BR2_PACKAGE_FFMPEG_MUXERS)),all)
134 FFMPEG_CONF_OPTS += --disable-muxers \
135 $(foreach x,$(call qstrip,$(BR2_PACKAGE_FFMPEG_MUXERS)),--enable-muxer=$(x))
138 ifneq ($(call qstrip,$(BR2_PACKAGE_FFMPEG_DEMUXERS)),all)
139 FFMPEG_CONF_OPTS += --disable-demuxers \
140 $(foreach x,$(call qstrip,$(BR2_PACKAGE_FFMPEG_DEMUXERS)),--enable-demuxer=$(x))
143 ifneq ($(call qstrip,$(BR2_PACKAGE_FFMPEG_PARSERS)),all)
144 FFMPEG_CONF_OPTS += --disable-parsers \
145 $(foreach x,$(call qstrip,$(BR2_PACKAGE_FFMPEG_PARSERS)),--enable-parser=$(x))
148 ifneq ($(call qstrip,$(BR2_PACKAGE_FFMPEG_BSFS)),all)
149 FFMPEG_CONF_OPTS += --disable-bsfs \
150 $(foreach x,$(call qstrip,$(BR2_PACKAGE_FFMPEG_BSFS)),--enable-bsfs=$(x))
153 ifneq ($(call qstrip,$(BR2_PACKAGE_FFMPEG_PROTOCOLS)),all)
154 FFMPEG_CONF_OPTS += --disable-protocols \
155 $(foreach x,$(call qstrip,$(BR2_PACKAGE_FFMPEG_PROTOCOLS)),--enable-protocol=$(x))
158 ifneq ($(call qstrip,$(BR2_PACKAGE_FFMPEG_FILTERS)),all)
159 FFMPEG_CONF_OPTS += --disable-filters \
160 $(foreach x,$(call qstrip,$(BR2_PACKAGE_FFMPEG_FILTERS)),--enable-filter=$(x))
163 ifeq ($(BR2_PACKAGE_FFMPEG_INDEVS),y)
164 FFMPEG_CONF_OPTS += --enable-indevs
166 FFMPEG_CONF_OPTS += --disable-indevs
169 ifeq ($(BR2_PACKAGE_FFMPEG_OUTDEVS),y)
170 FFMPEG_CONF_OPTS += --enable-outdevs
172 FFMPEG_CONF_OPTS += --disable-outdevs
175 ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y)
176 FFMPEG_CONF_OPTS += --enable-pthreads
178 FFMPEG_CONF_OPTS += --disable-pthreads
181 ifeq ($(BR2_PACKAGE_ZLIB),y)
182 FFMPEG_CONF_OPTS += --enable-zlib
183 FFMPEG_DEPENDENCIES += zlib
185 FFMPEG_CONF_OPTS += --disable-zlib
188 ifeq ($(BR2_PACKAGE_BZIP2),y)
189 FFMPEG_CONF_OPTS += --enable-bzlib
190 FFMPEG_DEPENDENCIES += bzip2
192 FFMPEG_CONF_OPTS += --disable-bzlib
195 ifeq ($(BR2_PACKAGE_OPENSSL),y)
196 # openssl isn't license compatible with GPL
197 ifeq ($(BR2_PACKAGE_FFMPEG_GPL)x$(BR2_PACKAGE_FFMPEG_NONFREE),yx)
198 FFMPEG_CONF_OPTS += --disable-openssl
200 FFMPEG_CONF_OPTS += --enable-openssl
201 FFMPEG_DEPENDENCIES += openssl
204 FFMPEG_CONF_OPTS += --disable-openssl
207 ifeq ($(BR2_PACKAGE_LIBVORBIS),y)
208 FFMPEG_DEPENDENCIES += libvorbis
209 FFMPEG_CONF_OPTS += \
212 --enable-encoder=libvorbis
215 ifeq ($(BR2_PACKAGE_LIBVA),y)
216 FFMPEG_CONF_OPTS += --enable-vaapi
217 FFMPEG_DEPENDENCIES += libva
219 FFMPEG_CONF_OPTS += --disable-vaapi
222 ifeq ($(BR2_PACKAGE_OPUS),y)
223 FFMPEG_CONF_OPTS += --enable-libopus
224 FFMPEG_DEPENDENCIES += opus
226 FFMPEG_CONF_OPTS += --disable-libopus
229 ifeq ($(BR2_PACKAGE_LIBVPX),y)
230 FFMPEG_CONF_OPTS += --enable-libvpx
231 FFMPEG_DEPENDENCIES += libvpx
233 FFMPEG_CONF_OPTS += --disable-libvpx
236 # ffmpeg freetype support require fenv.h which is only
237 # available/working on glibc.
238 # The microblaze variant doesn't provide the needed exceptions
239 ifeq ($(BR2_PACKAGE_FREETYPE)$(BR2_TOOLCHAIN_USES_GLIBC)x$(BR2_microblaze),yyx)
240 FFMPEG_CONF_OPTS += --enable-libfreetype
241 FFMPEG_DEPENDENCIES += freetype
243 FFMPEG_CONF_OPTS += --disable-libfreetype
246 ifeq ($(BR2_PACKAGE_FONTCONFIG),y)
247 FFMPEG_CONF_OPTS += --enable-fontconfig
248 FFMPEG_DEPENDENCIES += fontconfig
250 FFMPEG_CONF_OPTS += --disable-fontconfig
253 ifeq ($(BR2_PACKAGE_X264)$(BR2_PACKAGE_FFMPEG_GPL),yy)
254 FFMPEG_CONF_OPTS += --enable-libx264
255 FFMPEG_DEPENDENCIES += x264
257 FFMPEG_CONF_OPTS += --disable-libx264
260 ifeq ($(BR2_X86_CPU_HAS_MMX),y)
261 FFMPEG_CONF_OPTS += --enable-yasm
262 FFMPEG_DEPENDENCIES += host-yasm
264 FFMPEG_CONF_OPTS += --disable-yasm
265 FFMPEG_CONF_OPTS += --disable-mmx
268 ifeq ($(BR2_X86_CPU_HAS_SSE),y)
269 FFMPEG_CONF_OPTS += --enable-sse
271 FFMPEG_CONF_OPTS += --disable-sse
274 ifeq ($(BR2_X86_CPU_HAS_SSE2),y)
275 FFMPEG_CONF_OPTS += --enable-sse2
277 FFMPEG_CONF_OPTS += --disable-sse2
280 ifeq ($(BR2_X86_CPU_HAS_SSE3),y)
281 FFMPEG_CONF_OPTS += --enable-sse3
283 FFMPEG_CONF_OPTS += --disable-sse3
286 ifeq ($(BR2_X86_CPU_HAS_SSSE3),y)
287 FFMPEG_CONF_OPTS += --enable-ssse3
289 FFMPEG_CONF_OPTS += --disable-ssse3
292 ifeq ($(BR2_X86_CPU_HAS_SSE4),y)
293 FFMPEG_CONF_OPTS += --enable-sse4
295 FFMPEG_CONF_OPTS += --disable-sse4
298 ifeq ($(BR2_X86_CPU_HAS_SSE42),y)
299 FFMPEG_CONF_OPTS += --enable-sse42
301 FFMPEG_CONF_OPTS += --disable-sse42
304 ifeq ($(BR2_X86_CPU_HAS_AVX),y)
305 FFMPEG_CONF_OPTS += --enable-avx
307 FFMPEG_CONF_OPTS += --disable-avx
310 ifeq ($(BR2_X86_CPU_HAS_AVX2),y)
311 FFMPEG_CONF_OPTS += --enable-avx2
313 FFMPEG_CONF_OPTS += --disable-avx2
316 # Explicitly disable everything that doesn't match for ARM
317 # FFMPEG "autodetects" by compiling an extended instruction via AS
318 # This works on compilers that aren't built for generic by default
319 ifeq ($(BR2_ARM_CPU_ARMV4),y)
320 FFMPEG_CONF_OPTS += --disable-armv5te
322 ifeq ($(BR2_ARM_CPU_ARMV6)$(BR2_ARM_CPU_ARMV7A),y)
323 FFMPEG_CONF_OPTS += --enable-armv6
325 FFMPEG_CONF_OPTS += --disable-armv6 --disable-armv6t2
327 ifeq ($(BR2_ARM_CPU_HAS_VFPV2),y)
328 FFMPEG_CONF_OPTS += --enable-vfp
330 FFMPEG_CONF_OPTS += --disable-vfp
332 ifeq ($(BR2_ARM_CPU_HAS_NEON),y)
333 FFMPEG_CONF_OPTS += --enable-neon
336 ifeq ($(BR2_MIPS_SOFT_FLOAT),y)
337 FFMPEG_CONF_OPTS += \
340 FFMPEG_CONF_OPTS += \
344 ifeq ($(BR2_mips_32r2),y)
345 FFMPEG_CONF_OPTS += \
348 FFMPEG_CONF_OPTS += \
352 ifeq ($(BR2_mips_64r2),y)
353 FFMPEG_CONF_OPTS += \
357 FFMPEG_CONF_OPTS += \
358 --disable-mipsdspr1 \
362 ifeq ($(BR2_POWERPC_CPU_HAS_ALTIVEC),y)
363 FFMPEG_CONF_OPTS += --enable-altivec
365 FFMPEG_CONF_OPTS += --disable-altivec
368 ifeq ($(BR2_STATIC_LIBS),)
369 FFMPEG_CONF_OPTS += --enable-pic
371 FFMPEG_CONF_OPTS += --disable-pic
374 FFMPEG_CONF_OPTS += $(call qstrip,$(BR2_PACKAGE_FFMPEG_EXTRACONF))
376 ifneq ($(call qstrip,$(BR2_GCC_TARGET_CPU)),)
377 FFMPEG_CONF_OPTS += --cpu=$(BR2_GCC_TARGET_CPU)
378 else ifneq ($(call qstrip,$(BR2_GCC_TARGET_ARCH)),)
379 FFMPEG_CONF_OPTS += --cpu=$(BR2_GCC_TARGET_ARCH)
382 # Override FFMPEG_CONFIGURE_CMDS: FFmpeg does not support --target and others
383 define FFMPEG_CONFIGURE_CMDS
384 (cd $(FFMPEG_SRCDIR) && rm -rf config.cache && \
385 $(TARGET_CONFIGURE_OPTS) \
386 $(TARGET_CONFIGURE_ARGS) \
389 --enable-cross-compile \
390 --cross-prefix=$(TARGET_CROSS) \
391 --sysroot=$(STAGING_DIR) \
392 --host-cc="$(HOSTCC)" \
394 --target-os="linux" \
395 --disable-stripping \
396 --pkg-config="$(PKG_CONFIG_HOST_BINARY)" \
397 $(SHARED_STATIC_LIBS_OPTS) \
398 $(FFMPEG_CONF_OPTS) \
402 $(eval $(autotools-package))