Skip to content



Bento4 base command HLS

Full Documentation:


    "parameters": {
            "output_dir": "Bento-HLS",
            "master_playlist_name": "master.m3u8",
            "output_single_file": "true",
            "input": [
    "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

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)