# Live Stream Stuttering over HLS

**URL:** <https://community.wowza.com/t/live-stream-stuttering-over-hls/43626>\
**Category:** Wowza Streaming Engine\
**Created:** [June 23, 2015, 12:46pm UTC](https://community.wowza.com/t/live-stream-stuttering-over-hls/43626 "2015-06-23T12:46:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![James\_McHugh](https://avatars.discourse-cdn.com/v4/letter/j/fbc32d/32.png) [@James\_McHugh](https://community.wowza.com/u/James_McHugh)\
**Post date:** [June 23, 2015, 12:46pm UTC](https://community.wowza.com/t/live-stream-stuttering-over-hls/43626/1 "2015-06-23T12:46:11Z")

</div>

Hi,

I am encoding video on the fly using JavaCV & its JNDI binding for ffmpeg. I’m using the following settings:

```auto
FFmpegFrameRecorder fFmpegFrameRecorder = new FFmpegFrameRecorder("rtmp://localhost:1935/live/stream1", 400, 384); //rtmp destination, width and height
recorder.setVideoCodec(avcodec.AV_CODEC_ID_H264);
recorder.setPixelFormat(avutil.AV_PIX_FMT_YUV420P);
recorder.setFormat("flv");
recorder.setFrameRate(30);
recorder.setVideoBitrate(250000);
recorder.setVideoOption("x264opts, "keyint=30:min-keyint=30:no-scenecut"));
recorder.setVideoOption("preset", "medium");
recorder.setGopSize(30 * 2); //60 frames

```

On Wowza I have the following settings for “Cupertino Streaming Packetizer” properties:

```auto
cupertinoChunkDurationTarget=1000
cupertinoMaxChunkCount=3

```

I want to keep these low because I’m trying to keep client’s video roughly in sync with one another.

When I view the stream over HLS it seems to stutter every second, or more precisely every “cupertinoChunkDurationTarget” milliseconds. I have tried playing around with various encoder and Wowza settings but can’t seem to get rid of it. Any suggestions?

---

<div class="post-metadata">

**Author:** ![sal\_jefferson](https://avatars.discourse-cdn.com/v4/letter/s/6de8d8/32.png) [@sal\_jefferson](https://community.wowza.com/u/sal_jefferson)\
**Post date:** [June 23, 2015, 7:51am UTC](https://community.wowza.com/t/live-stream-stuttering-over-hls/43626/2 "2015-06-23T07:51:16Z")

</div>

Hello there.

Chunks must start on a key frame. So it is best to use a key frame interval that is factor of the **cupertinoChunkDurationTarget** setting. Try 2 second key frame frequency and cupertinoChunkDurationTarget “2000” (2 seconds). You might also try 24 fps and see if that makes a difference.

If you have not already seen this guide, please take a look for reference:

[How to configure Apple HLS packetization (cupertinostreaming)](https://www.wowza.com/docs/how-to-configure-apple-hls-packetization-cupertinostreaming%28cupertinostreaming%29)

HLS requires H264 video and AAC audio is suggested over mp3. With a profile of “baseline” to be safe.

If you use mp3 then 128kbs, 44100hz stereo.

I would double check what the stream is using for these settings as well. Again, for reference please take a look at this guide:

[How to use FFmpeg with Media Wowza Server (MPEG-TS)](https://www.wowza.com/docs/how-to-use-ffmpeg-with-wowza-media-server-mpeg-ts%28MPEG-TS%29)

Regards,

Salvadore

---

<div class="post-metadata">

**Author:** ![Daren\_Johnson](https://avatars.discourse-cdn.com/v4/letter/d/ee59a6/32.png) [@Daren\_Johnson](https://community.wowza.com/u/Daren_Johnson)\
**Post date:** [June 23, 2015, 11:36pm UTC](https://community.wowza.com/t/live-stream-stuttering-over-hls/43626/3 "2015-06-23T23:36:55Z")

</div>

Hi,

This is being handled in ticket #132227

Daren

---

<div class="post-metadata">

**Author:** ![sal\_jefferson](https://avatars.discourse-cdn.com/v4/letter/s/6de8d8/32.png) [@sal\_jefferson](https://community.wowza.com/u/sal_jefferson)\
**Post date:** [June 23, 2015, 9:36am UTC](https://community.wowza.com/t/live-stream-stuttering-over-hls/43626/4 "2015-06-23T09:36:44Z")

</div>

Can you please open a ticket for this issue. Please send a zipped copy of your /conf and /logs folders to support@wowza.com. Also include a link to this thread as reference.

Thank you.

Salvadore

---

<div class="post-metadata">

**Author:** ![James\_McHugh](https://avatars.discourse-cdn.com/v4/letter/j/fbc32d/32.png) [@James\_McHugh](https://community.wowza.com/u/James_McHugh)\
**Post date:** [June 23, 2015, 2:07pm UTC](https://community.wowza.com/t/live-stream-stuttering-over-hls/43626/5 "2015-06-23T14:07:39Z")

</div>

> Chunks must start on a key frame. So it is best to use a key frame interval that is factor of the **cupertinoChunkDurationTarget** setting. Try 2 second key frame frequency and cupertinoChunkDurationTarget “2000” (2 seconds). You might also try 24 fps and see if that makes a difference.
> 
> I tried this but the only thing that changes is the stutter occurs every 2 seconds instead of every 1 second. By stutter, it kind of looks like it either skips a frame forward/backward so the video doesn’t appear smooth. But no pausing in the actual stream.
> 
> I’ll read those other articles but they are for different formats, which I don’t have the luxury to change at the moment.
