Create keyframe (I-frame) only playlists for Apple HLS streams in Wowza Streaming Engine

iOS supports fast forward and reverse playback. However, you don't need to produce special-purpose content to support fast forward and reverse playback. All you need to do is specify where the I-frames are. I-frames, or intra-coded frames, are encoded video frames whose encoding is independent of any other frame. To specify where the I-frames are, iOS 5 and later use an I-frame only playlist. The EXT-X-I-FRAMES-ONLY tag indicates that each media segment in the playlist describes a single I-frame.

An I-frame only playlist is almost identical to a regular playlist. The only difference is that I-frame playlists don't have an intrinsic duration. Instead, they represent an instant in time. In an I-frame only playlist that uses the EXT-X-I-FRAMES-ONLY tag, the EXTINF tag refers to the duration of the I-frame. This is the time between the presentation time of the I-frame in the media segment and the presentation time of the next I-frame in the playlist (or the end of the presentation if it is the last I-frame in the playlist).

Notes:

To enable I-frame playlists in Wowza Streaming Engine, add the following properties to the custom properties for your VOD application. See Configure properties for details about how to add custom properties to your application.

Path
Name
Type
Value
Notes
/Root/Application/HTTPStreamer cupertinoExtXVersion Integer 4 Can be set from the HTTP Streamers Cupertino Settings section (default: 3).
/Root/Application/HTTPStreamer cupertinoCreateKeyFrameOnlyPlaylist Boolean TRUE Must be set as a Custom Property (default: FALSE).


The cupertinoExtXVersion property must be set to a value of 4 or greater for I-frame playlists to work. Wowza Streaming Engine currently supports up to version 6.

The cupertinoCreateKeyFrameOnlyPlaylist property enables I-frame only playlists that the native players on Apple devices can use to perform faster seeks in video files. When enabled, the player will show a fast forward and a fast rewind button at the bottom of a fullscreen player. Clicking and holding down these buttons will use the I-frame only playlist to perform fast seeks in the video. Quickly clicking and releasing these buttons will skip to the beginning or end of the video.

If the I-frame only playlist functionality isn't working, the user will see the default buttons that allow skipping to the end or rewinding 30 seconds at a time.

The standard scrub bar at the top of the player doesn't use the I-frame only playlist, so seeking in the video by dragging the scrub bar pointer will still use the normal playlist. This allows you to drag the pointer to a specific point in the video.

Use curl or wget to inspect the playlist:

curl http://localhost:1935/[application-name]/mp4:sample.mp4/playlist.m3u8

The playlist will look something like this:

#EXTM3U
#EXT-X-VERSION:4
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=572079,CODECS="avc1.42c01e, mp4a.40.2",RESOLUTION=424x240
chunklist_w1616510757.m3u8
#EXT-X-I-FRAME-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=215,CODECS="avc1.42c01e",URI="chunklist_w1616510757_ko.m3u8"

In the chunklist, the list of media segments is slightly different from a normal media list where each segment is a single keyframe rather than a complete media segment with multiple keyframes.

Inspect the chunklist:

curl http://localhost:1935/[application-name]/mp4:sample.mp4/chunklist_w1616510757_ko.m3u8 

The chunklist looks something like this:

#EXTM3U
#EXT-X-VERSION:4
#EXT-X-TARGETDURATION:6
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-I-FRAMES-ONLY
#EXTINF:3.75,
#EXT-X-BYTERANGE:999624@376
media_w1616510757_ko_0.ts
#EXTINF:3.75,
#EXT-X-BYTERANGE:999624@376
media_w1616510757_ko_1.ts
#EXTINF:3.75,
#EXT-X-BYTERANGE:999624@376
media_w1616510757_ko_2.ts
#EXTINF:3.75,
#EXT-X-BYTERANGE:999624@376
media_w1616510757_ko_3.ts
. . .

With adaptive-bitrate streaming, you can also add an I-frame only rendition to your SMIL file that will be used by the player for seeking. The I-frame rendition of your file has a keyFrameOnly parameter that must be set to TRUE.

<smil>
    <head></head>
    <body>
        <switch>
            <video src="mp4:sample.mp4" width="320" height="240" video-bitrate="500000">
                <param name="videoCodecId" value="avc1.66.30" valuetype="data"/>
                <param name="audioCodecId" value="mp4a.40.2" valuetype="data"/>
            </video>
            <video src="mp4:sample.mp4" video-bitrate="5000">
                <param name="videoCodecId" value="avc1.66.30" valuetype="data"/>
                <param name="keyFrameOnly" value="TRUE" valuetype="data"/>
            </video>
        </switch>
    </body>
</smil>

This code will produce similar output to the original playlist.