@invintusmedia/tomp4 1.0.9 → 1.1.1

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 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 (snaps to keyframes)
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