0

is there any class in iOS which returns encoder/ decoder capabilities just like Android MediaCodec/ MediaCodecList.(https://developer.android.com/reference/android/media/MediaCodec)

I need to get the fps/profile/level and width /height supported on each profile of h264 and hevc codec.

I have found it related to AvCaptureSession, but this may not be correct since we need to support AvPlayer only (and camera is not in the part of the flow.)

  • 1
    Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Sep 09 '22 at 01:02

1 Answers1

0

AVFoundation has very limited supported formats. Refer to this StackOverflow

So If somebody wants to query for the codec info, I recommend him/she use ffmpeg. To be specific, it's ffmpeg-kit. Check here for all API documentation.

I wrote you a sample about how to use it in iOS and query for codec info(or anything you want). Please check it out: showcase

    let mediaInfoSession = FFprobeKit.getMediaInformation(kSampleFilePath)
    let mediaInfo = mediaInfoSession?.getMediaInformation()
    let props = mediaInfo?.getAllProperties()
    let duration = mediaInfo?.getDuration()
    let bitRate = mediaInfo?.getBitrate()
    ...

enter image description here

Feel free to contact me.

kakaiikaka
  • 3,530
  • 13
  • 19