@adonis-agora/media 0.24.0 → 0.26.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.
Files changed (69) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/README.md +18 -9
  3. package/dist/providers/media_provider.d.ts.map +1 -1
  4. package/dist/providers/media_provider.js +3 -0
  5. package/dist/providers/media_provider.js.map +1 -1
  6. package/dist/src/define_config.d.ts +9 -3
  7. package/dist/src/define_config.d.ts.map +1 -1
  8. package/dist/src/define_config.js.map +1 -1
  9. package/dist/src/errors.d.ts +2 -2
  10. package/dist/src/errors.d.ts.map +1 -1
  11. package/dist/src/errors.js +3 -3
  12. package/dist/src/errors.js.map +1 -1
  13. package/dist/src/hls/delivery.d.ts +1 -1
  14. package/dist/src/hls/delivery.d.ts.map +1 -1
  15. package/dist/src/hls/delivery.js +1 -1
  16. package/dist/src/hls/delivery.js.map +1 -1
  17. package/dist/src/hls/to_dash.d.ts +51 -0
  18. package/dist/src/hls/to_dash.d.ts.map +1 -0
  19. package/dist/src/hls/to_dash.js +130 -0
  20. package/dist/src/hls/to_dash.js.map +1 -0
  21. package/dist/src/index.d.ts +9 -6
  22. package/dist/src/index.d.ts.map +1 -1
  23. package/dist/src/index.js +4 -2
  24. package/dist/src/index.js.map +1 -1
  25. package/dist/src/media_access.d.ts +64 -0
  26. package/dist/src/media_access.d.ts.map +1 -1
  27. package/dist/src/media_access.js +105 -7
  28. package/dist/src/media_access.js.map +1 -1
  29. package/dist/src/media_collection.d.ts +1 -1
  30. package/dist/src/media_library.d.ts +67 -1
  31. package/dist/src/media_library.d.ts.map +1 -1
  32. package/dist/src/media_library.js +133 -1
  33. package/dist/src/media_library.js.map +1 -1
  34. package/dist/src/media_manager.d.ts +2 -0
  35. package/dist/src/media_manager.d.ts.map +1 -1
  36. package/dist/src/media_manager.js +3 -0
  37. package/dist/src/media_manager.js.map +1 -1
  38. package/dist/src/streaming.d.ts +78 -0
  39. package/dist/src/streaming.d.ts.map +1 -0
  40. package/dist/src/streaming.js +144 -0
  41. package/dist/src/streaming.js.map +1 -0
  42. package/dist/src/transformer.d.ts +1 -1
  43. package/dist/src/transformers/factory.d.ts +13 -9
  44. package/dist/src/transformers/factory.d.ts.map +1 -1
  45. package/dist/src/transformers/factory.js +14 -10
  46. package/dist/src/transformers/factory.js.map +1 -1
  47. package/dist/src/transformers/ffmpeg.d.ts +40 -14
  48. package/dist/src/transformers/ffmpeg.d.ts.map +1 -1
  49. package/dist/src/transformers/ffmpeg.js +90 -22
  50. package/dist/src/transformers/ffmpeg.js.map +1 -1
  51. package/dist/src/transformers/mediabunny.d.ts +2 -2
  52. package/dist/src/transformers/mediabunny.d.ts.map +1 -1
  53. package/dist/src/transformers/mediabunny.js +148 -32
  54. package/dist/src/transformers/mediabunny.js.map +1 -1
  55. package/dist/src/transformers/mediabunny_loader.d.ts +2 -2
  56. package/dist/src/transformers/mediabunny_loader.d.ts.map +1 -1
  57. package/dist/src/transformers/probe.js +1 -1
  58. package/dist/src/transformers/probe.js.map +1 -1
  59. package/dist/src/transformers/video.d.ts +124 -0
  60. package/dist/src/transformers/video.d.ts.map +1 -0
  61. package/dist/src/transformers/video.js +133 -0
  62. package/dist/src/transformers/video.js.map +1 -0
  63. package/package.json +3 -3
  64. package/skills/media-library-collections/SKILL.md +4 -4
  65. package/skills/media-stores-delivery/SKILL.md +10 -5
  66. package/dist/src/transformers/hls.d.ts +0 -113
  67. package/dist/src/transformers/hls.d.ts.map +0 -1
  68. package/dist/src/transformers/hls.js +0 -110
  69. package/dist/src/transformers/hls.js.map +0 -1
