Avasset

AVAsset | AVAssetTrack

Intro

Syntax

Retrieve Media Metadata

Retrieving media metadata

Extract Media Codec information

apple dev | formatDescriptions

SO | retrieving codec iOS
Another SO

video size

SO | ios video size

import AVKit
import Foundation

extension AVAsset {
    func videoSize() async throws -> CGSize? {
        guard let track = try await loadTracks(withMediaType: .video).first else { return nil }
        let size = try await track.load(.naturalSize)
        return size
    }
}