figure out the file size of a m3u8 url referenced video

淺唱寂寞╮ 提交于 2019-12-12 06:38:26

问题


If a m3u8 url references to a streming, there is no video size, however , If the m3u8 url references to a video, any way to figure out the video file size ?

I don' t want adding up all the http content-length header of each video segment because it is a bit tedious.

I provide this m3u8 url as an example usage.


回答1:


The duration of a particular video stream within a M3U8 manifest file is not mandatory, but if a given video stream will typically have this information in the header of its own container.

For example, if the stream is a MP4 stream then you can get the duration from the header 'Moov" atom once it is read in at the start, rather than having to read each segment and add up its content length.

Its worth noting that for MP4 in particular you need to have the Moov atom at the start of the file - most MP4 videos that have been prepared for streaming will have had this done.



来源:https://stackoverflow.com/questions/41799396/figure-out-the-file-size-of-a-m3u8-url-referenced-video

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!