• How to create keyframe (I-frame) only playlists for Apple HLS streams

    iOS 5 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 introduces a new I-frame only playlist. The new 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 "span" or 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).



    To enable I-frame playlists, 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.

    /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.

    The playlist will look something like this. Use curl or wget to inspect the playlist:
    curl http://localhost:1935/vod/mp4:sample.mp4/playlist.m3u8
    #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=572079,CODECS="avc1.42c01e, mp4a.40.2",RESOLUTION=424x240
    When inspecting the chunklist, you should see something like the following. 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.
    curl http://localhost:1935/vod/mp4:sample.mp4/chunklist_w1616510757_ko.m3u8
    . . .
    With adaptive bitrate (ABR) 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.
    			<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 src="mp4:sample.mp4" video-bitrate="5000">
    				<param name="videoCodecId" value="avc1.66.30" valuetype="data"/>
    				<param name="keyFrameOnly" value="TRUE" valuetype="data"/>
    This code will produce similar output to the original playlist.

    Originally Published: 06-19-2014.
    Updated: For Wowza Streaming Engine 4.0.6 on 08-11-2014.

    If you're having problems or want to discuss this article, post in our forum.