Since mp4 is a container file format it can store audio as well as video files. What i am struggling to find out is its true media type. (Whether its a audio or video) Could this be done in IOS (objective c) ?
AVAsset *asset = [AVAsset assetWithURL:<URL to mp4>];
BOOL hasVideo = [asset tracksWithMediaType:AVMediaTypeVideo].count > 0;
BOOL hasAudio = [asset tracksWithMediaType:AVMediaTypeAudio].count > 0;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With