Bento4 is a C++ class library and tools designed to read and write ISO-MP4 files. In addition to supporting ISO-MP4, Bento4 provides support for multiple DRM systems that are compatible with MP4-formatted content (usually leveraging CENC Common Encryption), such as PlayReady, Widevine, and FairPlay.
- Download the Bento4 binaries for the applicable operating system.
- Add the filepath for the Bento4 binaries bin folder as a value to the
PATHenvironment variables on your computer.
- Retrieve the Content Protection Information Exchanged (CPIX) documents. These are required to give Bento4 the necessary information to encrypt your media.
- Package your content with Bento4. The values from the CPIX documents need to be copied and pasted to the corresponding section in the following examples.
mp4dash \ --hls \ --encryption-key=<key_id_hex>:<content_key_hex_value>:<iv_hex_value> \ --encryption-cenc-scheme=cbcs \ --fairplay-key-uri=<fairplay_laurl_value> \ --hls-master-playlist-name=<name_of_manifest>.m3u8 \ <name_of_video_file>.mp4 \ <name_of_audio_file>.mp4
mp4dash \ --encryption-key=<key_id_hex_value>:<content_key_hex_value> \ --playready \ --widevine-header=#<Widevine_PSSH> \ --mpd-name=<name_of_manifest>.mpd \ <name_of_video_file>.mp4 \ <name_of_audio_file>.mp4
If you upload your packaged files and manifest to AWS S3 or an equivalent hosting service, you can test your packaged content with this stream tester.