Opened 2 months ago

Last modified 2 months ago

#6954 new defect

videotoolbox fails to build with MACOSX_DEPLOYMENT_TARGET=10.7

Reported by: rkitover Owned by:
Priority: normal Component: build system
Version: git-master Keywords: videotoolbox osx
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no


A lot of mac devs still target OS X 10.7 for their final builds, older versions of ffmpeg compile fine for this target, but with master I get:

libavcodec/videotoolbox.c:596:14: error: 'VTDecompressionSessionDecodeFrame' is only available on macOS 10.8 or newer [-Werror,-Wunguarded-availability]
    status = VTDecompressionSessionDecodeFrame(videotoolbox->session,
/System/Library/Frameworks/VideoToolbox.framework/Headers/VTDecompressionSession.h:181:1: note: 'VTDecompressionSessionDecodeFrame' has been explicitly marked
      partial here
libavcodec/videotoolbox.c:596:14: note: enclose 'VTDecompressionSessionDecodeFrame' in a __builtin_available check to silence this warning
    status = VTDecompressionSessionDecodeFrame(videotoolbox->session,

With --disable-videotoolbox everything compiles fine however.

I have no idea how many people care about videotoolbox support with a 10.7 target, just reporting this.

It may be good to check the target during the autodetection.

Change History (7)

comment:1 Changed 2 months ago by cehoyos

  • Component changed from ffmpeg to build system
  • Keywords mac removed
  • Priority changed from wish to normal
  • Type changed from enhancement to defect

Please provide your configure line

comment:2 Changed 2 months ago by rkitover

The configure command I used is:

./configure  '--disable-shared' '--enable-static' '--prefix=/usr' '--pkg-config-flags=--static' '--enable-nonfree' '--extra-version=tessus' '--enable-avisynth' '--enable-fontconfig' '--enable-gpl' '--enable-version3' '--enable-libass' '--enable-libbluray' '--enable-libfreetype' '--enable-libgsm' '--enable-libmodplug' '--enable-libmp3lame' '--enable-libopencore-amrnb' '--enable-libopencore-amrwb' '--enable-libopus' '--enable-libsnappy' '--enable-libsoxr' '--enable-libspeex' '--enable-libtheora' '--enable-libvidstab' '--enable-libvo-amrwbenc' '--enable-libvorbis' '--enable-libvpx' '--enable-libwavpack' '--enable-libx264' '--enable-libx265' '--enable-libxavs' '--enable-libxvid' '--enable-libzmq' '--enable-openssl' '--enable-lzma' '--extra-cflags=-DMODPLUG_STATIC -DZMQ_STATIC' '--extra-cxxflags=-DMODPLUG_STATIC -DZMQ_STATIC' '--extra-objcflags=-DMODPLUG_STATIC -DZMQ_STATIC' '--extra-ldflags=-framework CoreText'

Adding --disable-videotoolbox makes my build succeed.

comment:3 Changed 2 months ago by cehoyos

How does this configure line enforce building for 10.7?

comment:4 Changed 2 months ago by rkitover

For that the easiest way is to set the env var:


comment:5 Changed 2 months ago by cehoyos

When do you set it?
What happens if you explicit pass the required version to configure?

comment:6 Changed 2 months ago by rkitover

You set it in bash before you call configure and before you call make.

If you want to set it in configure, you can do it like this:

./configure --extra-cflags='-mmacosx-version-min=10.7' --extra-cxxflags='-mmacosx-version-min=10.7' --extra-objcflags='-mmacosx-version-min=10.7' --extra-ldflags='-mmacosx-version-min=10.7'

I haven't tried this yet but it should produce the same result.

Last edited 2 months ago by rkitover (previous) (diff)

comment:7 Changed 2 months ago by rkitover

Yup, just tried the configure command above, build produces the same errors.

Note: See TracTickets for help on using tickets.