Skip to content

MediaPackagev2 ForceEndpointErrorConfiguration does not work for Stale

0

We’re using the AWS Elemental stack (MediaConnect, MediaLive, MediaPackage v2, and CloudFront) to build and deliver our streams.

Recently, we noticed that the ForceEndpointErrorConfiguration > Stale Manifest feature in MediaPackage v2 seems to have stopped working.

When we stop a MediaLive channel, MediaPackage v2 continues to serve the last 60 seconds of the stream as VOD, inserting the #EXT-X-ENDLIST at the bottom of the HLS playlist. Essentially, instead of throwing a 404, the stream is serving a VOD. Doc Here

We haven’t changed any configurations, so we’re trying to understand why Stale Manifest isn’t working as expected. This behivor accours on all regions and channels we have.

Any guidance or suggestions would be greatly appreciated. Thank you!

aws mediapackagev2 get-origin-endpoint --channel-group-name us-east-2 --channel-name streamdev05 --origin-endpoint-name plain --query ForceEndpointErrorConfiguration
{
    "EndpointErrorConditions": [
        "STALE_MANIFEST",
        "INCOMPLETE_MANIFEST",
        "MISSING_DRM_KEY",
        "SLATE_INPUT"
    ]
}

Main Playlist:

curl https://mask.mediapackagev2.us-east-2.amazonaws.com/out/v1/us-east-2/streamdev05/plain/hls.m3u8
#EXTM3U
#EXT-X-VERSION:6
#EXT-X-INDEPENDENT-SEGMENTS
#EXT-X-MEDIA:LANGUAGE="eng",AUTOSELECT=YES,CHANNELS="2",TYPE=AUDIO,URI="hls__6.m3u8",GROUP-ID="audio_0",DEFAULT=NO,NAME="und"
#EXT-X-STREAM-INF:CODECS="mp4a.40.2,avc1.4D4028",AVERAGE-BANDWIDTH=9759999,RESOLUTION=1920x1080,VIDEO-RANGE=SDR,FRAME-RATE=29.97,BANDWIDTH=9759999,AUDIO="audio_0"
hls__1.m3u8

SubPlaylist:

curl https://mask.mediapackagev2.us-east-2.amazonaws.com/out/v1/us-east-2/streamdev05/plain/hls__1.m3u8
#EXTM3U
#EXT-X-VERSION:6
#EXT-X-INDEPENDENT-SEGMENTS
#EXT-X-TARGETDURATION:8
#EXT-X-MEDIA-SEQUENCE:434866021
#EXT-X-DISCONTINUITY-SEQUENCE:6
#EXT-X-MAP:URI="segment__1_434865886_init.mp4"
#EXTINF:4.004,
segment__1_434866021.mp4
#EXTINF:4.004,
.....
.....
#EXTINF:4.004,
segment__1_434866034.mp4
#EXT-X-DISCONTINUITY
#EXTINF:3.4701333,
segment__1_434866035.mp4
#EXT-X-ENDLIST
asked 8 months ago70 views
2 Answers
0
Accepted Answer

I have tested. It's working for me. When I stop EML channel with CMAF output MediaPackage starts to send 404 on playback endpoint where I enable stale manifest check. It was Dub region. Try to create another channel and see if it's working ok. If not I would suggest to open ticket in AWS support.

AWS
answered 8 months ago
AWS
EXPERT
reviewed 8 months ago
  • Thanks! we were using the CMAF ingestion url for the EML outputs because when we added it, the support for mediapackagev2 wasn't released in EML. I tested with a new channel with MediaPackage CMAF Output and it works!

0

The behavior you're experiencing with MediaPackage v2's ForceEndpointErrorConfiguration for Stale Manifests is likely due to how MediaLive is stopping the channel and how MediaPackage interprets this action.

When you manually stop a MediaLive channel, if both pipelines are active at the time of stopping, MediaLive includes an EXT-X-ENDLIST tag in the HLS manifest sent to MediaPackage. When MediaPackage receives this tag, it interprets the stream as complete and delivers a static, VOD manifest to downstream devices, rather than returning a 404 error.

This behavior is by design and is intended to provide a smooth viewing experience by allowing viewers to watch the last portion of the stream even after the live event has ended. MediaPackage considers the program complete when it receives the EXT-X-ENDLIST tag, and as a result, it delivers a VOD manifest instead of triggering the stale manifest error condition.

To achieve the desired behavior of returning a 404 error for stale manifests, you might need to adjust how you're stopping the MediaLive channel. If you stop the MediaLive channel in a way that doesn't send the EXT-X-ENDLIST tag (for example, by stopping one pipeline at a time), MediaPackage may be more likely to detect a stale manifest condition and return the 404 error as expected.

It's also worth noting that the stale manifest detection in MediaPackage is designed to handle scenarios where the encoder or network path has failed, rather than intentional stops of the MediaLive channel. The current behavior you're seeing might be considered the correct functioning from MediaPackage's perspective, as it's receiving a proper end-of-stream signal.

If you need different behavior for your specific use case, you might want to consider implementing additional logic at the CDN level or in your player to handle these scenarios. Alternatively, you could explore if there are ways to stop your MediaLive channel that don't result in sending the EXT-X-ENDLIST tag to MediaPackage.
Sources
Live and VOD manifest reference - AWS Elemental MediaPackage
Failure management - Streaming Media Lens

answered 8 months ago
  • I'm using SinglePipeline MediaLive Channels. We stop the MediaLive Channel using StopChannelCommand from JS AWS SDK or the Stop button in the MediaLive Console. For that test, we are not using cloudfront.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.