3

所以使用ffmpeg

/usr/local/bin/ffmpeg -i track.m4a -vn -c:a aac -b:a 192k  -f segment -segment_list 93_jrf2niqb7n2s8pzjopkqvbbw1wmzz3foqrsa93bm.m3u8 -segment_time 120 -segment_format_options movflags=faststart  93_jrf2niqb7n2s8pzjopkqvbbw1wmzz3foqrsa93bm.%03d.m4a

创建播放列表文件的位置

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-ALLOW-CACHE:YES
#EXT-X-TARGETDURATION:121
#EXTINF:120.000726,
93_jrf2niqb7n2s8pzjopkqvbbw1wmzz3foqrsa93bm.000.m4a
#EXTINF:119.883175,
93_jrf2niqb7n2s8pzjopkqvbbw1wmzz3foqrsa93bm.001.m4a
#EXT-X-ENDLIST

然后使用 mediastreamvalidator 我得到以下输出,这让我相信存在我不知道如何修复的错误。我假设 ffmpeg 正在提升分段。

mediastreamvalidator http://**OMIT**/AMP/1/92_y7lu9u1qy5wsw2fqn61mankqof7lkuu5qvk7asv5.m3u8
mediastreamvalidator: Version 1.2(160525)

[/AMP/1/92_y7lu9u1qy5wsw2fqn61mankqof7lkuu5qvk7asv5.m3u8] Started root playlist download
[/AMP/1/92_y7lu9u1qy5wsw2fqn61mankqof7lkuu5qvk7asv5.m3u8] Started media playlist download
Error injecting segment data
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
Can't deal with multiple sample timings per sample buffer
[/AMP/1/92_y7lu9u1qy5wsw2fqn61mankqof7lkuu5qvk7asv5.m3u8] All media files delivered and have end tag, stopping

--------------------------------------------------------------------------------
http://**OMIT**/AMP/1/92_y7lu9u1qy5wsw2fqn61mankqof7lkuu5qvk7asv5.m3u8
--------------------------------------------------------------------------------
Processed 1 out of 2 segments
Average segment duration: 119.941950
Total segment bitrates (all discontinuities): average: 130.88 kb/s, max: 131.25 kb/s


Discontinuity: sequence: 0, parsed segment count: 1 of 2, duration: 239.884 sec, average: 130.88 kb/s, max: 131.25 kb/s
Track ID: 1
Audio Codec: AAC-LC
Audio sample rate: 44100 Hz
Audio channel layout: Stereo (L R)

所以,我的问题是什么是“错误注入段数据”和“无法处理每个样本缓冲区的多个样本计时”,为什么段搞砸了?

4

1 回答 1

0

我还在 mediaStreamValidator 中遇到了这两个错误并设法修复了它们

1)“无法处理每个样本缓冲区的多个样本计时” - 当样本持续时间设置为“每个样本”时,fMP4 块会发生这种情况。mediaStreamValidator 需要使用默认的采样持续时间,对于块中的所有轨道样本都相等,在轨道相关的原子中有一个特殊的标志

2)“错误注入段数据” - 表示验证器无法下载块进行分析。不是因为网络问题,而是其他一些原因。

在我的例子中,m3u8 包含 #EXT-X-BYTERANGE 和 #EXT-X-MAP:URI...BYTERANGE 标签。我在本地使用 SimpleHTTPServer 进行测试(python oneliner,在 MacOS 中很流行)。结果证明 SimpleHTTPServer 不能很好地处理范围请求,在没有适当范围的情况下提供此类文件。所以验证器得到了完整的块而不是字节范围的数据。

切换到 node.js http-server 而不是 SimpleHTTPServer 后,错误立即消失

于 2018-06-14T10:33:06.993 回答