@@ -162,11 +162,16 @@ router.get('/media/:id', async ({ params, request, response, auth }) => {
162
162
  ```
163
163
 
164
164
  The handler's own `mode` / `signedTtlSeconds` override the configured ones per call. For
165
- transformer-generated HLS packages use `HlsDeliveryHandler` — playlists are rewritten per
166
- request, segment files are validated against the persisted artifact list (no caller input
167
- ever reaches the disk as a path).
168
-
169
- Source: `docs/delivery.mdx`, `docs/transformers.mdx` (Serving HLS).
165
+ transformer-generated HLS/DASH packages use `media.access.streamRoute()` — it serves every
166
+ file of the package under `/media/:id/stream/:conversion/*`, authorizes each request with
167
+ the collection's `access.read` (or `authorize`), validates the file against the persisted
168
+ artifact list (no caller input ever reaches the disk as a path), answers manifests as text
169
+ with the package signature carried onto their references, and redirects or streams segments
170
+ per `mode`. `media.access.serveStream()` is the same for a controller that finds the record
171
+ its own way. `HlsDeliveryHandler` remains only as the lower-level HLS-only read path for
172
+ custom URL schemes.
173
+
174
+ Source: `docs/delivery.mdx`, `docs/streaming.mdx` (The stream route), `docs/transformers.mdx` (Serving HLS).
170
175
 
171
176
  ## Common mistakes
172
177
 
@@ -1,113 +0,0 @@
1
- import type { Transformer, TransformerContext, TransformResult } from '../transformer.js';
2
- /**
3
- * Lazily supplies a WebCodecs implementation (`{ VideoEncoder, VideoDecoder, AudioEncoder, … }`).
4
- * Node has no built-in WebCodecs, which is exactly why the HLS transformer is remux-only by
5
- * default — but NAPI-based implementations exist (e.g. `@napi-rs/webcodecs`), and injecting one
6
- * unlocks the re-encode fallback for sources whose codecs cannot be stream-copied:
7
- *
8
- * ```ts
9
- * transformers.hls({ webcodecs: () => import('@napi-rs/webcodecs') })
10
- * ```
11
- *
12
- * The engine installs the provided classes onto `globalThis` (only the ones missing — a native
13
- * implementation is never overwritten), because that is where the underlying media engine looks
14
- * the API up.
15
- */
16
- export type WebCodecsProvider = () => Promise<Record<string, unknown>>;
17
- /** How a runtime can satisfy the WebCodecs requirement. See {@link resolveWebCodecsSupport}. */
18
- export type WebCodecsSupport = 'native' | 'injected' | 'absent';
19
- /**
20
- * Detect how (whether) WebCodecs is available: `'native'` when the runtime already exposes
21
- * `VideoEncoder`, `'injected'` when a {@link WebCodecsProvider} supplies one, `'absent'` otherwise.
22
- * `'absent'` means encoding is impossible — transforms stay stream-copy only, and a transformer
23
- * that cannot proceed without an encoder should throw `TransformerRuntimeMissingError`.
24
- */
25
- export declare function resolveWebCodecsSupport(provider?: WebCodecsProvider): Promise<WebCodecsSupport>;
26
- /** What {@link HlsRemuxEngine.remux} receives. */
27
- export interface HlsRemuxRequest {
28
- /** Local path of the source file. */
29
- sourcePath: string;
30
- /** Local directory the engine writes the whole package into (entry playlist at its root). */
31
- outputDir: string;
32
- /** File name of the entry (master) playlist, e.g. `index.m3u8`. */
33
- entryName: string;
34
- /** Target (max) segment duration in seconds. */
35
- targetDuration: number;
36
- /** Optional WebCodecs implementation enabling the re-encode fallback. */
37
- webcodecs?: WebCodecsProvider | undefined;
38
- }
39
- /** What the engine learned about the source while remuxing — persisted into the conversion `meta`. */
40
- export interface HlsRemuxSummary {
41
- durationSeconds?: number;
42
- width?: number;
43
- height?: number;
44
- videoCodec?: string | null;
45
- audioCodec?: string | null;
46
- }
47
- /**
48
- * The engine seam of {@link HlsTransformer}: local file in, HLS package (playlists + segments) in
49
- * a local directory out. The default engine is mediabunny, loaded lazily on first transform; tests
50
- * inject a fake that writes files, so every bit of orchestration around the engine is testable
51
- * without the optional peer.
52
- */
53
- export interface HlsRemuxEngine {
54
- remux(request: HlsRemuxRequest): Promise<HlsRemuxSummary>;
55
- }
56
- export interface HlsTransformerOptions<Name extends string = 'hls'> {
57
- /** Conversion name on the record. Default `'hls'`. */
58
- name?: Name;
59
- /**
60
- * Run inside attach. Default `false`, and think twice: a remux takes real time, and an eager
61
- * failure rolls the attach back. The intended flow is deferred —
62
- * `media.library.transform(id, 'hls')` from a job.
63
- */
64
- eager?: boolean;
65
- /** Target (max) segment duration in seconds. Default 4. */
66
- targetDuration?: number;
67
- /** WebCodecs implementation for the re-encode fallback (see {@link WebCodecsProvider}). */
68
- webcodecs?: WebCodecsProvider;
69
- /**
70
- * Replace the mediabunny engine — e.g. `engines.ffmpegHls({ ladder })` to transcode an
71
- * adaptive-bitrate ladder with the system ffmpeg, or your own {@link HlsRemuxEngine}.
72
- */
73
- engine?: HlsRemuxEngine;
74
- }
75
- /** File name of the entry (master) playlist an {@link HlsTransformer} produces. */
76
- export declare const HLS_ENTRY_PLAYLIST = "index.m3u8";
77
- /**
78
- * The built-in video {@link Transformer}: converts a stored video into an HLS package — MPEG-TS
79
- * segments plus media playlists behind one master playlist — written under the conversion prefix
80
- * and persisted as `record.conversions['hls']` with duration/resolution/codec metadata.
81
- *
82
- * **Remux-only by default.** The engine (mediabunny, pure JS — no ffmpeg binary) stream-copies
83
- * the source's h264/aac tracks into segments without re-encoding, because encoding needs
84
- * WebCodecs, which Node does not provide. Two consequences, both deliberate:
85
- *
86
- * - a source whose codecs MPEG-TS cannot carry (vp9, av1…) fails with a clear, definitive
87
- * `HlsSourceUnsupportedError` — unless a {@link WebCodecsProvider} is configured, which enables
88
- * the engine's re-encode fallback;
89
- * - the package has a single variant at the original resolution. Multi-quality renditions are the
90
- * documented evolution once an encoder is present (mediabunny supports fan-out video options),
91
- * not something this transformer fakes today.
92
- *
93
- * The engine also carries the subtle bit the naive implementation gets wrong: AAC audio with
94
- * priming (an mp4 edit list) starts at a **negative** timestamp, and a conversion trimmed at t=0
95
- * would kick that track off the stream-copy fast path — impossible without an encoder. The
96
- * conversion is therefore trimmed at the source's real first timestamp, shifting all tracks
97
- * equally (sync is unchanged) and keeping every track copyable.
98
- *
99
- * Serving the result is the other half: playlists are stored with storage-relative references and
100
- * must be rewritten per request — see {@link HlsDeliveryHandler}.
101
- */
102
- export declare class HlsTransformer<Name extends string = 'hls'> implements Transformer {
103
- readonly name: Name;
104
- readonly eager: boolean;
105
- private readonly targetDuration;
106
- private readonly webcodecs;
107
- private readonly engine;
108
- constructor(options?: HlsTransformerOptions<Name>);
109
- transform(context: TransformerContext): Promise<TransformResult>;
110
- }
111
- /** Drop `undefined` values so the persisted meta round-trips identically through JSON stores. */
112
- export declare function compactMeta(meta: Record<string, unknown>): Record<string, unknown>;
113
- //# sourceMappingURL=hls.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hls.d.ts","sourceRoot":"","sources":["../../../src/transformers/hls.ts"],"names":[],"mappings":"A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AChB,2DAA2D;IAC3D,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,2FAA2F;IAC3F,SAAS,CAAC,EAAE,iBAAiB,CAAC;IAC9B;;;OAGG;IACH,MAAM,CAAC,EAAE,cAAc,CAAC;CACzB;AAED,mFAAmF;AACnF,eAAO,MAAM,kBAAkB,eAAe,CAAC;AAE/C;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,qBAAa,cAAc,CAAC,IAAI,SAAS,MAAM,GAAG,KAAK,CAAE,YAAW,WAAW;IAC7E,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAS;IACxC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAgC;IAC1D,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA6B;IAEpD,YAAY,OAAO,GAAE,qBAAqB,CAAC,IAAI,CAAM,EAMpD;IAEK,SAAS,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,eAAe,CAAC,CA6CrE;CACF;AAED,iGAAiG;AACjG,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAElF"}
@@ -1,110 +0,0 @@
1
- import { createReadStream } from 'node:fs';
2
- import { mkdir, readdir, stat } from 'node:fs/promises';
3
- import { join } from 'node:path';
4
- import { hlsArtifactContentType } from '../hls/playlist.js';
5
- import { loadMediabunny } from './mediabunny_loader.js';
6
- import { withSourceFile } from './source_file.js';
7
- /**
8
- * Detect how (whether) WebCodecs is available: `'native'` when the runtime already exposes
9
- * `VideoEncoder`, `'injected'` when a {@link WebCodecsProvider} supplies one, `'absent'` otherwise.
10
- * `'absent'` means encoding is impossible — transforms stay stream-copy only, and a transformer
11
- * that cannot proceed without an encoder should throw `TransformerRuntimeMissingError`.
12
- */
13
- export async function resolveWebCodecsSupport(provider) {
14
- if (globalThis.VideoEncoder !== undefined)
15
- return 'native';
16
- if (provider && (await provider()).VideoEncoder !== undefined)
17
- return 'injected';
18
- return 'absent';
19
- }
20
- /** File name of the entry (master) playlist an {@link HlsTransformer} produces. */
21
- export const HLS_ENTRY_PLAYLIST = 'index.m3u8';
22
- /**
23
- * The built-in video {@link Transformer}: converts a stored video into an HLS package — MPEG-TS
24
- * segments plus media playlists behind one master playlist — written under the conversion prefix
25
- * and persisted as `record.conversions['hls']` with duration/resolution/codec metadata.
26
- *
27
- * **Remux-only by default.** The engine (mediabunny, pure JS — no ffmpeg binary) stream-copies
28
- * the source's h264/aac tracks into segments without re-encoding, because encoding needs
29
- * WebCodecs, which Node does not provide. Two consequences, both deliberate:
30
- *
31
- * - a source whose codecs MPEG-TS cannot carry (vp9, av1…) fails with a clear, definitive
32
- * `HlsSourceUnsupportedError` — unless a {@link WebCodecsProvider} is configured, which enables
33
- * the engine's re-encode fallback;
34
- * - the package has a single variant at the original resolution. Multi-quality renditions are the
35
- * documented evolution once an encoder is present (mediabunny supports fan-out video options),
36
- * not something this transformer fakes today.
37
- *
38
- * The engine also carries the subtle bit the naive implementation gets wrong: AAC audio with
39
- * priming (an mp4 edit list) starts at a **negative** timestamp, and a conversion trimmed at t=0
40
- * would kick that track off the stream-copy fast path — impossible without an encoder. The
41
- * conversion is therefore trimmed at the source's real first timestamp, shifting all tracks
42
- * equally (sync is unchanged) and keeping every track copyable.
43
- *
44
- * Serving the result is the other half: playlists are stored with storage-relative references and
45
- * must be rewritten per request — see {@link HlsDeliveryHandler}.
46
- */
47
- export class HlsTransformer {
48
- name;
49
- eager;
50
- targetDuration;
51
- webcodecs;
52
- engine;
53
- constructor(options = {}) {
54
- this.name = options.name ?? 'hls';
55
- this.eager = options.eager ?? false;
56
- this.targetDuration = options.targetDuration ?? 4;
57
- this.webcodecs = options.webcodecs;
58
- this.engine = options.engine;
59
- }
60
- async transform(context) {
61
- const engine = this.engine ?? (await loadMediabunny(this.name)).createHlsEngine();
62
- return withSourceFile(context, async ({ sourcePath, tempDir }) => {
63
- const outputDir = join(tempDir, 'hls');
64
- await mkdir(outputDir, { recursive: true });
65
- const summary = await engine.remux({
66
- sourcePath,
67
- outputDir,
68
- entryName: HLS_ENTRY_PLAYLIST,
69
- targetDuration: this.targetDuration,
70
- webcodecs: this.webcodecs,
71
- });
72
- // Upload the whole package the engine wrote — playlists and segments alike — streaming each
73
- // file (a segment never has to fit in memory). Sorted for deterministic order in
74
- // `conversions[name].files`.
75
- const files = (await readdir(outputDir, { recursive: true })).sort();
76
- let segmentCount = 0;
77
- let playlistCount = 0;
78
- for (const file of files) {
79
- const relative = file.split('\\').join('/');
80
- const local = join(outputDir, file);
81
- const info = await stat(local);
82
- if (!info.isFile())
83
- continue;
84
- if (relative.toLowerCase().endsWith('.m3u8'))
85
- playlistCount += 1;
86
- else
87
- segmentCount += 1;
88
- const contentType = hlsArtifactContentType(relative);
89
- await context.write(relative, createReadStream(local), {
90
- contentLength: info.size,
91
- ...(contentType !== undefined ? { contentType } : {}),
92
- });
93
- }
94
- return {
95
- entry: HLS_ENTRY_PLAYLIST,
96
- meta: compactMeta({
97
- ...summary,
98
- segmentCount,
99
- playlistCount,
100
- targetDuration: this.targetDuration,
101
- }),
102
- };
103
- });
104
- }
105
- }
106
- /** Drop `undefined` values so the persisted meta round-trips identically through JSON stores. */
107
- export function compactMeta(meta) {
108
- return Object.fromEntries(Object.entries(meta).filter(([, value]) => value !== undefined));
109
- }
110
- //# sourceMappingURL=hls.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hls.js","sourceRoot":"","sources":["../../../src/transformers/hls.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO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