Packaging¶
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¶
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. |
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-KEYtagsoutput_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_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_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
NAMEuri used as the value for
URIlanguage used as the value for
LANGUAGEautoselect if true,
AUTOSELECTis set toYES. Implicitly set ifDEFAULTis truedefault if true,
DEFAULTis set toYESforced if true,
FORCEDis set toYESclosed_captions mark the entry as closed captions. By setting this to
true, this entry will have the following Uniform Type Identifiers [UTI] set in theCHARACTERISTICS:public.accessibility.transcribes-spoken-dialog public.accessibility.describes-music-and-sound
characteristics a list of strings - Uniform Type Identifiers [UTI] - to specify in the
CHARACTERISTICSthey are de-duplicated before written to the file. Ifclosed_captionsset 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_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. |
Shaka Packager¶
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 |
|||
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 |
|||
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 |
|
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 |
|||
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 |
|||
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 |
|
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 |
|||
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 |
|||
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 |
|
temp_dir |
optional |
Specify a directory in which to store temporary (intermediate) files. type: string default: “” |
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 |
|||
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 |
|||
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 |
|
temp_dir |
optional |
Specify a directory in which to store temporary (intermediate) files. type: string default: “” |
Unified Packager¶
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 |
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: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 |