mp4hls

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

Usage: mp4-hls.py [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

Options:
  -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=<version>
                        HLS Version (default: 3)
  --master-playlist-name=<filename>
                        Master Playlist name
  --output-single-file  Store segment data in a single output file per input
                        file
  --encryption-mode=<mode>
                        Encryption mode (only used when --encryption-key is
                        specified). AES-128 or SAMPLE-AES (default: AES-128)
  --encryption-key=<key>
                        Encryption key in hexadecimal (default: no encryption)
  --encryption-iv-mode=<mode>
                        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=<uri>
                        Encryption key URI (may be a realtive or absolute
                        URI). (default: key.bin)
  --encryption-key-format=<format>
                        Encryption key format. (default: 'identity')
  --encryption-key-format-versions=<versions>
                        Encryption key format versions.
  --output-encryption-key
                        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'
  --exec-dir=<exec_dir>
                        Directory where the Bento4 executables are located