1 ################################################################################
5 ################################################################################
8 FFMPEG_SOURCE
= ffmpeg-
$(FFMPEG_VERSION
).
tar.xz
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 \
40 --enable-runtime-cpudetect \
41 --disable-hardcoded-tables \
42 --disable-memalign-hack \
49 --disable-libopencore-amrnb \
50 --disable-libopencore-amrwb \
57 --disable-libopenjpeg \
58 --disable-libschroedinger \
59 --disable-libvo-amrwbenc \
63 FFMPEG_DEPENDENCIES
+= $(if
$(BR2_PACKAGE_LIBICONV
),libiconv
) host-pkgconf
65 ifeq ($(BR2_PACKAGE_FFMPEG_GPL
),y
)
66 FFMPEG_CONF_OPTS
+= --enable-gpl
68 FFMPEG_CONF_OPTS
+= --disable-gpl
71 ifeq ($(BR2_PACKAGE_FFMPEG_NONFREE
),y
)
72 FFMPEG_CONF_OPTS
+= --enable-nonfree
74 FFMPEG_CONF_OPTS
+= --disable-nonfree
77 ifeq ($(BR2_PACKAGE_FFMPEG_FFMPEG
),y
)
78 FFMPEG_CONF_OPTS
+= --enable-ffmpeg
80 FFMPEG_CONF_OPTS
+= --disable-ffmpeg
83 ifeq ($(BR2_PACKAGE_FFMPEG_FFPLAY
),y
)
84 FFMPEG_DEPENDENCIES
+= sdl
85 FFMPEG_CONF_OPTS
+= --enable-ffplay
86 FFMPEG_CONF_ENV
+= SDL_CONFIG
=$(STAGING_DIR
)/usr
/bin
/sdl-config
88 FFMPEG_CONF_OPTS
+= --disable-ffplay
91 ifeq ($(BR2_PACKAGE_FFMPEG_FFSERVER
),y
)
92 FFMPEG_CONF_OPTS
+= --enable-ffserver
94 FFMPEG_CONF_OPTS
+= --disable-ffserver
97 ifeq ($(BR2_PACKAGE_FFMPEG_AVRESAMPLE
),y
)
98 FFMPEG_CONF_OPTS
+= --enable-avresample
100 FFMPEG_CONF_OPTS
+= --disable-avresample
103 ifeq ($(BR2_PACKAGE_FFMPEG_FFPROBE
),y
)
104 FFMPEG_CONF_OPTS
+= --enable-ffprobe
106 FFMPEG_CONF_OPTS
+= --disable-ffprobe
109 ifeq ($(BR2_PACKAGE_FFMPEG_POSTPROC
),y
)
110 FFMPEG_CONF_OPTS
+= --enable-postproc
112 FFMPEG_CONF_OPTS
+= --disable-postproc
115 ifeq ($(BR2_PACKAGE_FFMPEG_SWSCALE
),y
)
116 FFMPEG_CONF_OPTS
+= --enable-swscale
118 FFMPEG_CONF_OPTS
+= --disable-swscale
121 ifneq ($(call qstrip
,$(BR2_PACKAGE_FFMPEG_ENCODERS
)),all)
122 FFMPEG_CONF_OPTS
+= --disable-encoders \
123 $(foreach x
,$(call qstrip
,$(BR2_PACKAGE_FFMPEG_ENCODERS
)),--enable-encoder
=$(x
))
126 ifneq ($(call qstrip
,$(BR2_PACKAGE_FFMPEG_DECODERS
)),all)
127 FFMPEG_CONF_OPTS
+= --disable-decoders \
128 $(foreach x
,$(call qstrip
,$(BR2_PACKAGE_FFMPEG_DECODERS
)),--enable-decoder
=$(x
))
131 ifneq ($(call qstrip
,$(BR2_PACKAGE_FFMPEG_MUXERS
)),all)
132 FFMPEG_CONF_OPTS
+= --disable-muxers \
133 $(foreach x
,$(call qstrip
,$(BR2_PACKAGE_FFMPEG_MUXERS
)),--enable-muxer
=$(x
))
136 ifneq ($(call qstrip
,$(BR2_PACKAGE_FFMPEG_DEMUXERS
)),all)
137 FFMPEG_CONF_OPTS
+= --disable-demuxers \
138 $(foreach x
,$(call qstrip
,$(BR2_PACKAGE_FFMPEG_DEMUXERS
)),--enable-demuxer
=$(x
))
141 ifneq ($(call qstrip
,$(BR2_PACKAGE_FFMPEG_PARSERS
)),all)
142 FFMPEG_CONF_OPTS
+= --disable-parsers \
143 $(foreach x
,$(call qstrip
,$(BR2_PACKAGE_FFMPEG_PARSERS
)),--enable-parser
=$(x
))
146 ifneq ($(call qstrip
,$(BR2_PACKAGE_FFMPEG_BSFS
)),all)
147 FFMPEG_CONF_OPTS
+= --disable-bsfs \
148 $(foreach x
,$(call qstrip
,$(BR2_PACKAGE_FFMPEG_BSFS
)),--enable-bsfs
=$(x
))
151 ifneq ($(call qstrip
,$(BR2_PACKAGE_FFMPEG_PROTOCOLS
)),all)
152 FFMPEG_CONF_OPTS
+= --disable-protocols \
153 $(foreach x
,$(call qstrip
,$(BR2_PACKAGE_FFMPEG_PROTOCOLS
)),--enable-protocol
=$(x
))
156 ifneq ($(call qstrip
,$(BR2_PACKAGE_FFMPEG_FILTERS
)),all)
157 FFMPEG_CONF_OPTS
+= --disable-filters \
158 $(foreach x
,$(call qstrip
,$(BR2_PACKAGE_FFMPEG_FILTERS
)),--enable-filter
=$(x
))
161 ifeq ($(BR2_PACKAGE_FFMPEG_INDEVS
),y
)
162 FFMPEG_CONF_OPTS
+= --enable-indevs
164 FFMPEG_CONF_OPTS
+= --disable-indevs
167 ifeq ($(BR2_PACKAGE_FFMPEG_OUTDEVS
),y
)
168 FFMPEG_CONF_OPTS
+= --enable-outdevs
170 FFMPEG_CONF_OPTS
+= --disable-outdevs
173 ifeq ($(BR2_TOOLCHAIN_HAS_THREADS
),y
)
174 FFMPEG_CONF_OPTS
+= --enable-pthreads
176 FFMPEG_CONF_OPTS
+= --disable-pthreads
179 ifeq ($(BR2_PACKAGE_ZLIB
),y
)
180 FFMPEG_CONF_OPTS
+= --enable-zlib
181 FFMPEG_DEPENDENCIES
+= zlib
183 FFMPEG_CONF_OPTS
+= --disable-zlib
186 ifeq ($(BR2_PACKAGE_BZIP2
),y
)
187 FFMPEG_CONF_OPTS
+= --enable-bzlib
188 FFMPEG_DEPENDENCIES
+= bzip2
190 FFMPEG_CONF_OPTS
+= --disable-bzlib
193 ifeq ($(BR2_PACKAGE_FDK_AAC
)$(BR2_PACKAGE_FFMPEG_NONFREE
),yy
)
194 FFMPEG_CONF_OPTS
+= --enable-libfdk-aac
195 FFMPEG_DEPENDENCIES
+= fdk-aac
197 FFMPEG_CONF_OPTS
+= --disable-libfdk-aac
200 ifeq ($(BR2_PACKAGE_GNUTLS
),y
)
201 FFMPEG_CONF_OPTS
+= --enable-gnutls
--disable-openssl
202 FFMPEG_DEPENDENCIES
+= gnutls
204 FFMPEG_CONF_OPTS
+= --disable-gnutls
205 ifeq ($(BR2_PACKAGE_OPENSSL
),y
)
206 # openssl isn't license compatible with GPL
207 ifeq ($(BR2_PACKAGE_FFMPEG_GPL
)x
$(BR2_PACKAGE_FFMPEG_NONFREE
),yx
)
208 FFMPEG_CONF_OPTS
+= --disable-openssl
210 FFMPEG_CONF_OPTS
+= --enable-openssl
211 FFMPEG_DEPENDENCIES
+= openssl
214 FFMPEG_CONF_OPTS
+= --disable-openssl
218 ifeq ($(BR2_PACKAGE_FFMPEG_GPL
)$(BR2_PACKAGE_LIBEBUR128
),yy
)
219 FFMPEG_DEPENDENCIES
+= libebur128
222 ifeq ($(BR2_PACKAGE_LIBOPENH264
),y
)
223 FFMPEG_CONF_OPTS
+= --enable-libopenh264
224 FFMPEG_DEPENDENCIES
+= libopenh264
226 FFMPEG_CONF_OPTS
+= --disable-libopenh264
229 ifeq ($(BR2_PACKAGE_LIBVORBIS
),y
)
230 FFMPEG_DEPENDENCIES
+= libvorbis
231 FFMPEG_CONF_OPTS
+= \
234 --enable-encoder
=libvorbis
237 ifeq ($(BR2_PACKAGE_LIBVA
),y
)
238 FFMPEG_CONF_OPTS
+= --enable-vaapi
239 FFMPEG_DEPENDENCIES
+= libva
241 FFMPEG_CONF_OPTS
+= --disable-vaapi
244 ifeq ($(BR2_PACKAGE_LIBVDPAU
),y
)
245 FFMPEG_CONF_OPTS
+= --enable-vdpau
246 FFMPEG_DEPENDENCIES
+= libvdpau
248 FFMPEG_CONF_OPTS
+= --disable-vdpau
251 # To avoid a circular dependency only use opencv if opencv itself does
252 # not depend on ffmpeg.
253 ifeq ($(BR2_PACKAGE_OPENCV_LIB_IMGPROC
)x
$(BR2_PACKAGE_OPENCV_WITH_FFMPEG
),yx
)
254 FFMPEG_CONF_OPTS
+= --enable-libopencv
255 FFMPEG_DEPENDENCIES
+= opencv
256 else ifeq ($(BR2_PACKAGE_OPENCV3_LIB_IMGPROC
)x
$(BR2_PACKAGE_OPENCV3_WITH_FFMPEG
),yx
)
257 FFMPEG_CONF_OPTS
+= --enable-libopencv
258 FFMPEG_DEPENDENCIES
+= opencv3
260 FFMPEG_CONF_OPTS
+= --disable-libopencv
263 ifeq ($(BR2_PACKAGE_OPUS
),y
)
264 FFMPEG_CONF_OPTS
+= --enable-libopus
265 FFMPEG_DEPENDENCIES
+= opus
267 FFMPEG_CONF_OPTS
+= --disable-libopus
270 ifeq ($(BR2_PACKAGE_LIBVPX
),y
)
271 FFMPEG_CONF_OPTS
+= --enable-libvpx
272 FFMPEG_DEPENDENCIES
+= libvpx
274 FFMPEG_CONF_OPTS
+= --disable-libvpx
277 ifeq ($(BR2_PACKAGE_LIBASS
),y
)
278 FFMPEG_CONF_OPTS
+= --enable-libass
279 FFMPEG_DEPENDENCIES
+= libass
281 FFMPEG_CONF_OPTS
+= --disable-libass
284 ifeq ($(BR2_PACKAGE_LIBBLURAY
),y
)
285 FFMPEG_CONF_OPTS
+= --enable-libbluray
286 FFMPEG_DEPENDENCIES
+= libbluray
288 FFMPEG_CONF_OPTS
+= --disable-libbluray
291 ifeq ($(BR2_PACKAGE_RTMPDUMP
),y
)
292 FFMPEG_CONF_OPTS
+= --enable-librtmp
293 FFMPEG_DEPENDENCIES
+= rtmpdump
295 FFMPEG_CONF_OPTS
+= --disable-librtmp
298 ifeq ($(BR2_PACKAGE_LAME
),y
)
299 FFMPEG_CONF_OPTS
+= --enable-libmp3lame
300 FFMPEG_DEPENDENCIES
+= lame
302 FFMPEG_CONF_OPTS
+= --disable-libmp3lame
305 ifeq ($(BR2_PACKAGE_LIBMODPLUG
),y
)
306 FFMPEG_CONF_OPTS
+= --enable-libmodplug
307 FFMPEG_DEPENDENCIES
+= libmodplug
309 FFMPEG_CONF_OPTS
+= --disable-libmodplug
312 ifeq ($(BR2_PACKAGE_SPEEX
),y
)
313 FFMPEG_CONF_OPTS
+= --enable-libspeex
314 FFMPEG_DEPENDENCIES
+= speex
316 FFMPEG_CONF_OPTS
+= --disable-libspeex
319 ifeq ($(BR2_PACKAGE_LIBTHEORA
),y
)
320 FFMPEG_CONF_OPTS
+= --enable-libtheora
321 FFMPEG_DEPENDENCIES
+= libtheora
323 FFMPEG_CONF_OPTS
+= --disable-libtheora
326 ifeq ($(BR2_PACKAGE_WAVPACK
),y
)
327 FFMPEG_CONF_OPTS
+= --enable-libwavpack
328 FFMPEG_DEPENDENCIES
+= wavpack
330 FFMPEG_CONF_OPTS
+= --disable-libwavpack
333 # ffmpeg freetype support require fenv.h which is only
334 # available/working on glibc.
335 # The microblaze variant doesn't provide the needed exceptions
336 ifeq ($(BR2_PACKAGE_FREETYPE
)$(BR2_TOOLCHAIN_USES_GLIBC
)x
$(BR2_microblaze
),yyx
)
337 FFMPEG_CONF_OPTS
+= --enable-libfreetype
338 FFMPEG_DEPENDENCIES
+= freetype
340 FFMPEG_CONF_OPTS
+= --disable-libfreetype
343 ifeq ($(BR2_PACKAGE_FONTCONFIG
),y
)
344 FFMPEG_CONF_OPTS
+= --enable-fontconfig
345 FFMPEG_DEPENDENCIES
+= fontconfig
347 FFMPEG_CONF_OPTS
+= --disable-fontconfig
350 ifeq ($(BR2_PACKAGE_X264
)$(BR2_PACKAGE_FFMPEG_GPL
),yy
)
351 FFMPEG_CONF_OPTS
+= --enable-libx264
352 FFMPEG_DEPENDENCIES
+= x264
354 FFMPEG_CONF_OPTS
+= --disable-libx264
357 ifeq ($(BR2_PACKAGE_X265
)$(BR2_PACKAGE_FFMPEG_GPL
),yy
)
358 FFMPEG_CONF_OPTS
+= --enable-libx265
359 FFMPEG_DEPENDENCIES
+= x265
361 FFMPEG_CONF_OPTS
+= --disable-libx265
364 ifeq ($(BR2_X86_CPU_HAS_MMX
),y
)
365 FFMPEG_CONF_OPTS
+= --enable-yasm
366 FFMPEG_DEPENDENCIES
+= host-yasm
368 ifeq ($(BR2_x86_i586
),y
)
369 # Needed to work around a bug with gcc 5.x:
370 # error: 'asm' operand has impossible constraints
371 FFMPEG_CONF_OPTS
+= --disable-inline-asm
373 FFMPEG_CONF_OPTS
+= --disable-yasm
374 FFMPEG_CONF_OPTS
+= --disable-mmx
377 ifeq ($(BR2_X86_CPU_HAS_SSE
),y
)
378 FFMPEG_CONF_OPTS
+= --enable-sse
380 FFMPEG_CONF_OPTS
+= --disable-sse
383 ifeq ($(BR2_X86_CPU_HAS_SSE2
),y
)
384 FFMPEG_CONF_OPTS
+= --enable-sse2
386 FFMPEG_CONF_OPTS
+= --disable-sse2
389 ifeq ($(BR2_X86_CPU_HAS_SSE3
),y
)
390 FFMPEG_CONF_OPTS
+= --enable-sse3
392 FFMPEG_CONF_OPTS
+= --disable-sse3
395 ifeq ($(BR2_X86_CPU_HAS_SSSE3
),y
)
396 FFMPEG_CONF_OPTS
+= --enable-ssse3
398 FFMPEG_CONF_OPTS
+= --disable-ssse3
401 ifeq ($(BR2_X86_CPU_HAS_SSE4
),y
)
402 FFMPEG_CONF_OPTS
+= --enable-sse4
404 FFMPEG_CONF_OPTS
+= --disable-sse4
407 ifeq ($(BR2_X86_CPU_HAS_SSE42
),y
)
408 FFMPEG_CONF_OPTS
+= --enable-sse42
410 FFMPEG_CONF_OPTS
+= --disable-sse42
413 ifeq ($(BR2_X86_CPU_HAS_AVX
),y
)
414 FFMPEG_CONF_OPTS
+= --enable-avx
416 FFMPEG_CONF_OPTS
+= --disable-avx
419 ifeq ($(BR2_X86_CPU_HAS_AVX2
),y
)
420 FFMPEG_CONF_OPTS
+= --enable-avx2
422 FFMPEG_CONF_OPTS
+= --disable-avx2
425 # Explicitly disable everything that doesn't match for ARM
426 # FFMPEG "autodetects" by compiling an extended instruction via AS
427 # This works on compilers that aren't built for generic by default
428 ifeq ($(BR2_ARM_CPU_ARMV4
),y
)
429 FFMPEG_CONF_OPTS
+= --disable-armv5te
431 ifeq ($(BR2_ARM_CPU_ARMV6
)$(BR2_ARM_CPU_ARMV7A
),y
)
432 FFMPEG_CONF_OPTS
+= --enable-armv6
434 FFMPEG_CONF_OPTS
+= --disable-armv6
--disable-armv6t2
436 ifeq ($(BR2_ARM_CPU_HAS_VFPV2
),y
)
437 FFMPEG_CONF_OPTS
+= --enable-vfp
439 FFMPEG_CONF_OPTS
+= --disable-vfp
441 ifeq ($(BR2_ARM_CPU_HAS_NEON
),y
)
442 FFMPEG_CONF_OPTS
+= --enable-neon
444 FFMPEG_CONF_OPTS
+= --disable-neon
447 ifeq ($(BR2_mips
)$(BR2_mipsel
)$(BR2_mips64
)$(BR2_mips64el
),y
)
448 ifeq ($(BR2_MIPS_SOFT_FLOAT
),y
)
449 FFMPEG_CONF_OPTS
+= --disable-mipsfpu
451 FFMPEG_CONF_OPTS
+= --enable-mipsfpu
455 ifeq ($(BR2_POWERPC_CPU_HAS_ALTIVEC
),y
)
456 FFMPEG_CONF_OPTS
+= --enable-altivec
458 FFMPEG_CONF_OPTS
+= --disable-altivec
461 ifeq ($(BR2_STATIC_LIBS
),)
462 FFMPEG_CONF_OPTS
+= --enable-pic
464 FFMPEG_CONF_OPTS
+= --disable-pic
467 # Default to --cpu=generic for MIPS architecture, in order to avoid a
468 # warning from ffmpeg's configure script.
469 ifeq ($(BR2_mips
)$(BR2_mipsel
)$(BR2_mips64
)$(BR2_mips64el
),y
)
470 FFMPEG_CONF_OPTS
+= --cpu
=generic
471 else ifneq ($(call qstrip
,$(BR2_GCC_TARGET_CPU
)),)
472 FFMPEG_CONF_OPTS
+= --cpu
=$(BR2_GCC_TARGET_CPU
)
473 else ifneq ($(call qstrip
,$(BR2_GCC_TARGET_ARCH
)),)
474 FFMPEG_CONF_OPTS
+= --cpu
=$(BR2_GCC_TARGET_ARCH
)
478 FFMPEG_CONF_OPTS
+= $(call qstrip
,$(BR2_PACKAGE_FFMPEG_EXTRACONF
))
480 # Override FFMPEG_CONFIGURE_CMDS: FFmpeg does not support --target and others
481 define FFMPEG_CONFIGURE_CMDS
482 (cd
$(FFMPEG_SRCDIR
) && rm -rf config.cache
&& \
483 $(TARGET_CONFIGURE_OPTS
) \
484 $(TARGET_CONFIGURE_ARGS
) \
487 --enable-cross-compile \
488 --cross-prefix
=$(TARGET_CROSS
) \
489 --sysroot
=$(STAGING_DIR
) \
490 --host-cc
="$(HOSTCC)" \
492 --target-os
="linux" \
493 --disable-stripping \
494 --pkg-config
="$(PKG_CONFIG_HOST_BINARY)" \
495 $(SHARED_STATIC_LIBS_OPTS
) \
496 $(FFMPEG_CONF_OPTS
) \
500 $(eval
$(autotools-package
))