python 视频流分析_HLS Analyzer:分析HTTP Live流(HLS)兼容视频点播和直播内容的工具...

HLS Analyzer是一个用于分析VOD和Live内容中HTTP Live流(HLS)的工具。它分析TS片段并提供有关内容的有用信息,包括流类型、轨道信息、时间信息和帧信息等。此工具可用于检测编码或播放质量问题。文章介绍了命令行工具的使用语法和示例,并展示了分析结果示例。
摘要由CSDN通过智能技术生成

HLS Analyzer

Tool for analyzing HTTP Live Streams (HLS) compatible with both VOD and Live content.

It analyzes TS segments of the stream and provide useful information about the content, pretty useful to catch encoding or playback quality issues:

HLS information. Type of the stream (live or vod), media sequence, type of encryption and number of segments.

Tracks information. Video and audio tracks information (codecs, profiles, resolution, sample rate, channels, etc)

Timing information (PTS and segment duration). Useful to check if bitrates and segments are properly aligned.

Frames information. Keyframe interval, frames sequence. Useful to check if every segment starts with a keyframe. Useful to ensure smooth bitrate switching.

Command line tool syntax

python hls-analyzer.py [-h] [-s SEGMENTS] [-l FRAME_INFO_LEN] Url

Url: Url of the stream to be analyzed

Optional arguments:

-s SEGMENTS Number of segments to be analyzed per playlist. By default, one segment per playlist is analyzed

-l FRAME_INFO_LEN Max length per track for frames information

-h, --help Show help message

Example of use

python hls-analyzer.py https://devimages.apple.com.edgekey.net/streaming/examples/bipbop_4x3/bipbop_4x3_variant.m3u8

Output:

Master playlist. List of variants:

Playlist: https://devimages.apple.com.edgekey.net/streaming/examples/bipbop_4x3/gear1/prog_index.m3u8, bw: 232370

Playlist: https://devimages.apple.com.edgekey.net/streaming/examples/bipbop_4x3/gear2/prog_index.m3u8, bw: 649879

***** Analyzing variant (232370) *****

** Generic information **

Version: 3

Media sequence: 0

Is Live: False

Encrypted: False

Number of segments: 181

Downloading https://devimages.apple.com.edgekey.net/streaming/examples/bipbop_4x3/gear1/fileSequence0.ts, Range: None

** Tracks and Media formats **

Track #0 - Type: video/avc, Format: Video (H.264) - Profile: Main, Level: 64, Resolution: 400x300, Encoded aspect ratio: 0/1, Display aspect ratio: 1

Track #1 - Type: audio/mp4a-latm, Format: Audio (AAC) - Sample Rate: 22050, Channels: 2

** Timing information **

Segment declared duration: 9.97667

Track #0 - Duration: 9.943333 s, First PTS: 10.0 s, Last PTS: 19.943333 s

Track #1 - Duration: 9.473739 s, First PTS: 9.904222 s, Last PTS: 19.377961 s

Duration difference (declared vs real): 0.502931 s (5.31%)

** Frames **

Track #0 - KF: 0.067, Frames: I-I-P-P-B-B-P-P-B-B-P-P-B-B-P-P-B-B-P-P-B-B-P-P-B-B-P-P-B-B-P-P-B-B-P-P-B-B-P-P-

Track #1 - KF: 0.046, Frames: I-I-I-I-I-I-I-I-I-I-I-I-I-I-I-I-I-I-I-I-I-I-I-I-I-I-I-I-I-I-I-I-I-I-I-I-I-I-I-I-

***** Analyzing variant (649879) *****

** Generic information **

Version: 3

Media sequence: 0

Is Live: False

Encrypted: False

Number of segments: 181

Downloading https://devimages.apple.com.edgekey.net/streaming/examples/bipbop_4x3/gear2/fileSequence0.ts, Range: None

** Tracks and Media formats **

Track #0 - Type: video/avc, Format: Video (H.264) - Profile: Main, Level: 64, Resolution: 640x480, Encoded aspect ratio: 0/1, Display aspect ratio: 1

Track #1 - Type: audio/mp4a-latm, Format: Audio (AAC) - Sample Rate: 22050, Channels: 2

** Timing information **

Segment declared duration: 9.97667

Track #0 - Duration: 9.943333 s, First PTS: 10.0 s, Last PTS: 19.943333 s

Track #1 - Duration: 9.473739 s, First PTS: 9.904222 s, Last PTS: 19.377961 s

Duration difference (declared vs real): 0.502931 s (5.31%)

** Frames **

Track #0 - KF: 0.067, Frames: I-I-I-I-I-P-P-P-P-P-B-B-B-B-B-P-P-P-P-P-B-B-B-B-B-P-P-P-P-P-B-B-B-B-B-P-P-P-P-P-

Track #1 - KF: 0.046, Frames: I-I-I-I-I-I-I-I-I-I-I-I-I-I-I-I-I-I-I-I-I-I-I-I-I-I-I-I-I-I-I-I-I-I-I-I-I-I-I-I-

Third party libraries

This project uses m3u8 library created by Globo.com: https://github.com/globocom/m3u8

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值