Wowza Community

Live Stream Stuttering over HLS

Hi,

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

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:

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?

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)

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)

Regards,

Salvadore

Hi,

This is being handled in ticket #132227

Daren

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

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.