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 \
41 --enable-runtime-cpudetect \
42 --disable-hardcoded-tables \
43 --disable-memalign-hack \
50 --disable-libopencore-amrnb \
51 --disable-libopencore-amrwb \
59 --disable-libopenjpeg \
60 --disable-libschroedinger \
61 --disable-libvo-aacenc \
62 --disable-libvo-amrwbenc \
66 FFMPEG_DEPENDENCIES
+= $(if
$(BR2_PACKAGE_LIBICONV
),libiconv
) host-pkgconf
68 ifeq ($(BR2_PACKAGE_FFMPEG_GPL
),y
)
69 FFMPEG_CONF_OPTS
+= --enable-gpl
71 FFMPEG_CONF_OPTS
+= --disable-gpl
74 ifeq ($(BR2_PACKAGE_FFMPEG_NONFREE
),y
)
75 FFMPEG_CONF_OPTS
+= --enable-nonfree
77 FFMPEG_CONF_OPTS
+= --disable-nonfree
80 ifeq ($(BR2_PACKAGE_FFMPEG_FFMPEG
),y
)
81 FFMPEG_CONF_OPTS
+= --enable-ffmpeg
83 FFMPEG_CONF_OPTS
+= --disable-ffmpeg
86 ifeq ($(BR2_PACKAGE_FFMPEG_FFPLAY
),y
)
87 FFMPEG_DEPENDENCIES
+= sdl
88 FFMPEG_CONF_OPTS
+= --enable-ffplay
89 FFMPEG_CONF_ENV
+= SDL_CONFIG
=$(STAGING_DIR
)/usr
/bin
/sdl-config
91 FFMPEG_CONF_OPTS
+= --disable-ffplay
94 ifeq ($(BR2_PACKAGE_FFMPEG_FFSERVER
),y
)
95 FFMPEG_CONF_OPTS
+= --enable-ffserver
97 FFMPEG_CONF_OPTS
+= --disable-ffserver
100 ifeq ($(BR2_PACKAGE_FFMPEG_AVRESAMPLE
),y
)
101 FFMPEG_CONF_OPTS
+= --enable-avresample
103 FFMPEG_CONF_OPTS
+= --disable-avresample
106 ifeq ($(BR2_PACKAGE_FFMPEG_FFPROBE
),y
)
107 FFMPEG_CONF_OPTS
+= --enable-ffprobe
109 FFMPEG_CONF_OPTS
+= --disable-ffprobe
112 ifeq ($(BR2_PACKAGE_FFMPEG_POSTPROC
),y
)
113 FFMPEG_CONF_OPTS
+= --enable-postproc
115 FFMPEG_CONF_OPTS
+= --disable-postproc
118 ifeq ($(BR2_PACKAGE_FFMPEG_SWSCALE
),y
)
119 FFMPEG_CONF_OPTS
+= --enable-swscale
121 FFMPEG_CONF_OPTS
+= --disable-swscale
124 ifneq ($(call qstrip
,$(BR2_PACKAGE_FFMPEG_ENCODERS
)),all)
125 FFMPEG_CONF_OPTS
+= --disable-encoders \
126 $(foreach x
,$(call qstrip
,$(BR2_PACKAGE_FFMPEG_ENCODERS
)),--enable-encoder
=$(x
))
129 ifneq ($(call qstrip
,$(BR2_PACKAGE_FFMPEG_DECODERS
)),all)
130 FFMPEG_CONF_OPTS
+= --disable-decoders \
131 $(foreach x
,$(call qstrip
,$(BR2_PACKAGE_FFMPEG_DECODERS
)),--enable-decoder
=$(x
))
134 ifneq ($(call qstrip
,$(BR2_PACKAGE_FFMPEG_MUXERS
)),all)
135 FFMPEG_CONF_OPTS
+= --disable-muxers \
136 $(foreach x
,$(call qstrip
,$(BR2_PACKAGE_FFMPEG_MUXERS
)),--enable-muxer
=$(x
))
139 ifneq ($(call qstrip
,$(BR2_PACKAGE_FFMPEG_DEMUXERS
)),all)
140 FFMPEG_CONF_OPTS
+= --disable-demuxers \
141 $(foreach x
,$(call qstrip
,$(BR2_PACKAGE_FFMPEG_DEMUXERS
)),--enable-demuxer
=$(x
))
144 ifneq ($(call qstrip
,$(BR2_PACKAGE_FFMPEG_PARSERS
)),all)
145 FFMPEG_CONF_OPTS
+= --disable-parsers \
146 $(foreach x
,$(call qstrip
,$(BR2_PACKAGE_FFMPEG_PARSERS
)),--enable-parser
=$(x
))
149 ifneq ($(call qstrip
,$(BR2_PACKAGE_FFMPEG_BSFS
)),all)
150 FFMPEG_CONF_OPTS
+= --disable-bsfs \
151 $(foreach x
,$(call qstrip
,$(BR2_PACKAGE_FFMPEG_BSFS
)),--enable-bsfs
=$(x
))
154 ifneq ($(call qstrip
,$(BR2_PACKAGE_FFMPEG_PROTOCOLS
)),all)
155 FFMPEG_CONF_OPTS
+= --disable-protocols \
156 $(foreach x
,$(call qstrip
,$(BR2_PACKAGE_FFMPEG_PROTOCOLS
)),--enable-protocol
=$(x
))
159 ifneq ($(call qstrip
,$(BR2_PACKAGE_FFMPEG_FILTERS
)),all)
160 FFMPEG_CONF_OPTS
+= --disable-filters \
161 $(foreach x
,$(call qstrip
,$(BR2_PACKAGE_FFMPEG_FILTERS
)),--enable-filter
=$(x
))
164 ifeq ($(BR2_PACKAGE_FFMPEG_INDEVS
),y
)
165 FFMPEG_CONF_OPTS
+= --enable-indevs
167 FFMPEG_CONF_OPTS
+= --disable-indevs
170 ifeq ($(BR2_PACKAGE_FFMPEG_OUTDEVS
),y
)
171 FFMPEG_CONF_OPTS
+= --enable-outdevs
173 FFMPEG_CONF_OPTS
+= --disable-outdevs
176 ifeq ($(BR2_TOOLCHAIN_HAS_THREADS
),y
)
177 FFMPEG_CONF_OPTS
+= --enable-pthreads
179 FFMPEG_CONF_OPTS
+= --disable-pthreads
182 ifeq ($(BR2_PACKAGE_ZLIB
),y
)
183 FFMPEG_CONF_OPTS
+= --enable-zlib
184 FFMPEG_DEPENDENCIES
+= zlib
186 FFMPEG_CONF_OPTS
+= --disable-zlib
189 ifeq ($(BR2_PACKAGE_BZIP2
),y
)
190 FFMPEG_CONF_OPTS
+= --enable-bzlib
191 FFMPEG_DEPENDENCIES
+= bzip2
193 FFMPEG_CONF_OPTS
+= --disable-bzlib
196 ifeq ($(BR2_PACKAGE_FDK_AAC
)$(BR2_PACKAGE_FFMPEG_NONFREE
),yy
)
197 FFMPEG_CONF_OPTS
+= --enable-libfdk-aac
198 FFMPEG_DEPENDENCIES
+= fdk-aac
200 FFMPEG_CONF_OPTS
+= --disable-libfdk-aac
203 ifeq ($(BR2_PACKAGE_GNUTLS
),y
)
204 FFMPEG_CONF_OPTS
+= --enable-gnutls
--disable-openssl
205 FFMPEG_DEPENDENCIES
+= gnutls
207 FFMPEG_CONF_OPTS
+= --disable-gnutls
208 ifeq ($(BR2_PACKAGE_OPENSSL
),y
)
209 # openssl isn't license compatible with GPL
210 ifeq ($(BR2_PACKAGE_FFMPEG_GPL
)x
$(BR2_PACKAGE_FFMPEG_NONFREE
),yx
)
211 FFMPEG_CONF_OPTS
+= --disable-openssl
213 FFMPEG_CONF_OPTS
+= --enable-openssl
214 FFMPEG_DEPENDENCIES
+= openssl
217 FFMPEG_CONF_OPTS
+= --disable-openssl
221 ifeq ($(BR2_PACKAGE_LIBDCADEC
),y
)
222 FFMPEG_CONF_OPTS
+= --enable-libdcadec
223 FFMPEG_DEPENDENCIES
+= libdcadec
225 FFMPEG_CONF_OPTS
+= --disable-libdcadec
228 ifeq ($(BR2_PACKAGE_LIBOPENH264
),y
)
229 FFMPEG_CONF_OPTS
+= --enable-libopenh264
230 FFMPEG_DEPENDENCIES
+= libopenh264
232 FFMPEG_CONF_OPTS
+= --disable-libopenh264
235 ifeq ($(BR2_PACKAGE_LIBVORBIS
),y
)
236 FFMPEG_DEPENDENCIES
+= libvorbis
237 FFMPEG_CONF_OPTS
+= \
240 --enable-encoder
=libvorbis
243 ifeq ($(BR2_PACKAGE_LIBVA
),y
)
244 FFMPEG_CONF_OPTS
+= --enable-vaapi
245 FFMPEG_DEPENDENCIES
+= libva
247 FFMPEG_CONF_OPTS
+= --disable-vaapi
250 ifeq ($(BR2_PACKAGE_OPUS
),y
)
251 FFMPEG_CONF_OPTS
+= --enable-libopus
252 FFMPEG_DEPENDENCIES
+= opus
254 FFMPEG_CONF_OPTS
+= --disable-libopus
257 ifeq ($(BR2_PACKAGE_LIBVPX
),y
)
258 FFMPEG_CONF_OPTS
+= --enable-libvpx
259 FFMPEG_DEPENDENCIES
+= libvpx
261 FFMPEG_CONF_OPTS
+= --disable-libvpx
264 ifeq ($(BR2_PACKAGE_LIBASS
),y
)
265 FFMPEG_CONF_OPTS
+= --enable-libass
266 FFMPEG_DEPENDENCIES
+= libass
268 FFMPEG_CONF_OPTS
+= --disable-libass
271 ifeq ($(BR2_PACKAGE_LIBBLURAY
),y
)
272 FFMPEG_CONF_OPTS
+= --enable-libbluray
273 FFMPEG_DEPENDENCIES
+= libbluray
275 FFMPEG_CONF_OPTS
+= --disable-libbluray
278 ifeq ($(BR2_PACKAGE_RTMPDUMP
),y
)
279 FFMPEG_CONF_OPTS
+= --enable-librtmp
280 FFMPEG_DEPENDENCIES
+= rtmpdump
282 FFMPEG_CONF_OPTS
+= --disable-librtmp
285 ifeq ($(BR2_PACKAGE_LAME
),y
)
286 FFMPEG_CONF_OPTS
+= --enable-libmp3lame
287 FFMPEG_DEPENDENCIES
+= lame
289 FFMPEG_CONF_OPTS
+= --disable-libmp3lame
292 ifeq ($(BR2_PACKAGE_LIBMODPLUG
),y
)
293 FFMPEG_CONF_OPTS
+= --enable-libmodplug
294 FFMPEG_DEPENDENCIES
+= libmodplug
296 FFMPEG_CONF_OPTS
+= --disable-libmodplug
299 ifeq ($(BR2_PACKAGE_SPEEX
),y
)
300 FFMPEG_CONF_OPTS
+= --enable-libspeex
301 FFMPEG_DEPENDENCIES
+= speex
303 FFMPEG_CONF_OPTS
+= --disable-libspeex
306 ifeq ($(BR2_PACKAGE_LIBTHEORA
),y
)
307 FFMPEG_CONF_OPTS
+= --enable-libtheora
308 FFMPEG_DEPENDENCIES
+= libtheora
310 FFMPEG_CONF_OPTS
+= --disable-libtheora
313 ifeq ($(BR2_PACKAGE_WAVPACK
),y
)
314 FFMPEG_CONF_OPTS
+= --enable-libwavpack
315 FFMPEG_DEPENDENCIES
+= wavpack
317 FFMPEG_CONF_OPTS
+= --disable-libwavpack
320 # ffmpeg freetype support require fenv.h which is only
321 # available/working on glibc.
322 # The microblaze variant doesn't provide the needed exceptions
323 ifeq ($(BR2_PACKAGE_FREETYPE
)$(BR2_TOOLCHAIN_USES_GLIBC
)x
$(BR2_microblaze
),yyx
)
324 FFMPEG_CONF_OPTS
+= --enable-libfreetype
325 FFMPEG_DEPENDENCIES
+= freetype
327 FFMPEG_CONF_OPTS
+= --disable-libfreetype
330 ifeq ($(BR2_PACKAGE_FONTCONFIG
),y
)
331 FFMPEG_CONF_OPTS
+= --enable-fontconfig
332 FFMPEG_DEPENDENCIES
+= fontconfig
334 FFMPEG_CONF_OPTS
+= --disable-fontconfig
337 ifeq ($(BR2_PACKAGE_X264
)$(BR2_PACKAGE_FFMPEG_GPL
),yy
)
338 FFMPEG_CONF_OPTS
+= --enable-libx264
339 FFMPEG_DEPENDENCIES
+= x264
341 FFMPEG_CONF_OPTS
+= --disable-libx264
344 ifeq ($(BR2_PACKAGE_X265
)$(BR2_PACKAGE_FFMPEG_GPL
),yy
)
345 FFMPEG_CONF_OPTS
+= --enable-libx265
346 FFMPEG_DEPENDENCIES
+= x265
348 FFMPEG_CONF_OPTS
+= --disable-libx265
351 ifeq ($(BR2_X86_CPU_HAS_MMX
),y
)
352 FFMPEG_CONF_OPTS
+= --enable-yasm
353 FFMPEG_DEPENDENCIES
+= host-yasm
355 ifeq ($(BR2_x86_i586
),y
)
356 # Needed to work around a bug with gcc 5.x:
357 # error: 'asm' operand has impossible constraints
358 FFMPEG_CONF_OPTS
+= --disable-inline-asm
360 FFMPEG_CONF_OPTS
+= --disable-yasm
361 FFMPEG_CONF_OPTS
+= --disable-mmx
364 ifeq ($(BR2_X86_CPU_HAS_SSE
),y
)
365 FFMPEG_CONF_OPTS
+= --enable-sse
367 FFMPEG_CONF_OPTS
+= --disable-sse
370 ifeq ($(BR2_X86_CPU_HAS_SSE2
),y
)
371 FFMPEG_CONF_OPTS
+= --enable-sse2
373 FFMPEG_CONF_OPTS
+= --disable-sse2
376 ifeq ($(BR2_X86_CPU_HAS_SSE3
),y
)
377 FFMPEG_CONF_OPTS
+= --enable-sse3
379 FFMPEG_CONF_OPTS
+= --disable-sse3
382 ifeq ($(BR2_X86_CPU_HAS_SSSE3
),y
)
383 FFMPEG_CONF_OPTS
+= --enable-ssse3
385 FFMPEG_CONF_OPTS
+= --disable-ssse3
388 ifeq ($(BR2_X86_CPU_HAS_SSE4
),y
)
389 FFMPEG_CONF_OPTS
+= --enable-sse4
391 FFMPEG_CONF_OPTS
+= --disable-sse4
394 ifeq ($(BR2_X86_CPU_HAS_SSE42
),y
)
395 FFMPEG_CONF_OPTS
+= --enable-sse42
397 FFMPEG_CONF_OPTS
+= --disable-sse42
400 ifeq ($(BR2_X86_CPU_HAS_AVX
),y
)
401 FFMPEG_CONF_OPTS
+= --enable-avx
403 FFMPEG_CONF_OPTS
+= --disable-avx
406 ifeq ($(BR2_X86_CPU_HAS_AVX2
),y
)
407 FFMPEG_CONF_OPTS
+= --enable-avx2
409 FFMPEG_CONF_OPTS
+= --disable-avx2
412 # Explicitly disable everything that doesn't match for ARM
413 # FFMPEG "autodetects" by compiling an extended instruction via AS
414 # This works on compilers that aren't built for generic by default
415 ifeq ($(BR2_ARM_CPU_ARMV4
),y
)
416 FFMPEG_CONF_OPTS
+= --disable-armv5te
418 ifeq ($(BR2_ARM_CPU_ARMV6
)$(BR2_ARM_CPU_ARMV7A
),y
)
419 FFMPEG_CONF_OPTS
+= --enable-armv6
421 FFMPEG_CONF_OPTS
+= --disable-armv6
--disable-armv6t2
423 ifeq ($(BR2_ARM_CPU_HAS_VFPV2
),y
)
424 FFMPEG_CONF_OPTS
+= --enable-vfp
426 FFMPEG_CONF_OPTS
+= --disable-vfp
428 ifeq ($(BR2_ARM_CPU_HAS_NEON
),y
)
429 FFMPEG_CONF_OPTS
+= --enable-neon
432 ifeq ($(BR2_MIPS_SOFT_FLOAT
),y
)
433 FFMPEG_CONF_OPTS
+= \
436 FFMPEG_CONF_OPTS
+= \
440 ifeq ($(BR2_mips_32r2
),y
)
441 FFMPEG_CONF_OPTS
+= \
444 FFMPEG_CONF_OPTS
+= \
448 ifeq ($(BR2_POWERPC_CPU_HAS_ALTIVEC
),y
)
449 FFMPEG_CONF_OPTS
+= --enable-altivec
451 FFMPEG_CONF_OPTS
+= --disable-altivec
454 ifeq ($(BR2_STATIC_LIBS
),)
455 FFMPEG_CONF_OPTS
+= --enable-pic
457 FFMPEG_CONF_OPTS
+= --disable-pic
460 ifneq ($(call qstrip
,$(BR2_GCC_TARGET_CPU
)),)
461 FFMPEG_CONF_OPTS
+= --cpu
=$(BR2_GCC_TARGET_CPU
)
462 else ifneq ($(call qstrip
,$(BR2_GCC_TARGET_ARCH
)),)
463 FFMPEG_CONF_OPTS
+= --cpu
=$(BR2_GCC_TARGET_ARCH
)
466 FFMPEG_CONF_OPTS
+= $(call qstrip
,$(BR2_PACKAGE_FFMPEG_EXTRACONF
))
468 # Override FFMPEG_CONFIGURE_CMDS: FFmpeg does not support --target and others
469 define FFMPEG_CONFIGURE_CMDS
470 (cd
$(FFMPEG_SRCDIR
) && rm -rf config.cache
&& \
471 $(TARGET_CONFIGURE_OPTS
) \
472 $(TARGET_CONFIGURE_ARGS
) \
475 --enable-cross-compile \
476 --cross-prefix
=$(TARGET_CROSS
) \
477 --sysroot
=$(STAGING_DIR
) \
478 --host-cc
="$(HOSTCC)" \
480 --target-os
="linux" \
481 --disable-stripping \
482 --pkg-config
="$(PKG_CONFIG_HOST_BINARY)" \
483 $(SHARED_STATIC_LIBS_OPTS
) \
484 $(FFMPEG_CONF_OPTS
) \
488 $(eval
$(autotools-package
))