由于 mp4 是一种容器文件格式,它可以存储音频和视频文件。我正在努力寻找的是它真正的媒体类型。 (无论是音频还是视频)这可以在 IOS 中完成( objective-c )吗?
最佳答案
AVAsset *asset = [AVAsset assetWithURL:<URL to mp4>];
BOOL hasVideo = [asset tracksWithMediaType:AVMediaTypeVideo].count > 0;
BOOL hasAudio = [asset tracksWithMediaType:AVMediaTypeAudio].count > 0;
关于ios - 在objective C中判断mp4是音频还是视频,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19654454/