我想流式传输通常长达 10 小时的公开会议视频。用户通常会从视频中间的某个时间点开始并经常跳来跳去。
MP4 容器中的 H.264 似乎是当前编码流视频的最佳选择(对吗?)。但这些都是大文件——一个文件大约 1.3GB——文件开头的元数据(MOOV atom)本身大约是 40MB。如果我理解正确,客户需要先下载完整的元数据,然后才能在文件的其余部分中查找。显然,在开始流式传输之前必须下载 40MB 是不可接受的。
(我的流媒体测试使用 VLC 和 Chrome 中的 HTML5 标签。)
我正在使用 avconv 对文件进行编码,除了告诉它要使用哪些编码器(x264 和 libfaac)之外,我目前没有提供其他设置。然后我使用 qt-faststart 将元数据移动到文件的开头。
有没有办法让 MOOV 原子变小?
如果没有,是否有其他策略可以使用(例如,将长视频分成几个文件,这是经常做的事情?对于寻找一整天视频的用户而言,这似乎是一种真正的痛苦)?
还是我应该使用不同的编解码器或容器?
谢谢!
这是来自 AtomicParsley 的文件头结构的细分:
Atom ftyp @ 0 of size: 32, ends @ 32
Atom moov @ 32 of size: 40157673, ends @ 40157705
Atom mvhd @ 40 of size: 108, ends @ 148
Atom iods @ 148 of size: 24, ends @ 172
Atom trak @ 172 of size: 20156304, ends @ 20156476
Atom tkhd @ 180 of size: 92, ends @ 272
Atom edts @ 272 of size: 36, ends @ 308
Atom elst @ 280 of size: 28, ends @ 308
Atom mdia @ 308 of size: 20156168, ends @ 20156476
Atom mdhd @ 316 of size: 32, ends @ 348
Atom hdlr @ 348 of size: 45, ends @ 393
Atom minf @ 393 of size: 20156083, ends @ 20156476
Atom vmhd @ 401 of size: 20, ends @ 421
Atom dinf @ 421 of size: 36, ends @ 457
Atom dref @ 429 of size: 28, ends @ 457
Atom stbl @ 457 of size: 20156019, ends @ 20156476
Atom stsd @ 465 of size: 147, ends @ 612
Atom avc1 @ 481 of size: 131, ends @ 612
Atom avcC @ 567 of size: 45, ends @ 612
Atom stts @ 612 of size: 6115608, ends @ 6116220
Atom stss @ 6116220 of size: 16960, ends @ 6133180
Atom ctts @ 6133180 of size: 5683824, ends @ 11817004
Atom stsc @ 11817004 of size: 28, ends @ 11817032
Atom stsz @ 11817032 of size: 4169724, ends @ 15986756
Atom stco @ 15986756 of size: 4169720, ends @ 20156476
Atom trak @ 20156476 of size: 20001133, ends @ 40157609
Atom tkhd @ 20156484 of size: 92, ends @ 20156576
Atom mdia @ 20156576 of size: 20001033, ends @ 40157609
Atom mdhd @ 20156584 of size: 32, ends @ 20156616
Atom hdlr @ 20156616 of size: 45, ends @ 20156661
Atom minf @ 20156661 of size: 20000948, ends @ 40157609
Atom smhd @ 20156669 of size: 16, ends @ 20156685
Atom dinf @ 20156685 of size: 36, ends @ 20156721
Atom dref @ 20156693 of size: 28, ends @ 20156721
Atom stbl @ 20156721 of size: 20000888, ends @ 40157609
Atom stsd @ 20156729 of size: 96, ends @ 20156825
Atom mp4a @ 20156745 of size: 80, ends @ 20156825
Atom esds @ 20156781 of size: 44, ends @ 20156825
Atom stts @ 20156825 of size: 9348168, ends @ 29504993
Atom stsc @ 29504993 of size: 28, ends @ 29505021
Atom stsz @ 29505021 of size: 5326296, ends @ 34831317
Atom stco @ 34831317 of size: 5326292, ends @ 40157609
Atom udta @ 40157609 of size: 96, ends @ 40157705
Atom meta @ 40157617 of size: 88, ends @ 40157705
Atom hdlr @ 40157629 of size: 33, ends @ 40157662
Atom ilst @ 40157662 of size: 43, ends @ 40157705
Atom ©too @ 40157670 of size: 35, ends @ 40157705
Atom data @ 40157678 of size: 27, ends @ 40157705
Atom free @ 40157705 of size: 8, ends @ 40157713
Atom mdat @ 40157713 of size: 1320096566, ends @ 1360254279