Wowza Community

Is there a way to set the HLS minimum chunk size?

I have found that some players seem to have issues with very short chunks, which Wowza frequently produces. For example, if a stream is 100.2 seconds long, wowza will produce 10 10s chunks and one 0.2s chunk. I would much prefer it to produce 11 9.11s chunks instead, or even 9 10s chunks and 2 5.1s chunks, the 0.2s chunk can really mess up the buffering code in the players…

Hi @Greg_Nisbet yes you can adjust this manually. Here is the doc that shows you where you would do that:

https://www.wowza.com/docs/how-to-configure-apple-hls-packetization-cupertinostreaming


This is very important though:

Note: Chunks must start on a keyframe, so use a keyframe interval that’s a factor(multiplier) of the cupertinoChunkDurationTarget setting.

That shows the setting for the cupertinoChunkDurationTarget, but nothing about setting the minimum chunk size. To deal with the key frame alignment issue, it seems like having it join a short chunk to the preceding one would be the only viable solution.
The current setting only work if you have the ability to set the duration per song, based on the total song length, which really isn’t practical

Oh sorry, I thought it was explained in that particular doc, I see it is not. Apologies.

Tech support said their suggestion would probably be to set the chunk duration lower than our default 10 seconds and see if at 4 seconds or even 2 seconds you have better results. There would be less difference in chunk sizes that way. We have no way to append the overflow to the last chunk at this time but they believe if you do as described above and you create a keyframe on an even number, you might see better playback.

Also, we don’t know when the stream will end, so we create chunks in real-time. So if we close a chunk and start writing the next one, it assumes that the live stream is continuing on. If we see the source stream close connection, it would be hard to go back and append this to the already created chunk. We’d have to stuff the chuck with blank data if we used a min-chunk size.

We might be able to create a custom module to buffer the stream data and ensure there’s enough for a full chunk before writing but that would cause some additional delay.

Give the first suggestion a try and let us know how it goes!

One more thing!

It all comes down to where the key frames are. We only start chunks at keyframes. It sounds like your file has a keyframe right at the very end which would mess things up. Try a keyframe of 2 if you haven’t yet.

Feel free to send a support ticket to get 1:1 guidance from an engineer.