简体   繁体   中英

IOS - bit rate file video hls

I get bit rate file video hls from server, using MPMoviePlayer, MPMovieAccessLogEvent, I calculate by:

double bitrate = 8 * event.observedBitrate /1024;
NLog(@"%f",bitrate) -> 19697.920189

This is bitrate from .m3u8 play media downloaded, I think, but I don't know the number very big compare number of the file .m3u8 (in fact m3u8 have three bit rate "400kb, 800kb, 1.5mb")

Can guide me get bit rate right from .m3u8.

That is the observed bit-rate for downloading the media, and not the bit-rate of the media content. The documentation for observedBitrate has this to say:

The empirical throughput across all media downloaded. Measured in bits

There is a problem with your calculation.

8 * event.observedBitrate / 1024

because (event.observedBitrate / 1024) gets us the value in kilo-bits per second. If you want that to be in kilo-bytes per second, then you need to divide it again by 8 instead of multiplying by 8 . If the calculations were right, you will get 307.78 kilo-bytes per second instead which seems like a reasonable download speed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM