Packaging

Packaging

Bento4

bento:mp42ts

Bento4 base command (TS)

Full Documentation: bento4.com

Example:

{ “tool”: “bento:mp42ts”, “parameters”: { “input”: “audiovideo.mp4”, “output”: “packaging-bento4_mp42ts/audiovideo.ts” } },

Parameter

Properties

Default

Type

Choice

Description

input

required [list value]

source MP4 files (optionally prefixed with a stream selector) delimited by [ and ]

output

required

pmt_pid

optional

PID to use for the PMT (default: 0x100)

audio_pid

optional

PID to use for audio packets (default: 0x101)

video_pid

optional

PID to use for video packets (default: 0x102)

segment

optional

segment_duration

optional

Target segment duration in seconds (default: 10)

segment_duration_threshold

optional

Segment duration threshold in milliseconds (default: 15)

verbose

optional

false

bool

playlist

optional

playlist_hls_version

optional

bento:mp4decrypt

Bento4’s mp4decrypt tool

Full Documentation: https://www.bento4.com/documentation/mp4decrypt/

Example:

{ “tool”: “bento:mp4decrypt” “parameters”: { “output_dir”: “out”, “keys”: [ { “key_id_hex”: “6a0c8772672d4176ad1ebdb2788ec818”, “key_hex”: “3e7819e161c5462e88629ed352dd23b3” }, { “key_id_hex”: “b1d2623821624bff9c17d2ad1ccbc6de”, “seed_hex”: “186fa15007c946069a6f6777bf0a821e” }, { “track_id”: “1”, “key_hex”: “e21087932add4f10ba45093ff7b49ef3” } ], “input_patterns”: [ “*.mp4” ], “inputs” = [ { “input_file”: “encrypted.mp4”, “output_file”: “decrypted.mp4” } ] } },

Decrypts input files using mp4decrypt tool.

output_dir: the output folder to place all the decrypted files into. If omitted, it defaults to “out”.

input_patterns: input patterns to process. If this is specified, input and output files in “inputs” are ignored

keys: a list of keys to use for decryption. Each key entry can have the following combinations

key_id_hex and key_hex key_id_hex and seed_hex track_id and key_hex

inputs: a list of files to decrypt. Each entry in the list can have the following properties:

input_file: the input MP4 file to decrypt

output_file: output filename of the decrypted file

Parameter

Properties

Default

Type

Choice

Description

inputs

required [list value]

keys

required [list value]

output_dir

optional

out

str

input_patterns

optional [list value]

str

bento:mp42hls

Bento4 base command HLS Full Documentation: bento4.com

Parameter

Properties

Default

Type

Choice

Description

input

required [list value]

source MP4 files (optionally prefixed with a stream selector) delimited by [ and ]

verbose

optional

false

bool

hls_version

optional

pmt_pid

optional

audio_pid

optional

video_pid

optional

audio_track_id

optional

video_track_id

optional

audio_format

optional

segment_duration

optional

segment_duration_threshold

optional

index_filename

optional

segment_filename_template

optional

segment_url_template

optional

iframe_index_filename

optional

output_single_file

optional

false

bool

Store segment data in a single output file per input file

encryption_mode

optional

Encryption mode (only used when –encryption-key is specified). AES-128 or SAMPLE-AES (default: AES-128)

encryption_key

optional

Encryption key in hexadecimal. 32 byte key value (64 characters in hex 16BytesCEK16BytesIV) (default: no encryption)

encryption_iv_mode

optional

Encryption IV mode: ‘sequence’, ‘random’ or ‘fps’ (Fairplay Streaming) (default: sequence). When the mode is ‘fps’, the encryption key must be 32 bytes: 16 bytes for the key followed by 16 bytes for the IV.

encryption_key_uri

optional

Encryption key URI (may be a realtive or absolute URI). (default: key.bin)

encryption_key_format

optional

Encryption key format. (default: ‘identity’)

encryption_key_format_versions

optional

Encryption key format versions.

bento:mp4mux

Bento4 mp4mux command

Full Documentation: bento4.com

Example:

{ “tool”: “bento:mp4mux”, “parameters”: { “tracks”: [ { “type”: “h264”, “input”: “video.h264”, “params”: “frame_rate=24.0,format=avc1” }, { “type”: “aac”, “input”: “audio.aac”, “params”: “language=eng” } ] “output”: “muxed.mp4” } },

Parameter

Properties

Default

Type

Choice

Description

tracks

required [list value]

output_file

required

bento:mp4hls

Bento4 base command HLS

Full Documentation: bento4.com

Example:

{ “parameters”: { “output_dir”: “Bento-HLS”, “master_playlist_name”: “master.m3u8”, “output_single_file”: “true”, “input”: [ “tearsofsteel_4k_384x172_600.mp4”, “tearsofsteel_4k_1280x572_2800.mp4”, “tearsofsteel_4k_audio_eng.mp4” ] }, “tool”: “bento:mp4hls” },

Muxed input mp4 and subtitles

[key1=value1,+key2=value2,+key3…]: chain input filters for stream selection

keys can be:

type: select media stream from file by type (audio, video) track: select ISO track ID from iso file (1,2,3…) language: select/define ISO track language ID (RFC5646: en, fr, ko,…) language_name: select/define track language attribute (presented in HLS Manifest) format: mandatory format specifier for adding subtitles (ttml, webvtt) Example: One audio and one video stream in one input file selection [type=video]avmedia1.mp4 [type=audio,+language=ko,+language_name=Korean]

Example: Add VTT Subtitles and set text language

[type=webvtt,+language=en,+language_name=English]languagetextfile.vtt

Parameter

Properties

Default

Type

Choice

Description

input

required [list value]

source MP4 files (optionally prefixed with a stream selector) delimited by [ and ]

verbose

optional

false

bool

Be verbose

