Wowza Streaming Engine + Cloudfront + nDVR

Hello,

I’m using WSE to stream via rtsp. All works fine since the stream received by my WSE instance is correctly received and transcoded in HLS as I need.

Since I need to make it accessible to a possibly very large number of viewers, I configured WSE as a live origin application associating it in a cloudfront instance.

In this case I encountered some strange behaviors that are difficult to manage since they are difficult to predict.

The first strange behavior is the fact that if I start to send the rtsp stream to WSE and I start to request the stream through cloudfront, if I try to access too early the “playlist.m3u8” file and I get a 404 error because the playlist isn’t ready yet, I can’t access the playlist from the same client for a certain amount of time (30 seconds or more sometimes). My guess is that subsequent requests to the same playlist are cached for a certain amount of time, so I can’t properly implement a mechanism to play the stream as soon as it became ready.

My question is: is there a proper way to configure both Wowza and Cloudfront to prevent this behavior? I found a tutorial on the internet that suggests to set on cloudfront a minimum TTL of 0 for 404 and 500 errors. Is it the proper way to do this?

I noticed a similar behavior in case I use nDVR with cloudfront. If I request the stream from cloudfront too early, sometimes I get a 404 error not on the “playlist.m3u8” but on the first chunk of the playlist (i.e access “chunklist_b1396000_DVR.m3u8” gives me a 404 error) and the x-cache parameter in the response is

x-cache:Error from cloudfront

.

I guess the same as before, maybe I misconfigured my wowza or my cloudfront instances.

Is there a proper way to configure wowza?

Notice that if I request the stream without “?DVR” I never get a 404 error in requesting a chunck.

More in general. Is there exist a tutorial or a guide to deal with wowza + cloudfront cache?

I hope I have been clear.

Is a bit difficult situation to explain. Please ask me if something I wrote is not clear.

Thanks,

Simone

Hi,

Yes you can configure the TTL for 404 errors within Cloudfront just as you described, and some customers do do that to remove or reduce 404 responses.

You can find a number of articles on Cloudfront integration with Wowza here.

Regards,

Paul