@invintusmedia/tomp4 1.0.8 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -1
- package/dist/tomp4.js +312 -363
- package/package.json +6 -3
- package/src/fmp4/converter.js +323 -0
- package/src/fmp4/index.js +25 -0
- package/src/fmp4/stitcher.js +615 -0
- package/src/fmp4/utils.js +201 -0
- package/src/index.js +41 -20
- package/src/mpegts/index.js +7 -0
- package/src/mpegts/stitcher.js +251 -0
- package/src/muxers/mp4.js +85 -85
- package/src/muxers/mpegts.js +101 -19
- package/src/parsers/mp4.js +691 -0
- package/src/parsers/mpegts.js +42 -42
- package/src/remote/index.js +444 -0
- package/src/transcode.js +20 -36
- package/src/ts-to-mp4.js +37 -37
- package/src/fmp4-to-mp4.js +0 -375
package/README.md
CHANGED
|
@@ -48,13 +48,37 @@ const mp4 = await toMp4('https://example.com/stream.m3u8', {
|
|
|
48
48
|
endTime: 30
|
|
49
49
|
})
|
|
50
50
|
|
|
51
|
-
// clip existing data (
|
|
51
|
+
// clip existing data (frame-accurate using edit lists)
|
|
52
52
|
const mp4 = await toMp4(data, {
|
|
53
53
|
startTime: 5,
|
|
54
54
|
endTime: 15
|
|
55
55
|
})
|
|
56
56
|
```
|
|
57
57
|
|
|
58
|
+
### stitch multiple fMP4 segments
|
|
59
|
+
|
|
60
|
+
```js
|
|
61
|
+
// live stream saved as 4-second fMP4 chunks (each with init+data)
|
|
62
|
+
const segments = [segment1, segment2, segment3] // Uint8Array[]
|
|
63
|
+
const mp4 = toMp4.stitchFmp4(segments)
|
|
64
|
+
mp4.download('combined-stream.mp4')
|
|
65
|
+
|
|
66
|
+
// or with separate init segment
|
|
67
|
+
const mp4 = toMp4.stitchFmp4(dataSegments, { init: initSegment })
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### stitch multiple MPEG-TS segments
|
|
71
|
+
|
|
72
|
+
```js
|
|
73
|
+
// combine .ts segments into a single MP4
|
|
74
|
+
const segments = [segment1, segment2, segment3] // Uint8Array[]
|
|
75
|
+
const mp4 = toMp4.stitchTs(segments)
|
|
76
|
+
mp4.download('combined.mp4')
|
|
77
|
+
|
|
78
|
+
// or concatenate into a single continuous TS stream
|
|
79
|
+
const tsData = toMp4.concatTs(segments)
|
|
80
|
+
```
|
|
81
|
+
|
|
58
82
|
### analyze without converting
|
|
59
83
|
|
|
60
84
|
```js
|