An ID3-only MPEG2TS segment generator library.
npm install id3-ts-libsh
$> npm install @brightcove/id3-ts-lib
`Usage:
`javascript
const fs = require('fs');// The whole library exposes just a single function:
const generateID3Segment = require('id3-ts-lib');
// If a PID is falsey, then that track will not be included in the generated PMT
const options = {
pmtPid: 0x100,
id3Pid: 0x103,
videoPid: null,
audioPid: null,
id3PTS: 282743,
data: 'This is just some example payload...',
};
// The function returns a promise that resolves to a buffer
generateID3Segment(options).then((segment) => {
fs.writeSync('test.ts', segment);
});
`As a very rudimentary executable:
`sh
$> npm install -g @brightcove/id3-ts-lib$> id3-ts 'This is just some example payload...' > test.ts
``