iosffmpegavplayeravassetavurlasset

AVURLAsset tracks is empty, but video/audio is playable


I have video that lives here:

http://195.16.112.71/adaptive/66aebabb-2632-44fc-abf1-df29bca6b941.video/66aebabb-2632-44fc-abf1-df29bca6b941.m3u8

Ffmpeg says that this video has 5 tracks and it's correctly.

But if I use AVURLAsset with that link it says me that there isn't any tracks:

NSArray* const tracks = asset.tracks; // it's empty

I modified Apple's StichedStreamPlayer sample to reproduce this problem, it lies here: https://yadi.sk/d/hV3jfbx1Z9sfC

Simply click 'Load Movie', than the 'Play' button - movie plays perfectly, but if you check tracks variable in prepareToPlayAsset function you find it's empty. The question is: why it's empty if in reality the video has 5 tracks and how this video could be playing if no tracks exist, as AVURLAsset says?

Thanks for your help in advance!


Solution

  • If you are directly streaming the video then it won't have tracks. You can download the file and ask for the tracks of the video file asset.