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 \
56 --disable-libopenjpeg \
57 --disable-libschroedinger \
58 --disable-libvo-amrwbenc \
62 FFMPEG_DEPENDENCIES
+= $(if
$(BR2_PACKAGE_LIBICONV
),libiconv
) host-pkgconf
64 ifeq ($(BR2_PACKAGE_FFMPEG_GPL
),y
)
65 FFMPEG_CONF_OPTS
+= --enable-gpl
67 FFMPEG_CONF_OPTS
+= --disable-gpl
70 ifeq ($(BR2_PACKAGE_FFMPEG_NONFREE
),y
)
71 FFMPEG_CONF_OPTS
+= --enable-nonfree
73 FFMPEG_CONF_OPTS
+= --disable-nonfree
76 ifeq ($(BR2_PACKAGE_FFMPEG_FFMPEG
),y
)
77 FFMPEG_CONF_OPTS
+= --enable-ffmpeg
79 FFMPEG_CONF_OPTS
+= --disable-ffmpeg
82 ifeq ($(BR2_PACKAGE_FFMPEG_FFPLAY
),y
)
83 FFMPEG_DEPENDENCIES
+= sdl2
84 FFMPEG_CONF_OPTS
+= --enable-ffplay
85 FFMPEG_CONF_ENV
+= SDL_CONFIG
=$(STAGING_DIR
)/usr
/bin
/sdl2-config
87 FFMPEG_CONF_OPTS
+= --disable-ffplay
90 ifeq ($(BR2_PACKAGE_FFMPEG_FFSERVER
),y
)
91 FFMPEG_CONF_OPTS
+= --enable-ffserver
93 FFMPEG_CONF_OPTS
+= --disable-ffserver
96 ifeq ($(BR2_PACKAGE_FFMPEG_AVRESAMPLE
),y
)
97 FFMPEG_CONF_OPTS
+= --enable-avresample
99 FFMPEG_CONF_OPTS
+= --disable-avresample
102 ifeq ($(BR2_PACKAGE_FFMPEG_FFPROBE
),y
)
103 FFMPEG_CONF_OPTS
+= --enable-ffprobe
105 FFMPEG_CONF_OPTS
+= --disable-ffprobe
108 ifeq ($(BR2_PACKAGE_FFMPEG_POSTPROC
),y
)
109 FFMPEG_CONF_OPTS
+= --enable-postproc
111 FFMPEG_CONF_OPTS
+= --disable-postproc
114 ifeq ($(BR2_PACKAGE_FFMPEG_SWSCALE
),y
)
115 FFMPEG_CONF_OPTS
+= --enable-swscale
117 FFMPEG_CONF_OPTS
+= --disable-swscale
120 ifneq ($(call qstrip
,$(BR2_PACKAGE_FFMPEG_ENCODERS
)),all)
121 FFMPEG_CONF_OPTS
+= --disable-encoders \
122 $(foreach x
,$(call qstrip
,$(BR2_PACKAGE_FFMPEG_ENCODERS
)),--enable-encoder
=$(x
))
125 ifneq ($(call qstrip
,$(BR2_PACKAGE_FFMPEG_DECODERS
)),all)
126 FFMPEG_CONF_OPTS
+= --disable-decoders \
127 $(foreach x
,$(call qstrip
,$(BR2_PACKAGE_FFMPEG_DECODERS
)),--enable-decoder
=$(x
))
130 ifneq ($(call qstrip
,$(BR2_PACKAGE_FFMPEG_MUXERS
)),all)
131 FFMPEG_CONF_OPTS
+= --disable-muxers \
132 $(foreach x
,$(call qstrip
,$(BR2_PACKAGE_FFMPEG_MUXERS
)),--enable-muxer
=$(x
))
135 ifneq ($(call qstrip
,$(BR2_PACKAGE_FFMPEG_DEMUXERS
)),all)
136 FFMPEG_CONF_OPTS
+= --disable-demuxers \
137 $(foreach x
,$(call qstrip
,$(BR2_PACKAGE_FFMPEG_DEMUXERS
)),--enable-demuxer
=$(x
))
140 ifneq ($(call qstrip
,$(BR2_PACKAGE_FFMPEG_PARSERS
)),all)
141 FFMPEG_CONF_OPTS
+= --disable-parsers \
142 $(foreach x
,$(call qstrip
,$(BR2_PACKAGE_FFMPEG_PARSERS
)),--enable-parser
=$(x
))
145 ifneq ($(call qstrip
,$(BR2_PACKAGE_FFMPEG_BSFS
)),all)
146 FFMPEG_CONF_OPTS
+= --disable-bsfs \
147 $(foreach x
,$(call qstrip
,$(BR2_PACKAGE_FFMPEG_BSFS
)),--enable-bsfs
=$(x
))
150 ifneq ($(call qstrip
,$(BR2_PACKAGE_FFMPEG_PROTOCOLS
)),all)
151 FFMPEG_CONF_OPTS
+= --disable-protocols \
152 $(foreach x
,$(call qstrip
,$(BR2_PACKAGE_FFMPEG_PROTOCOLS
)),--enable-protocol
=$(x
))
155 ifneq ($(call qstrip
,$(BR2_PACKAGE_FFMPEG_FILTERS
)),all)
156 FFMPEG_CONF_OPTS
+= --disable-filters \
157 $(foreach x
,$(call qstrip
,$(BR2_PACKAGE_FFMPEG_FILTERS
)),--enable-filter
=$(x
))
160 ifeq ($(BR2_PACKAGE_FFMPEG_INDEVS
),y
)
161 FFMPEG_CONF_OPTS
+= --enable-indevs
163 FFMPEG_CONF_OPTS
+= --disable-indevs
166 ifeq ($(BR2_PACKAGE_FFMPEG_OUTDEVS
),y
)
167 FFMPEG_CONF_OPTS
+= --enable-outdevs
169 FFMPEG_CONF_OPTS
+= --disable-outdevs
172 ifeq ($(BR2_TOOLCHAIN_HAS_THREADS
),y
)
173 FFMPEG_CONF_OPTS
+= --enable-pthreads
175 FFMPEG_CONF_OPTS
+= --disable-pthreads
178 ifeq ($(BR2_PACKAGE_ZLIB
),y
)
179 FFMPEG_CONF_OPTS
+= --enable-zlib
180 FFMPEG_DEPENDENCIES
+= zlib
182 FFMPEG_CONF_OPTS
+= --disable-zlib
185 ifeq ($(BR2_PACKAGE_BZIP2
),y
)
186 FFMPEG_CONF_OPTS
+= --enable-bzlib
187 FFMPEG_DEPENDENCIES
+= bzip2
189 FFMPEG_CONF_OPTS
+= --disable-bzlib
192 ifeq ($(BR2_PACKAGE_FDK_AAC
)$(BR2_PACKAGE_FFMPEG_NONFREE
),yy
)
193 FFMPEG_CONF_OPTS
+= --enable-libfdk-aac
194 FFMPEG_DEPENDENCIES
+= fdk-aac
196 FFMPEG_CONF_OPTS
+= --disable-libfdk-aac
199 ifeq ($(BR2_PACKAGE_GNUTLS
),y
)
200 FFMPEG_CONF_OPTS
+= --enable-gnutls
--disable-openssl
201 FFMPEG_DEPENDENCIES
+= gnutls
203 FFMPEG_CONF_OPTS
+= --disable-gnutls
204 ifeq ($(BR2_PACKAGE_OPENSSL
),y
)
205 # openssl isn't license compatible with GPL
206 ifeq ($(BR2_PACKAGE_FFMPEG_GPL
)x
$(BR2_PACKAGE_FFMPEG_NONFREE
),yx
)
207 FFMPEG_CONF_OPTS
+= --disable-openssl
209 FFMPEG_CONF_OPTS
+= --enable-openssl
210 FFMPEG_DEPENDENCIES
+= openssl
213 FFMPEG_CONF_OPTS
+= --disable-openssl
217 ifeq ($(BR2_PACKAGE_FFMPEG_GPL
)$(BR2_PACKAGE_LIBEBUR128
),yy
)
218 FFMPEG_DEPENDENCIES
+= libebur128
221 ifeq ($(BR2_PACKAGE_LIBOPENH264
),y
)
222 FFMPEG_CONF_OPTS
+= --enable-libopenh264
223 FFMPEG_DEPENDENCIES
+= libopenh264
225 FFMPEG_CONF_OPTS
+= --disable-libopenh264
228 ifeq ($(BR2_PACKAGE_LIBVORBIS
),y
)
229 FFMPEG_DEPENDENCIES
+= libvorbis
230 FFMPEG_CONF_OPTS
+= \
233 --enable-encoder
=libvorbis
236 ifeq ($(BR2_PACKAGE_LIBVA
),y
)
237 FFMPEG_CONF_OPTS
+= --enable-vaapi
238 FFMPEG_DEPENDENCIES
+= libva
240 FFMPEG_CONF_OPTS
+= --disable-vaapi
243 ifeq ($(BR2_PACKAGE_LIBVDPAU
),y
)
244 FFMPEG_CONF_OPTS
+= --enable-vdpau
245 FFMPEG_DEPENDENCIES
+= libvdpau
247 FFMPEG_CONF_OPTS
+= --disable-vdpau
250 # To avoid a circular dependency only use opencv if opencv itself does
251 # not depend on ffmpeg.
252 ifeq ($(BR2_PACKAGE_OPENCV_LIB_IMGPROC
)x
$(BR2_PACKAGE_OPENCV_WITH_FFMPEG
),yx
)
253 FFMPEG_CONF_OPTS
+= --enable-libopencv
254 FFMPEG_DEPENDENCIES
+= opencv
255 else ifeq ($(BR2_PACKAGE_OPENCV3_LIB_IMGPROC
)x
$(BR2_PACKAGE_OPENCV3_WITH_FFMPEG
),yx
)
256 FFMPEG_CONF_OPTS
+= --enable-libopencv
257 FFMPEG_DEPENDENCIES
+= opencv3
259 FFMPEG_CONF_OPTS
+= --disable-libopencv
262 ifeq ($(BR2_PACKAGE_OPUS
),y
)
263 FFMPEG_CONF_OPTS
+= --enable-libopus
264 FFMPEG_DEPENDENCIES
+= opus
266 FFMPEG_CONF_OPTS
+= --disable-libopus
269 ifeq ($(BR2_PACKAGE_LIBVPX
),y
)
270 FFMPEG_CONF_OPTS
+= --enable-libvpx
271 FFMPEG_DEPENDENCIES
+= libvpx
273 FFMPEG_CONF_OPTS
+= --disable-libvpx
276 ifeq ($(BR2_PACKAGE_LIBASS
),y
)
277 FFMPEG_CONF_OPTS
+= --enable-libass
278 FFMPEG_DEPENDENCIES
+= libass
280 FFMPEG_CONF_OPTS
+= --disable-libass
283 ifeq ($(BR2_PACKAGE_LIBBLURAY
),y
)
284 FFMPEG_CONF_OPTS
+= --enable-libbluray
285 FFMPEG_DEPENDENCIES
+= libbluray
287 FFMPEG_CONF_OPTS
+= --disable-libbluray
290 ifeq ($(BR2_PACKAGE_RTMPDUMP
),y
)
291 FFMPEG_CONF_OPTS
+= --enable-librtmp
292 FFMPEG_DEPENDENCIES
+= rtmpdump
294 FFMPEG_CONF_OPTS
+= --disable-librtmp
297 ifeq ($(BR2_PACKAGE_LAME
),y
)
298 FFMPEG_CONF_OPTS
+= --enable-libmp3lame
299 FFMPEG_DEPENDENCIES
+= lame
301 FFMPEG_CONF_OPTS
+= --disable-libmp3lame
304 ifeq ($(BR2_PACKAGE_LIBMODPLUG
),y
)
305 FFMPEG_CONF_OPTS
+= --enable-libmodplug
306 FFMPEG_DEPENDENCIES
+= libmodplug
308 FFMPEG_CONF_OPTS
+= --disable-libmodplug
311 ifeq ($(BR2_PACKAGE_SPEEX
),y
)
312 FFMPEG_CONF_OPTS
+= --enable-libspeex
313 FFMPEG_DEPENDENCIES
+= speex
315 FFMPEG_CONF_OPTS
+= --disable-libspeex
318 ifeq ($(BR2_PACKAGE_LIBTHEORA
),y
)
319 FFMPEG_CONF_OPTS
+= --enable-libtheora
320 FFMPEG_DEPENDENCIES
+= libtheora
322 FFMPEG_CONF_OPTS
+= --disable-libtheora
325 ifeq ($(BR2_PACKAGE_WAVPACK
),y
)
326 FFMPEG_CONF_OPTS
+= --enable-libwavpack
327 FFMPEG_DEPENDENCIES
+= wavpack
329 FFMPEG_CONF_OPTS
+= --disable-libwavpack
332 # ffmpeg freetype support require fenv.h which is only
333 # available/working on glibc.
334 # The microblaze variant doesn't provide the needed exceptions
335 ifeq ($(BR2_PACKAGE_FREETYPE
)$(BR2_TOOLCHAIN_USES_GLIBC
)x
$(BR2_microblaze
),yyx
)
336 FFMPEG_CONF_OPTS
+= --enable-libfreetype
337 FFMPEG_DEPENDENCIES
+= freetype
339 FFMPEG_CONF_OPTS
+= --disable-libfreetype
342 ifeq ($(BR2_PACKAGE_FONTCONFIG
),y
)
343 FFMPEG_CONF_OPTS
+= --enable-fontconfig
344 FFMPEG_DEPENDENCIES
+= fontconfig
346 FFMPEG_CONF_OPTS
+= --disable-fontconfig
349 ifeq ($(BR2_PACKAGE_X264
)$(BR2_PACKAGE_FFMPEG_GPL
),yy
)
350 FFMPEG_CONF_OPTS
+= --enable-libx264
351 FFMPEG_DEPENDENCIES
+= x264
353 FFMPEG_CONF_OPTS
+= --disable-libx264
356 ifeq ($(BR2_PACKAGE_X265
)$(BR2_PACKAGE_FFMPEG_GPL
),yy
)
357 FFMPEG_CONF_OPTS
+= --enable-libx265
358 FFMPEG_DEPENDENCIES
+= x265
360 FFMPEG_CONF_OPTS
+= --disable-libx265
363 ifeq ($(BR2_X86_CPU_HAS_MMX
),y
)
364 FFMPEG_CONF_OPTS
+= --enable-yasm
365 FFMPEG_DEPENDENCIES
+= host-yasm
367 ifeq ($(BR2_x86_i586
),y
)
368 # Needed to work around a bug with gcc 5.x:
369 # error: 'asm' operand has impossible constraints
370 FFMPEG_CONF_OPTS
+= --disable-inline-asm
372 FFMPEG_CONF_OPTS
+= --disable-yasm
373 FFMPEG_CONF_OPTS
+= --disable-mmx
376 ifeq ($(BR2_X86_CPU_HAS_SSE
),y
)
377 FFMPEG_CONF_OPTS
+= --enable-sse
379 FFMPEG_CONF_OPTS
+= --disable-sse
382 ifeq ($(BR2_X86_CPU_HAS_SSE2
),y
)
383 FFMPEG_CONF_OPTS
+= --enable-sse2
385 FFMPEG_CONF_OPTS
+= --disable-sse2
388 ifeq ($(BR2_X86_CPU_HAS_SSE3
),y
)
389 FFMPEG_CONF_OPTS
+= --enable-sse3
391 FFMPEG_CONF_OPTS
+= --disable-sse3
394 ifeq ($(BR2_X86_CPU_HAS_SSSE3
),y
)
395 FFMPEG_CONF_OPTS
+= --enable-ssse3
397 FFMPEG_CONF_OPTS
+= --disable-ssse3
400 ifeq ($(BR2_X86_CPU_HAS_SSE4
),y
)
401 FFMPEG_CONF_OPTS
+= --enable-sse4
403 FFMPEG_CONF_OPTS
+= --disable-sse4
406 ifeq ($(BR2_X86_CPU_HAS_SSE42
),y
)
407 FFMPEG_CONF_OPTS
+= --enable-sse42
409 FFMPEG_CONF_OPTS
+= --disable-sse42
412 ifeq ($(BR2_X86_CPU_HAS_AVX
),y
)
413 FFMPEG_CONF_OPTS
+= --enable-avx
415 FFMPEG_CONF_OPTS
+= --disable-avx
418 ifeq ($(BR2_X86_CPU_HAS_AVX2
),y
)
419 FFMPEG_CONF_OPTS
+= --enable-avx2
421 FFMPEG_CONF_OPTS
+= --disable-avx2
424 # Explicitly disable everything that doesn't match for ARM
425 # FFMPEG "autodetects" by compiling an extended instruction via AS
426 # This works on compilers that aren't built for generic by default
427 ifeq ($(BR2_ARM_CPU_ARMV4
),y
)
428 FFMPEG_CONF_OPTS
+= --disable-armv5te
430 ifeq ($(BR2_ARM_CPU_ARMV6
)$(BR2_ARM_CPU_ARMV7A
),y
)
431 FFMPEG_CONF_OPTS
+= --enable-armv6
433 FFMPEG_CONF_OPTS
+= --disable-armv6
--disable-armv6t2
435 ifeq ($(BR2_ARM_CPU_HAS_VFPV2
),y
)
436 FFMPEG_CONF_OPTS
+= --enable-vfp
438 FFMPEG_CONF_OPTS
+= --disable-vfp
440 ifeq ($(BR2_ARM_CPU_HAS_NEON
),y
)
441 FFMPEG_CONF_OPTS
+= --enable-neon
443 FFMPEG_CONF_OPTS
+= --disable-neon
446 ifeq ($(BR2_mips
)$(BR2_mipsel
)$(BR2_mips64
)$(BR2_mips64el
),y
)
447 ifeq ($(BR2_MIPS_SOFT_FLOAT
),y
)
448 FFMPEG_CONF_OPTS
+= --disable-mipsfpu
450 FFMPEG_CONF_OPTS
+= --enable-mipsfpu
454 ifeq ($(BR2_POWERPC_CPU_HAS_ALTIVEC
),y
)
455 FFMPEG_CONF_OPTS
+= --enable-altivec
457 FFMPEG_CONF_OPTS
+= --disable-altivec
460 ifeq ($(BR2_STATIC_LIBS
),)
461 FFMPEG_CONF_OPTS
+= --enable-pic
463 FFMPEG_CONF_OPTS
+= --disable-pic
466 # Default to --cpu=generic for MIPS architecture, in order to avoid a
467 # warning from ffmpeg's configure script.
468 ifeq ($(BR2_mips
)$(BR2_mipsel
)$(BR2_mips64
)$(BR2_mips64el
),y
)
469 FFMPEG_CONF_OPTS
+= --cpu
=generic
470 else ifneq ($(call qstrip
,$(BR2_GCC_TARGET_CPU
)),)
471 FFMPEG_CONF_OPTS
+= --cpu
=$(BR2_GCC_TARGET_CPU
)
472 else ifneq ($(call qstrip
,$(BR2_GCC_TARGET_ARCH
)),)
473 FFMPEG_CONF_OPTS
+= --cpu
=$(BR2_GCC_TARGET_ARCH
)
477 FFMPEG_CONF_OPTS
+= $(call qstrip
,$(BR2_PACKAGE_FFMPEG_EXTRACONF
))
479 # Override FFMPEG_CONFIGURE_CMDS: FFmpeg does not support --target and others
480 define FFMPEG_CONFIGURE_CMDS
481 (cd
$(FFMPEG_SRCDIR
) && rm -rf config.cache
&& \
482 $(TARGET_CONFIGURE_OPTS
) \
483 $(TARGET_CONFIGURE_ARGS
) \
486 --enable-cross-compile \
487 --cross-prefix
=$(TARGET_CROSS
) \
488 --sysroot
=$(STAGING_DIR
) \
489 --host-cc
="$(HOSTCC)" \
491 --target-os
="linux" \
492 --disable-stripping \
493 --pkg-config
="$(PKG_CONFIG_HOST_BINARY)" \
494 $(SHARED_STATIC_LIBS_OPTS
) \
495 $(FFMPEG_CONF_OPTS
) \
499 define FFMPEG_REMOVE_EXAMPLE_SRC_FILES
500 rm -rf
$(TARGET_DIR
)/usr
/share
/ffmpeg
/examples
502 FFMPEG_POST_INSTALL_TARGET_HOOKS
+= FFMPEG_REMOVE_EXAMPLE_SRC_FILES
504 $(eval
$(autotools-package
))