You must avoid #import or #include of AVFoundation and ffmpeg header files in the same source file.
Note that AVFoundation (well, the header files) are Objective-C, whil ffmpeg is pure C. That means your source files are naturally separated. In general, you would #include ffmpeg header files in C source, and #import AVFoundation in Obj-C source.
The only exception is where your Obj-C makes a top-level call into ffmpeg. In that case, you will need to #include at least one ffmpeg header into Obj-C source. You can try:
— Limit what you #include, so that header files don't drag the ffmpeg AVMediaType declartion into Obj-C.
— Split your Obj-C into separate files, one that #includes ffmpeg, and the other that #includes AVFoundation.
— Write a wrapper function around some of the main ffmpeg functions, so that its use of AVMediaType is "hidden" inside.
— If you're compiling ffmpeg from source, you can fiddle with its source by using a #define internall to change its AVMediaType into a different type name. (This may or may not be easy to do, depending on how well you know the C language.)