force

optional

true

bool

Allow output to an existing directory (default: true)

output_dir

optional

out

str

Output directory

hls_version

optional

HLS Version (default: 3)

master_playlist_name

optional

Master Playlist name

media_playlist_name

optional

iframe_playlist_name

optional

audio_format

optional

base_url

optional

The base URL for the Media Playlists and TS files listed in the playlists. This is the prefix for the files.

output_single_file

optional

false

bool

Store segment data in a single output file per input file

encryption_mode

optional

Encryption mode (only used when –encryption-key is specified). AES-128 or SAMPLE-AES (default: AES-128)

encryption_key

optional

Encryption key in hexadecimal. 32 byte key value (64 characters in hex 16BytesCEK16BytesIV) (default: no encryption)

encryption_iv_mode

optional

Encryption IV mode: ‘sequence’, ‘random’ or ‘fps’ (Fairplay Streaming) (default: sequence). When the mode is ‘fps’, the encryption key must be 32 bytes: 16 bytes for the key followed by 16 bytes for the IV.

encryption_key_uri

optional

Encryption key URI (may be a realtive or absolute URI). (default: key.bin)

encryption_key_format

optional

Encryption key format. (default: ‘identity’)

encryption_key_format_versions

optional

Encryption key format versions.

signal_session_key

optional

false

bool

Signal an #EXT-X-SESSION-KEY tag in the master playlist

exec_dir

optional

/usr/local/bin

str

Directory where the Bento4 executables are located (DO NOT TOUCH)

segment_duration

optional

Target segment duration in seconds (default: 10)

segment_duration_threshold

optional

Segment duration threshold in milliseconds (default: 15)

bento:mp4hls-drmtoday

Bento4 command to produce HLS with DRMtoday support

Full Documentation: bento4.com

Example:

{ “tool”: “bento:mp4hls-drmtoday”, “parameters”: { “merchant”: “{merchant}”, “password”: “{pw}”, “master_playlist_name”: “master.m3u8”, “variant_id”: “{job_id}”, “output_dir”: “hls”, “user”: “test::vtktest”, “asset_id”: “vtk_integration_test_modern_encode_hls_{job_id}”, “input”: [ “encode/tos_360.mp4”, “encode/tos_576.mp4”, “encode/tos_720.mp4”, “encode/tos_864.mp4”, “encode/tos_1080.mp4” ], “output_single_file”: false, “verbose”: true, “environment”: “STAGING”, “hls_version”: “5” } },

Muxed input mp4 and subtitles

[key1=value1,+key2=value2,+key3…]: chain input filters for stream selection

keys can be:

type: select media stream from file by type (audio, video) track: select ISO track ID from iso file (1,2,3…) language: select/define ISO track language ID (RFC5646: en, fr, ko,…) language_name: select/define track language attribute (presented in HLS Manifest) format: mandatory format specifier for adding subtitles (ttml, webvtt) Example: One audio and one video stream in one input file selection [type=video]avmedia1.mp4 [type=audio,+language=ko,+language_name=Korean]

Example: Add VTT Subtitles and set text language

[type=webvtt,+language=en,+language_name=English]languagetextfile.vtt

Parameter

Properties

Default

Type

Choice

Description

asset_id

required

environment

required

‘prod’, ‘test’, ‘staging’, ‘PROD’, ‘TEST’, ‘STAGING’

merchant

required

password

required

user

required

input

required [list value]

source MP4 files (optionally prefixed with a stream selector) delimited by [ and ]

verbose

optional

false

bool

force

optional

true

bool

output_dir

optional

out

str

hls_version

optional

(default: 3)

master_playlist_name

optional

output_single_file

optional

false

bool

Output all the media in a single file instead of separate segment files. The segment filename template and segment URL template must be simple strings without ‘%d’ or other printf-style patterns

segment_duration

optional

Target segment duration in seconds (default: 10)

segment_duration_threshold

optional

Segment duration threshold in milliseconds (default: 15)

signal_session_key

optional

false

bool

Signal an #EXT-X-SESSION-KEY tag in the master playlist

variant_id

optional

exec_dir

optional

/usr/local/bin

str

DASHencrypt

dash:piff

Create a PIFF file from given list of tracks

Parameter

Properties

Default

Type

Choice

Description

tracks

required [list value]

List of input files, one for each track.

outputdir

optional

out

str

The output folder

keyseed

optional

The key seed

dash:drmtoday

Generate encrypted DASH package and register

Parameter

Properties

Default

Type

Choice

Description

asset_id

required

The DRMtoday Asset-ID

environment

required

The DRMtoday Environment

merchant

required

The DRMtoday Merchant

password

required

The DRMtoday CAS password

user

required

The DRMtoday CAS User

tracks

required [list value]

List of input files, one for each track.

variant_id

optional

The DRMtoday Variant-ID

generate_separate_keys

optional

false

bool

If set different keys will be used for audio and video. When setting keys explicitly this option is not used.

generate_single_key

optional

false

bool

If set different a single key will be used for audio and video. When setting keys explicitly this option is not used.

keyseed

optional

Content Encryption Key for video tracks - in case no dedicated audio key/key ID is given it will also used for audio tracks. Format is ‘01010101010101010101010101010101’

license_acq_ui_url

optional

PlayReady License Acquisition UI URL

license_acq_url

optional

PlayReady License Acquisition URL

partial_encryption

optional

The partial encryption feature is no longer supported.

clear_lead

optional

Not supported in this version of the DASH tool. Use dash:encrypt2 for clearlead.

audio_secret_key

optional

Audio secret key

video_secret_key

optional

Video secret key

audio_secret_key_file

optional

Audio secret key file

video_secret_key_file

optional

Video secret key file

audio_uuid

optional

Audio UUID (KeyID)

video_uuid

optional

Video UUID (KeyID)

