ios 获取视频资源尺寸

获取视频资源

        AVURLAsset  *asset = [AVURLAsset assetWithURL:url];

        NSArray *array = asset.tracks;

        CGSize videoSize = CGSizeZero;

        for(AVAssetTrack  *track in array) 
        {

            if([track.mediaType isEqualToString:AVMediaTypeVideo]) 
            {
                  videoSize = track.naturalSize;
            }
        }


你可能感兴趣的:(ios 获取视频资源尺寸)