Skip to content



Shaka Packager tool - HLS

The latest stable release of the Shaka Packager with convenient commandline parameter mapping

Full documentation of the tool can be found in: Shaka-Packager


  "tool": "shaka:package_mpegts",
  "parameters": {
    "inputs": [
        "input_file": "{mp4_h264_vid2000k}",
        "stream_id": "video",
        "key_select": "video_key_01",
        "iframe_playlist_name": "vid_01_iframe.m3u8",
        "segment_template": "vid_01/$Number$.ts",
        "playlist_name": "vid_01.m3u8",
        "hls_name": "vid_01"
        "input_file": "{aac_128k_de}",
        "stream_id": "audio",
        "key_select": "audio_key_01",
        "segment_template": "aud_01/$Number$.ts",
        "playlist_name": "aud_01.m3u8",
        "hls_name": "aud_01",
        "hls_group_id": "Deutsch",
        "language": "de-DE"
    "default_language": "de-DE",
    "fragment_duration": "6",
    "segment_duration": "6",
    "output_dir": "{output_folder}",
    "enable_raw_key_encryption": "True",
    "protection_scheme": "cbcs",
    "hls_master_playlist_output": "master.m3u8",
    "protection_systems": ["FairPlay"],
    "iv": "{video_iv_hex}",
    "drmkeys": [
        "key_label": "video_key_01",
        "key_streamtype": "VIDEO",
        "key": "{video_hex}",
        "key_id": "{video_id_hex}",
        "key_iv": "{video_iv_hex}"
        "key_label": "audio_key_01",
        "key_streamtype": "AUDIO",
        "key": "{audio_hex}",
        "key_id": "{audio_id_hex}",
        "key_iv": "{audio_iv_hex}"
Parameter Properties Default Type Choice Description
inputs required [list value]
output_dir required
iv optional IV to use for HLS
hls_base_url optional The base URL for the Media Playlists and media files listed in the playlists. This is the prefix for the files
hls_master_playlist_output optional Output path for the master playlist for HLS. This flag must be used to output HLS.
hls_playlist_type optional VOD, EVENT, or LIVE. This defines the EXT-X-PLAYLIST-TYPE in the HLS specification. For hls_playlist_type of LIVE, EXT-X-PLAYLIST-TYPE tag is omitted.
mp4_reset_initial_composition_offset_to_zero optional false bool MP4 only. If it is true, reset the initial composition offset to zero, i.e. by assuming that there is a missing EditList.
vp9_subsample_encryption optional true bool vp9_subsample_encryption (Enable VP9 subsample encryption.)
enable_raw_key_encryption optional false bool Set to true to enable encryption.
drmkeys optional [list value] drmtoday keys
environment optional 'prod', 'test', 'staging', 'PROD', 'TEST', 'STAGING'
merchant optional The DRMtoday Merchant
user optional The DRMtoday API user
password optional The DRMtoday API user password
asset_id optional The DRMtoday Asset-ID
variant_id optional The DRMtoday Variant-ID
default_language optional For DASH, any audio/text tracks tagged with this language will have in the manifest; For HLS, the first audio/text rendition in a group tagged with this language will have 'DEFAULT' attribute set to 'YES'. This allows the player to choose the correct default language for the content.type: string
default_text_language optional Same as above, but this applies to text tracks only, and overrides the default language for text tracks.
time_shift_buffer_depth optional 1800 str Guaranteed duration of the time shifting buffer for HLS LIVE playlists and DASH dynamic media presentations, in seconds.
base_urls optional Comma separated BaseURLs for the MPD. The values will be added as element(s) immediately under the element.
generate_dash_if_iop_compliant_mpd optional false bool Try to generate DASH-IF IOP compliant MPD. This is best effort and does not guarantee compliance.
generate_static_live_mpd optional true bool Set to true to generate static mpd. If segment_template is specified in stream descriptors, shaka-packager generates dynamic mpd by default; if this flag is enabled, shaka-packager generates static mpd instead. Note that if segment_template is not specified, shaka-packager always generates static mpd regardless of the value of this flag.
min_buffer_time optional 2 str Specifies, in seconds, a common duration used in the definition of the MPD Representation data rate.
minimum_update_period optional 5 str Indicates to the player how often to refresh the media presentation description in seconds. This value is used for dynamic MPD only.
mpd_output optional MPD output file name.
suggested_presentation_delay optional 0 str Specifies a delay, in seconds, to be added to the media presentation time. This value is used for dynamic MPD only.
use_legacy_vp9_codec_string optional false bool Use legacy vp9 codec string 'vp9' if set to true; otherwise new style vp09.xx.xx.xx... codec string will be used. Default to false as indicated in, all major browsers and platforms already support the new 'vp09' codec string.
video_feature optional 'HDR', '' Specify the optional video feature, e.g. HDR. type: string
protection_scheme optional 'cenc', 'cbc1', 'cens', 'cbcs' Specify a protection scheme, 'cenc' or 'cbc1' or pattern-based protection schemes 'cens' or 'cbcs'.
disable_peer_verification optional false bool Disable peer verification. This is needed to talk to servers without valid certificates.
clear_lead optional 0 str Clear lead in seconds if encryption is enabled.
fragment_duration optional Fragment duration in seconds. Should not be larger than the segment duration. Actual fragment durations may not be exactly as requested.
fragment_sap_aligned optional true bool Force fragments to begin with stream access points. This flag implies segment_sap_aligned.
mp4_include_pssh_in_stream optional false bool MP4 only: include pssh in the encrypted stream.
num_subsegments_per_sidx optional For ISO BMFF only. Set the number of subsegments in each SIDX box. If 0, a single SIDX box is used per segment; if -1, no SIDX box is used; Otherwise, the muxer packs N subsegments in the root SIDX of the segment, with segment_duration/N/fragment_duration fragments per subsegment.
segment_duration optional Segment duration in seconds. If single_segment is specified, this parameter sets the duration of a subsegment; otherwise, this parameter sets the duration of a segment. Actual segment durations may not be exactly as requested.
segment_sap_aligned optional true bool Force segments to begin with stream access points.
protection_systems optional [list value] 'Widevine', 'PlayReady', 'FairPlay', 'CommonSystem' Protection systems to be generated. Supported protection systems include Widevine, PlayReady, FairPlay, Marlin, and CommonSystem ( type: string default:
temp_dir optional Specify a directory in which to store temporary (intermediate) files. Used only if single_segment=true.) type: string default: ""