mp4hls is a tool that creates a multi-bitrate HLS master playlist from one or more MP4 files, including support for encryption and I-frame-only playlists. This tool uses the mp42hls low level tool internally, so all the options supported by that low level tool are also available. This can be used as a replacement for Apple’s variantplaylistcreator tool.

Running the tool without any argument will print out a summary of the tool’s command line options and parameters.


Usage: [options] <media-file> [<media-file> ...]

Each <media-file> is the path to an MP4 file, optionally prefixed with a
stream selector delimited by [ and ]. The same input MP4 file may be repeated,
provided that the stream selector prefixes select different streams. Version
1.1.0 r611

  -h, --help            show this help message and exit
  -v, --verbose         Be verbose
  -d, --debug           Print out debugging information
  -o <output-dir>, --output-dir=<output-dir>
                        Output directory
  -f, --force           Allow output to an existing directory
                        HLS Version (default: 3)
                        Master Playlist name
  --output-single-file  Store segment data in a single output file per input
                        Encryption mode (only used when --encryption-key is
                        specified). AES-128 or SAMPLE-AES (default: AES-128)
                        Encryption key in hexadecimal (default: no encryption)
                        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 (may be a realtive or absolute
                        URI). (default: key.bin)
                        Encryption key format. (default: 'identity')
                        Encryption key format versions.
                        Output the encryption key to a file (default: don't
                        output the key). This option is only valid when the
                        encryption key format is 'identity'
                        Directory where the Bento4 executables are located