TypeScript MP4 PSSH Parser
npm install @re/mp4pssh
A TypeScript parser to convert a Base64-encoded string representing an MP4 PSSH box into a POJO. More information about MP4 PSSH boxes can be found here.
This repository is hosted on NPM. Install this package using:
npm i @re/mp4pssh
The parser can then be imported using:
import { PSSHParser } from '@re/mp4pssh'
Begin by getting a Base64-encoded string representing an MP4 PSSH box.
Create a new instance of the PSSHParser class:
const psshParser = new PSSHParser();
Use the parsePSSH() method to parse the Base64-encoded PSSH box into a POJO:
const pssh = psshParser.parsePSSH(
Users can then access the information encoded in the PSSH:
- version : The version of the parsed PSSH
- systemId : The ID of the system that will consume the PSSH data
- kidCount : The number of KIDs included in the PSSH
- kids : The KIDs included in the PSSH
- dataSize : The length of ths PSSH data (in bytes)
- data : The PSSH data
This repo was written and maintained by RealEyes Media, a Video Streaming consultancy based in Denver, CO, USA. Contributions are welcome via PRs.
This repo uses Jest as its testing framework. To test, use:
npm test
This repo uses Webpack and Babel as its build frameworks. To build, use:
npm run build
MIT