找出一个m3u8 url引用视频的文件大小 [英] figure out the file size of a m3u8 url referenced video

查看:1269
本文介绍了找出一个m3u8 url引用视频的文件大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果一个m3u8 url引用了一个streming,那么没有视频大小,但是,如果m3u8 url引用了一个视频,可以用任何方式找出视频文件的大小?

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 ?

我不想加入每个视频段的所有http 内容长度标题,因为它是有点乏味。

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

我提供了这个m3u8网址作为示例使用。

I provide this m3u8 url as an example usage.

推荐答案

M3U8清单文件中特定视频流的持续时间为不是强制性的,但是如果给定的视频流通常会在其自己的容器的标题中具有此信息。

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.

例如,如果流是MP4流,则可以从头开始读取头部Moov原子的持续时间,而不必读取每个细分并加入其内容长度。

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.

它的价值注意到对于MP4,特别是您需要在文件开头有Moov原子 - 大多数已准备好流式传输的MP4视频都可以完成。

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.

这篇关于找出一个m3u8 url引用视频的文件大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