widevine_content_id

optional

Widevine Content ID (optional)

widevine_policy

optional

Widevine policy name (optional)

widevine_provider

optional

Widevine provider/portal

split_manifest

optional

Generates a Manifest for all resolutions below the given height, above the given height and the normal Manifest with all resolutions

adjust_dimensions

optional

false

bool

Will set all width/height to the same values within one adaptation set

outputdir

optional

out/dash

str

The output directory

explode

optional

false

bool

Write each segment into a separate file

timescale

optional

Sets the timescale of the resulting stream.

smoothstreamingcompat

optional

false

bool

Triggers DASH/SmoothStreaming compatibility mode. DASH and Smooth Streaming Manifest will be created at the same time

compresstimeline

optional

false

bool

Compresses the timeline by using the repeat attribute in case of DASH-Live manifest or Smooth Streaming.

verbose

optional

false

bool

Enable verbose output

avc3

optional

false

bool

Convert avc1 tracks to avc3 tracks

subtitles

optional [list value]

Add subtitles (typically for foreign language when no dub is available) as TTML or WebVTT (.xml/.ttml/*.dfxp)

closed_captions

optional [list value]

Add closed captions (typically also replaces sound and assumes that viewer cannot hear) as TTML or WebVTT(.xml/.ttml/*.dfxp)

trick_mode_files

optional [list value]

Add reduced framerate representations to assist fast forward in players.

ma

optional

Minimum audio segment duration.

mv

optional

Minimum video segment duration.

dash:encrypt2

castLabs DASHencrypt - DASH with optional encryption, and optional DRMtoday support

The latest commercial release of the open source project castLabs DASHencrypt with additional features

Open Source Version: DASHencrypt

Example with DRMtoday supported key registration and PRESTOplay thumbnail support PRESTOplay:

{
  "tool": "dash:encrypt2",
  "parameters": {
    "environment": "STAGING",
    "generate_single_key": "true",
    "merchant": "{merchant}",
    "password": "{password}",
    "user": "{api:user}",
    "register": true,
    "input": [
      {
        "file": "video/tos_10s_1080p_1152x480_1500.mp4"
      },
        "file": "audio/tos_10s_1080p_audio_ita.mp4",
        "langOut": "it"
      },
      {
        "file": "audio/tos_10s_1080p_audio_eng.mp4",
        "langOut": "en-US"
      },
      {
        "file": "subtitles/tos_eng.dfxp",
        "langOut": "en"
      }
      {
        "file": "thumbnails/*.jpg",
        "vtiles": 8,
        "htiles": 8,
        "thduration": 5
      }
    ],
    "outputdir": "encrypt2_test/",
    "asset_id": "{drmtoday_asset_id}"
  }
},

Parameter

Properties

Default

Type

Choice

Description

input

required [list value]

dict

Input specifier:
{
   “file” : “path/to/sourcefile”,
   “typeSelector” : “audio” / “video” (optional) only select tracks of specified type from sourcefile
   “langSelector” : “eng”/”ger”/”fra” (optional) only select tracks of specified language from sourcefile (ISO-639 code as in MP4))
   “trackSelector” : “1/2/3” (optional) select track with specified trackID from sourcefile
   “langOut” : “pt-PT” / “de-DE” / “pt-BR” (optional) specify track language in DASH Manifest (defaults to MP4 language)
   “roleOut” : “captions” / “subtitle” / “main” / “alternate” / “supplementary” / “commentary” / “dub” (optional) specify tracks role (default: None)
}

outputdir

optional

output directory - if no output directory is given the current working directory is used.

register

optional

false

bool

Registers key at DRMtoday (mandates merchant, user, password, environment.)

ma

optional

15

int

Minimum Audio Segment Duration.

mv

optional

4

int

Minimum Video Segment Duration.

clearlead

optional

0

int

Clear Lead in seconds

force_key_overwrite

optional

false

bool

If set ingest will overwrite existing keys (default: false)

asset_id

optional

The DRMtoday Asset-ID

environment

optional

‘TEST’, ‘STAGING’, ‘PROD’

The DRMtoday Environment

merchant

optional

The DRMtoday Merchant

password

optional

The DRMtoday CAS password

user

optional

The DRMtoday CAS User

variant_id

optional

The DRMtoday Variant-ID

generate_single_key

optional

false

bool

Generate a common key for audio and video.

generate_separate_key

optional

false

bool

Generate separate keys for audio and video

generate_separate_key_per_res_no_audio

optional

false

bool

Generate separate keys each resolution family and audio remains clear

generate_separate_key_per_res

optional

false

bool

Generate separate keys for audio and each resolution family

video_key_id

optional

Set standard video key ID (will be used for audio as if no separate audio key ID is set). E.g. 550e8400-e29b-11d4-a716-446655440000

video_key

optional

Set the video key (will be used for audio as if no separate audio key is set). E.g. 00000000000000000000000000000000

hd_key_id

optional

Set HD video key ID. E.g. 550e8400-e29b-11d4-a716-446655440000

hd_key

optional

Set the video key. E.g. 00000000000000000000000000000000

uhd_key_id

optional

Set standard video key ID. E.g. 550e8400-e29b-11d4-a716-446655440000

uhd_key

optional

Set the video key. E.g. 00000000000000000000000000000000

audio_key_id

optional

Set audio key ID (requires video key ID to be set). E.g. 550e8400-e29b-11d4-a716-446655440000

audio_key

optional

Set the audio key (requires video key to be set). E.g. 00000000000000000000000000000000

key_seed

optional

Key seed for key derivation according to PlayReady specs.

dash:encrypt

castLabs DASHencrypt - DASH with simple encryption support

The latest commercial release of the open source project castLabs DASHencrypt with additional features

Open Source Version: DASHencrypt

NOTE: Deprecated. Use "dash:encrypt2" instead

Parameter

Properties

Default

Type

Choice

Description

tracks

required [list value]

List of input files, one for each track.

generate_separate_keys

optional

false

bool

If set different keys will be used for audio and video. When setting keys explicitly this option is not used.

generate_single_key

optional

false

bool

If set different a single key will be used for audio and video. When setting keys explicitly this option is not used.

keyseed

optional

Content Encryption Key for video tracks - in case no dedicated audio key/key ID is given it will also used for audio tracks. Format is ‘01010101010101010101010101010101’

license_acq_ui_url

optional

PlayReady License Acquisition UI URL

license_acq_url

optional

PlayReady License Acquisition URL

partial_encryption

optional

The partial encryption feature is no longer supported.

clear_lead

optional

Not supported in this version of the DASH tool. Use dash:encrypt2 for clearlead.

audio_secret_key

optional

Audio secret key

video_secret_key

optional

Video secret key

audio_secret_key_file

optional

Audio secret key file

video_secret_key_file

optional

Video secret key file

audio_uuid

optional

Audio UUID (KeyID)

video_uuid

optional

Video UUID (KeyID)

widevine_content_id

optional

Widevine Content ID (optional)

widevine_policy

optional

Widevine policy name (optional)

widevine_provider

optional

Widevine provider/portal

split_manifest

optional

Generates a Manifest for all resolutions below the given height, above the given height and the normal Manifest with all resolutions

adjust_dimensions

optional

false

bool

Will set all width/height to the same values within one adaptation set

outputdir

optional

out/dash

str

The output directory

explode

optional

false

bool

Write each segment into a separate file

timescale

optional

Sets the timescale of the resulting stream.

smoothstreamingcompat

optional

false

bool

Triggers DASH/SmoothStreaming compatibility mode. DASH and Smooth Streaming Manifest will be created at the same time

compresstimeline

optional

false

bool

Compresses the timeline by using the repeat attribute in case of DASH-Live manifest or Smooth Streaming.

verbose

optional

false

bool

Enable verbose output

avc3

optional

false

bool

Convert avc1 tracks to avc3 tracks

subtitles

optional [list value]

Add subtitles (typically for foreign language when no dub is available) as TTML or WebVTT (.xml/.ttml/*.dfxp)

closed_captions

optional [list value]

Add closed captions (typically also replaces sound and assumes that viewer cannot hear) as TTML or WebVTT(.xml/.ttml/*.dfxp)

trick_mode_files

optional [list value]

Add reduced framerate representations to assist fast forward in players.

ma

optional

Minimum audio segment duration.

mv

optional

Minimum video segment duration.

dash:dash

castLabs DASHencrypt - DASH without encryption or DRM support

The latest commercial release of the open source project castLabs DASHencrypt with additional features

Open Source Version: DASHencrypt

Example:

{
  "tool": "dash:dash",
  "parameters": {
            "outputdir": "DASH_clear",
    "tracks": [
      "clear-video/1024_2400k.mp4",
      "clear-video/1240_3500k.mp4",
              "clear-video/1920_7500k.mp4",
              "clear-video/384_600k.mp4",
              "clear-video/640_1100k.mp4",
              "clear-video/864_1800k.mp4"
    ],
            "subtitles": [
            "ITA.vtt",
            ...
            ]
      }
    },

Parameter

Properties

Default

Type

Choice

Description

tracks

required [list value]

List of input files, one for each track.

split_manifest

optional

Generates a Manifest for all resolutions below the given height, above the given height and the normal Manifest with all resolutions

adjust_dimensions

optional

false

bool

Will set all width/height to the same values within one adaptation set

outputdir

optional

out/dash

str

The output directory

explode

optional

false

bool

Write each segment into a separate file

timescale

optional

Sets the timescale of the resulting stream.

smoothstreamingcompat

optional

false

bool

Triggers DASH/SmoothStreaming compatibility mode. DASH and Smooth Streaming Manifest will be created at the same time

compresstimeline

optional

false

bool

Compresses the timeline by using the repeat attribute in case of DASH-Live manifest or Smooth Streaming.

verbose

optional

false

bool

Enable verbose output

avc3

optional

false

bool

Convert avc1 tracks to avc3 tracks

subtitles

optional [list value]

Add subtitles (typically for foreign language when no dub is available) as TTML or WebVTT (.xml/.ttml/*.dfxp)

closed_captions

optional [list value]

Add closed captions (typically also replaces sound and assumes that viewer cannot hear) as TTML or WebVTT(.xml/.ttml/*.dfxp)

trick_mode_files

optional [list value]

Add reduced framerate representations to assist fast forward in players.

ma

optional

Minimum audio segment duration.

mv

optional

Minimum video segment duration.

GPAC

mp4box:cmd

Tool to execute MP4Box command line tool with a custom command line arguments

Full Documentation: MP4Box Wiki

Example:

{
  "tool": "mp4box:cmd",
  "parameters": {
    "arguments": [
        "-udta",
        "4:type=tagc:str=public.accessibility.describes-video",
        "movie.mp4"
    ]
  }
},

Parameter

Properties

Default

Type

Choice

Description

arguments

required [list value]

mp4box:cat

MP4Box for concatenating MP4 files

Full Documentation: MP4Box Wiki

Example:

{
  "tool": "mp4box:cat",
  "parameters": {
    "fps": "23.976",
    "flat": "True",
    "inputs": [
      "chunk_001.mp4",
      "chunk_002.mp4"
    ],
    "output_dir": "out",
    "output": "file.mp4"
  }
},

Parameter

Properties

Default

Type

Choice

Description

fps

required

Frame rate. type: float

inputs

required [list value]

List of MP4 files to concatenate, or single path with wildcard expression: *

output

required

MP4 output file

flat

optional

true

bool

store file with all media data first, non-interleaved. This speeds up writing time when creating new files. By default all imports are performed sequentially, and final interleaving is done at the end; this however requires a temporary file holding original ISOBMF file (if any) and added files before creating the final output. Since this can become quite large, it is possible to add media to a new file without temporary storage, using -flat option, but this disables media interleaving.

output_dir

optional

Output folder

Manifest

m3u8_edit:add_subtitles

Enables adding subtitle media playlist entries to an HLS master playlist.

Generates an EXT-X-MEDIA entry with the specified GROUP-ID, then adds this GROUP-ID as the value for SUBTITLES for all the EXT-X-STREAM-INF entries in the HLS playlist.

Only supports master playlists which don’t yet include any subtitles.

Input parameters description:

  • name used as the value for NAME

  • uri used as the value for URI

  • language used as the value for LANGUAGE

  • autoselect if true, AUTOSELECT is set to YES. Implicitly set if DEFAULT is true

  • default if true, DEFAULT is set to YES

  • forced if true, FORCED is set to YES

  • closed_captions mark the entry as closed captions. By setting this to true, this entry will have the following Uniform Type Identifiers [UTI] set in the CHARACTERISTICS:

    public.accessibility.transcribes-spoken-dialog public.accessibility.describes-music-and-sound

  • characteristics a list of strings - Uniform Type Identifiers [UTI] - to specify in the CHARACTERISTICS they are de-duplicated before written to the file. If closed_captions set to true, this will include two pre-set UTIs

Example:

{
  "tool": "m3u8_edit:add_subtitles",
  "parameters": {
    "input_master_playlist": "index.m3u8",
    "output_master_playlist": "index_new.m3u8",
    "group_id": "subtitles",
    "inputs": [
        {
            "name": "fr-FR",
            "uri": "subs-01.m3u8",
            "language": "fr-FR",
            "autoselect": true,
            "default": true,
            "forced": false,
            "closed_captions": true,
            "characteristics": [
                "my.custom.uti.01",
                "my.custom.uti.02"
            ]
        },
        {
            "name": "es-ES",
            "uri": "subs-01.m3u8",
            "language": "es-ES",
            "autoselect": true,
            "default": false,
            "forced": false,
            "closed_captions": false,
            "characteristics": [
                "my.custom.uti.01",
                "my.custom.uti.02"
            ]
        }
    }
  }
}

Parameter

Properties

Default

Type

Choice

Description

input_master_playlist

required

Input master playlist to edit.

inputs

required [list value]

dict

Parameters of subtitle playlists to add

output_master_playlist

optional

Output master playlist. If not specified, defaults to overwriting the input.

group_id

optional

subtitles

str

GROUP-ID parameter of the added playlist. Defaults to “subtitles”

m3u8_edit:add_hdcp_level

Adds the HDCP-LEVEL to an HLS master playlist.

  • input_master_playlist input master playlist to edit. If output_master_playlist not specified, this file is overwritten.

  • output_master_playlist the output master playlist to save to. If not specified, the input is overwritten.

  • hdcp_type_0_min_width streams with width equal to or higher to this value will have “TYPE-0” HDCP level specified

  • hdcp_type_1_min_width streams with width equal to or higher to this value will have “TYPE-1” HDCP level specified

Example:

{
  "tool": "m3u8_edit:add_hdcp_level",
  "parameters": {
   "input_master_playlist": "master.m3u8",
    "hdcp_type_1_min_width": "1280",
    "hdcp_type_0_min_width": "0"
  }
}

Parameter

Properties

Default

Type

Choice

Description

input_master_playlist

required

Master playlist to edit.

hdcp_type_1_min_width

required

Minimum width to assign TYPE-1 HDCP-LEVEL

hdcp_type_0_min_width

required

Minimum width to assign TYPE-0 HDCP-LEVEL

output_master_playlist

optional

Updated master playlist. If empty, the input is overwritten.

m3u8_edit:add_session_key

Adds the EXT-X-SESSION-KEY to an HLS master playlist.

  • input_master_playlist input master playlist to parse. If output_master_playlist not specified, this file is overwritten.

  • input_media_playlists list of input media playlists that include the EXT-X-KEY tags

  • output_master_playlist the output master playlist to save to. If not specified, the input is overwritten.

Example:

{
  "tool": "m3u8_edit:add_session_key",
  "parameters": {
    "input_master_playlist": "index.m3u8",
    "input_media_playlists": ["sd1.m3u8", "sd2.m3u8", "audio.m3u8"]
  }
}

Parameter

Properties

Default

Type

Choice

Description

input_media_playlists

required [list value]

Input media playlists.

input_master_playlist

required

Master playlist to edit.

output_master_playlist

optional

Updated master playlist. If empty, the input is overwritten.

m3u8_generate:subs_playlist

Subtitle media playlist generator

Generates an HLS media playlist with a single entry of subtitles only.

Example:

{
  "tool": "m3u8_generate:subs_playlist",
  "parameters": {
    "input_vtt": "subs.vtt",
    "playlist_filename" "subs.vtt",
    "output_file" "subs-01.m3u8"
  }
}

Parameter

Properties

Default

Type

Choice

Description

input_vtt

required

Input subtitles in WebVTT format to use.

output_file

required

Filename of the output playlist

playlist_filename

optional

Subtitles filename to use in the playlist. Defaults to the input vtt filename if omitted.

mpd_edit:add_subtitles

DASH manifest editor for adding subtitles.

Adds an AdaptationSet with this structure: <AdaptationSet mimeType="text/vtt" lang="deu">         <Role schemeIdUri="urn:mpeg:dash:role:2011" value="subtitle"/>         <Representation id="sub_deu-vtt" bandwidth="1000">             <BaseURL>tos-deu.vtt</BaseURL>         </Representation>     </AdaptationSet>

Example:

{
  "tool": "mpd_edit:add_subtitles",
  "parameters": {
    "input_manifest": "dash.mpd",
    "output_manifest": "dash_new.mpd",
    "inputs": [
        {
            "base_url": "subs-en-US.vtt",
            "language": "en-US",
            "textrole": "subtitle"
        {,
        {
            "base_url": "subs-es-ES.vtt",
            "language": "es-ES",
            "textrole": "caption"
        }
    }
  }
}

Parameter

Properties

Default

Type

Choice

Description

input_manifest

required

Input dash manifest

inputs

required [list value]

dict

Parameters of subtitle playlists to add

output_manifest

optional

Output manifest. If not specified, defaults to overwriting the input.

Shaka Packager

shaka:package_mpegts

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

Example:

{
  "tool": "shaka:package_mpegts",
  "parameters": {
    "inputs": [
      {
        "input_file": "{mp4_h264_vid2000k}",
        "stream_selector": "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_selector": "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"],
    "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

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

overwrite

optional

false

bool

‘True’, ‘False’

Overwrite existing assetId or keyID(s)

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 https://github.com/google/shaka-packager/issues/406, 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.

allow_codec_switching

optional

true

bool

If enabled, allow adaptive switching between different codecs, if they have the same language, media type (audio, video etc) and container type.

dash_force_segment_list

optional

false

bool

Uses SegmentList instead of SegmentBase. Use this if the content is huge and the total number of (sub)segment references is greater than what the sidx atom allows (65535). Currently this flag is only supported in DASH ondemand profile.)

protection_systems

optional [list value]

‘Widevine’, ‘PlayReady’, ‘FairPlay’, ‘CommonSystem’, ‘ChinaDRM’

Protection systems to be generated. Supported protection systems include Widevine, PlayReady, FairPlay, Marlin, ChinaDRM and CommonSystem (https://goo.gl/s8RIhr). type: string default:

no_include_mspr_pro_for_playready

optional

false

bool

If enabled, PlayReady Object will NOT be inserted into element alongside with when using PlayReady protection system.

temp_dir

optional

Specify a directory in which to store temporary (intermediate) files. type: string default: “”

shaka:package_dash

Shaka Packager tool - DASH

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

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

Example:

{
  "tool": "shaka:package_dash",
  "parameters": {
    "inputs": [
      {
        "input_file": "{mp4_hevc_vid2000k}",
        "stream_selector": "video",
        "output": "{video1_mp4}",
        "output_format": "mp4",
        "bandwidth": "2000000"
      },
      {
        "input_file": "{sub_webvtt_eng}",
        "stream_selector": "text",
        "language": "eng",
        "output": "{sub1_webvtt}"
      }
    ],
    "default_language": "eng",
    "fragment_duration": "2",
    "output_dir": "{output_folder}/",
    "mpd_output": "dash.mpd"
  }
},

Parameter

Properties

Default

Type

Choice

Description

inputs

required [list value]

output_dir

required

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

overwrite

optional

false

bool

‘True’, ‘False’

Overwrite existing assetId or keyID(s)

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 https://github.com/google/shaka-packager/issues/406, 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.

allow_codec_switching

optional

true

bool

If enabled, allow adaptive switching between different codecs, if they have the same language, media type (audio, video etc) and container type.

dash_force_segment_list

optional

false

bool

Uses SegmentList instead of SegmentBase. Use this if the content is huge and the total number of (sub)segment references is greater than what the sidx atom allows (65535). Currently this flag is only supported in DASH ondemand profile.)

protection_systems

optional [list value]

‘Widevine’, ‘PlayReady’, ‘FairPlay’, ‘CommonSystem’, ‘ChinaDRM’

Protection systems to be generated. Supported protection systems include Widevine, PlayReady, FairPlay, Marlin, ChinaDRM and CommonSystem (https://goo.gl/s8RIhr). type: string default:

no_include_mspr_pro_for_playready

optional

false

bool

If enabled, PlayReady Object will NOT be inserted into element alongside with when using PlayReady protection system.

temp_dir

optional

Specify a directory in which to store temporary (intermediate) files. type: string default: “”

shaka:package_dash_wvapi

Shaka Packager tool - DASH - Widevine API

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

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

ChinaDRM is not supported when using the Widevine API!

Example:

{
  "tool": "shaka:package_dash_wvapi",
  "parameters": {
    "inputs": [
      {
        "input_file": "{mp4_h264_vid2000k}",
        "stream_selector": "video",
        "output": "{video1_mp4}",
        "output_format": "mp4",
        "bandwidth": "1500000",
        "drm_label": "HD"
      },

    ],
    ...
    "mpd_output": "dash.mpd",
    "protection_scheme": "cenc",
    "protection_systems": "PlayReady,Widevine",
    "enable_widevine_encryption": "True",
    "aes_signing_iv": "{aes-signing-iv}",
    "aes_signing_key": "{aes-signing-key}",
    "content_id": "{content-id}",
    "key_server_url": "{secret}",
    "signer": "castlabs"
  }
}

Parameter

Properties

Default

Type

Choice

Description

inputs

required [list value]

output_dir

required

enable_widevine_encryption

optional

false

bool

Enable encryption with Widevine key server.User should provide either AES signing key (–aes_signing_key, –aes_signing_iv) or RSA signing key (–rsa_signing_key_path).

aes_signing_iv

optional

AES signing iv in hex string

aes_signing_key

optional

AES signing key in hex string. –aes_signing_iv is required. Exclusive with –rsa_signing_key_path.

content_id

optional

Content Id (hex)

crypto_period_duration

optional

Crypto period duration in seconds. If it is non-zero, key rotation is enabled.

group_id

optional

Identifier for a group of licenses (hex)

key_server_url

optional

Key server url. Required for encryption and decryption

max_hd_pixels

optional

2073600

str

The video track is considered HD if its max pixels per frame is higher than max_sd_pixels, but no higher than max_hd_pixels. Default: 2073600 (1920 x 1080)

max_sd_pixels

optional

442368

str

The video track is considered SD if its max pixels per frame is no higher than max_sd_pixels. Default: 442368 (768 x 576)

max_uhd1_pixels

optional

8847360

str

The video track is considered UHD1 if its max pixels per frame is higher than max_hd_pixels, but no higher than max_uhd1_pixels.Otherwise it is UHD2. Default: 8847360 (4096 x 2160)

policy

optional

The name of a stored policy, which specifies DRM content rights.

rsa_signing_key_path

optional

Stores PKCS#1 RSA private key for request signing. Exclusive with –aes_signing_key.

signer

optional

The name of the signer.

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 https://github.com/google/shaka-packager/issues/406, 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.

allow_codec_switching

optional

true

bool

If enabled, allow adaptive switching between different codecs, if they have the same language, media type (audio, video etc) and container type.

dash_force_segment_list

optional

false

bool

Uses SegmentList instead of SegmentBase. Use this if the content is huge and the total number of (sub)segment references is greater than what the sidx atom allows (65535). Currently this flag is only supported in DASH ondemand profile.)

protection_systems

optional [list value]

‘Widevine’, ‘PlayReady’, ‘FairPlay’, ‘CommonSystem’, ‘ChinaDRM’

Protection systems to be generated. Supported protection systems include Widevine, PlayReady, FairPlay, Marlin, ChinaDRM and CommonSystem (https://goo.gl/s8RIhr). type: string default:

no_include_mspr_pro_for_playready

optional

false

bool

If enabled, PlayReady Object will NOT be inserted into element alongside with when using PlayReady protection system.

temp_dir

optional

Specify a directory in which to store temporary (intermediate) files. type: string default: “”

shaka:package_cmaf

Shaka Packager tool - CMAF

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

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

Example:

{
  "tool": "shaka:package_cmaf",
  "parameters": {
    "inputs": [
      {
        "input_file": "{mp4_h264_vid2000k}",
        "stream_selector": "video",
        "output": "{video1_mp4}",
        "output_format": "mp4",
        "bandwidth": "1500000",
        "drm_label": "HD"
      },

    ],
    ...
    "hls_master_playlist_output": "master.m3u8",
    "mpd_output": "dash.mpd",
    "protection_scheme": "cbcs",
    "enable_raw_key_encryption": "True",
    "drmkeys": [
      {
        "key_label": "my_key_02",
        "key_streamtype": "HD"
      },
      ...
    ]
  }
},

Parameter

Properties

Default

Type

Choice

Description

inputs

required [list value]

output_dir

required

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

overwrite

optional

false

bool

‘True’, ‘False’

Overwrite existing assetId or keyID(s)

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 https://github.com/google/shaka-packager/issues/406, 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.

allow_codec_switching

optional

true

bool

If enabled, allow adaptive switching between different codecs, if they have the same language, media type (audio, video etc) and container type.

dash_force_segment_list

optional

false

bool

Uses SegmentList instead of SegmentBase. Use this if the content is huge and the total number of (sub)segment references is greater than what the sidx atom allows (65535). Currently this flag is only supported in DASH ondemand profile.)

protection_systems

optional [list value]

‘Widevine’, ‘PlayReady’, ‘FairPlay’, ‘CommonSystem’, ‘ChinaDRM’

Protection systems to be generated. Supported protection systems include Widevine, PlayReady, FairPlay, Marlin, ChinaDRM and CommonSystem (https://goo.gl/s8RIhr). type: string default:

no_include_mspr_pro_for_playready

optional

false

bool

If enabled, PlayReady Object will NOT be inserted into element alongside with when using PlayReady protection system.

temp_dir

optional

Specify a directory in which to store temporary (intermediate) files. type: string default: “”

Unified Packager

mp4split:createismx_drmtoday

Unified Packager - create ISM Manifest

Version 1.7.4 of the Unified Packager executable (mp4split) with convenient commandline parameter mapping. The tool can be used to create Microsoft Smooth Streaming Manifests from ISMV, ISMA and ISMT Files, more output formats are supported. Full Documentation: Unified Packager

Example:

{
    "parameters": {
        "inputs": [
            {
                "file": "ss/tos_10s_eng.isma",
                "track_name": "English",
                "track_language": "eng"
            },
        ...
        ],
        "license_key": "{MP4SPLIT_LICENSE_KEY}",
        "output": "mss/tos.ism"
    },
    "tool": "mp4split:createism"
},

Full License: Unified Packager Licensing Contact our HelpDesk for more use-cases or a testing-license

Parameter

Properties

Default

Type

Choice

Description

asset_id

required

environment

required

‘prod’, ‘test’, ‘staging’, ‘PROD’, ‘TEST’, ‘STAGING’

merchant

required

DRMtoday merchant(organization)

password

required

DRMtoday password

user

required

DRMtoday username

output

required

variant_id

optional

Optional variant ID

timescale

optional

10000000

str

license_key

optional

{MP4SPLIT_LICENSE_KEY}

str

key

optional

key_id

optional

inputs

optional [list value]

ingest

optional

true

bool

stream_type

optional

VIDEO_AUDIO

str

‘VIDEO_AUDIO’, ‘AUDIO’, ‘VIDEO’

mp4split:hls

Unified Packager - create HLS

Version 1.7.4 of the Unified Packager executable (mp4split) with convenient commandline parameter mapping. The tool can create HLS packages, more output formats are supported. Full Documentation: Unified Packager

NOTE: Create the key file (key.iv) below with tool "utils:write_bytes"
NOTE: The value for "encrypt_key_url" must start with "skd://" for Fairplay Streaming use cases.
NOTE: To support PRESTOplay SDK and DRMtoday as Key Management Server, "skd://drmtoday?assetId={assetid}&variantId={variantId}" can be used to enable Fairplay Streaming.

Example:

{
    "parameters": {
        "inputfiles": [
            "clear-video/1024_2400k.mp4",
            "clear-video/1240_3500k.mp4",
            "clear-video/1920_7500k.mp4",
            "clear-video/384_600k.mp4",
            "clear-video/640_1100k.mp4",
            "clear-video/864_1800k.mp4"
        ],
        "track_type": "video",
        "license_key": "{MP4SPLIT_LICENSE_KEY-DEV}",
        "output": "HLS_simple-enc/v1/prog_index.m3u8",
        "start_segments_with_iframe": 1,
        "encrypt_key_file": "key.iv",
        "encrypt_key_url": "skd://drmtoday?assetId={assetid}&variantId={variantId}",
        "stream_encrypt": 1,
        "base_media_file": "v1_"
    },
    "tool": "mp4split:hls"
},

Full License: Unified Packager Licensing Contact our HelpDesk for more use-cases or a testing-license

Parameter

Properties

Default

Type

Choice

Description

output

required

inputfiles

required [list value]

fragment_duration

optional

output_single_file

optional

base_media_file

optional

encrypt_key_file

optional

encrypt_key_url

optional

encrypt_iv

optional

stream_encrypt

optional

streaming_key_delivery

optional

start_segments_with_iframe

optional

iframe_index_file

optional

track_groupid

optional

track_description

optional

license_key

optional

{MP4SPLIT_LICENSE_KEY}

str

track_type

optional

track_id

optional

track_language

optional

mp4split:createism

Unified Packager - create ISM Manifest

Version 1.7.4 of the Unified Packager executable (mp4split) with convenient commandline parameter mapping. The tool can be used to create Microsoft Smooth Streaming Manifests from ISMV, ISMA and ISMT Files, more output formats are supported. Full Documentation: Unified Packager

Example:

{
    "parameters": {
        "inputs": [
            {
                "file": "ss/tos_10s_eng.isma",
                "track_name": "English",
                "track_language": "eng"
            },
        ...
        ],
        "license_key": "{MP4SPLIT_LICENSE_KEY}",
        "output": "mss/tos.ism"
    },
    "tool": "mp4split:createism"
},

Full License: Unified Packager Licensing Contact our HelpDesk for more use-cases or a testing-license

Parameter

Properties

Default

Type

Choice

Description

output

required

inputs

required [list value]

license_key

optional

{MP4SPLIT_LICENSE_KEY}

str

mp4split:iss

Unified Packager - convert to Protected Interoperable File Format (PIFF)

Version 1.7.4 of the Unified Packager executable (mp4split) with convenient commandline parameter mapping. The tool can be used to create ISMV, ISMA and ISMT Files, as well as convert Subtitles, more output formats are supported. Full Documentation: Unified Packager

Example:

{
    "tool": "mp4split:iss",
    "parameters": {
        "license_key": "$license",
        "inputfiles": ["tearsofsteel_4k_deu.srt"],
        "output": "Tears_Of_Steel_deu.dfxp",
        "subtitles_language": "ger"
    }
},
{
    "tool": "mp4split:iss",
    "parameters": {
        "license_key": "{license}",
        "inputfiles": ["Tears_Of_Steel_deu.dfxp"],
        "output": "Tears_Of_Steel_deu.ismt",
        "timescale": "10000000"
    }
},

Full License: Unified Packager Licensing Contact our HelpDesk for more use-cases or a testing-license

Parameter

Properties

Default

Type

Choice

Description

output

required

inputfiles

required [list value]

timescale

optional

subtitles_language

optional

license_key

optional

{MP4SPLIT_LICENSE_KEY}

str

track_type

optional

track_id

optional

track_language

optional

mp4split:hls_drmtoday

Unified Packager - HLS with DRMtoday Support

Version 1.7.4 of the Unified Packager executable (mp4split) with convenient commandline parameter mapping. The tool can create HLS with Fairplay Streaming and DRMtoday Support, more output formats are supported. Full Documentation: Unified Packager

Example:

{
    "parameters": {
        "inputfiles": ["tearsofsteel_4k_audio_ita.mp4"],
        "license_key": "{license}",
        "output": "a2/prog_index.m3u8",
        "stream_encrypt": 1,
        "streaming_key_delivery": 1,
        "base_media_file": "a2_",
        "merchant": "{merchant}",
        "user": "{user}",
        "password": "{password}",
        "environment": "STAGING",
        "asset_id": "{assetID}"
    },
    "tool": "mp4split:hls_drmtoday"
},
{
    "parameters": {
        "inputfiles": [
            ...
            "a2/prog_index.m3u8",
            ...
        ],
        "license_key": "{license}",
        "output": "variantplaylist.m3u8"
    },
    "tool": "mp4split:hls"
},

Full License: Unified Packager Licensing Contact our HelpDesk for more use-cases or a testing-license

Parameter

Properties

Default

Type

Choice

Description

asset_id

required

environment

required

‘prod’, ‘test’, ‘staging’, ‘PROD’, ‘TEST’, ‘STAGING’

merchant

required

password

required

user

required

output

required

inputfiles

required [list value]

variant_id

optional

fragment_duration

optional

output_single_file

optional

base_media_file

optional

encrypt_key_file

optional

encrypt_key_url

optional

encrypt_iv

optional

stream_encrypt

optional

streaming_key_delivery

optional

start_segments_with_iframe

optional

iframe_index_file

optional

track_groupid

optional

track_description

optional

license_key

optional

{MP4SPLIT_LICENSE_KEY}

str

track_type

optional

track_id

optional

track_language

optional

Previous topic: File Transfer
Next topic: Utilities