Вопрос

I'm working on streaming live video to ipad/iphone using apple's http live streaming. One important step of this is segmenting transport stream to several ts segments along with a playlist. According to apple's document, the recommanded ts segment duration is 10 seconds. However, longer duration always mean more latency, so I'm trying to decrease this duration to 2 or even 1 second.

Apple document also requires that the sementation should be done between keyframe boundaries, which means each ts segment should start with keyframe, so that it is independently playable. Here comes the conflicting part, it's almost impossible and also wasted for a transport stream to have keyframe every one or two seconds. So my question is, will http live streaming still work if the ts segment doesn't start with keyframe?

Это было полезно?

Решение

It's extremely easy for a video stream to have a keyframe every one or two seconds. Broadcast television usually has a keyframe every half second, for example. The configuration parameter of the encoder will be called something like the "GOP" (group of pictures) size or keyframe interval.

The coding efficiency is reduced by having more frequent keyframes (it takes more bytes to achieve the same quality), but it does improve the performance of seeking.

To answer your question directly: No. HLS will not work properly if the ts segments don't start with keyframes. This is for two reasons.

  1. It must be possible to seek to any segment and have valid data that can immediately be decoded.

  2. It must be possible to switch between the different bitrates at any segment boundary. There can be no reference to different streams because the cached data would be invalid.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top