libav-wasm 0.3.4 → 0.4.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 CHANGED
@@ -67,6 +67,5 @@ To have C++ autocompletion, put a ffmpeg repo clone folder in the root
67
67
  - Decoding + canvas rendering
68
68
  - Thumbnail extraction
69
69
 
70
-
71
70
  <!-- https://www.ffmpeg.org/doxygen/trunk/remuxing_8c-example.html -->
72
71
  <!-- https://github.com/leandromoreira/ffmpeg-libav-tutorial -->
package/build/index.d.ts CHANGED
@@ -1,52 +1,55 @@
1
- export type MakeTransmuxerOptions = {
2
- /** Path that will be used to locate the .wasm file imported from the worker */
3
- publicPath: string;
4
- /** Path that will be used to locate the javascript worker file */
5
- workerUrl: string;
6
- workerOptions?: WorkerOptions;
7
- getStream: (offset: number, size?: number) => Promise<ReadableStream<Uint8Array>>;
8
- subtitle: (title: string, language: string, data: string) => Promise<void> | void;
9
- attachment: (filename: string, mimetype: string, buffer: ArrayBuffer) => Promise<void> | void;
10
- length: number;
11
- bufferSize: number;
12
- };
13
- export type Dialogue = {
14
- index: number;
15
- data: string;
16
- startTime: number;
17
- endTime: number;
18
- layerIndex: number;
19
- dialogue: string;
20
- };
21
- export type Subtitle = {
22
- streamIndex: number;
23
- language: string;
24
- title: string;
25
- header: string;
26
- dialogues: Dialogue[];
27
- };
28
- export type MediaInfo = {
29
- formatName: string;
30
- mimeType: string;
31
- duration: number;
32
- video_mime_type: string;
33
- audio_mime_type: string;
34
- };
35
- export type Chunk = {
36
- isTrailer: boolean;
37
- offset: number;
38
- buffer: Uint8Array;
39
- pts: number;
40
- duration: number;
41
- pos: number;
42
- };
43
- export declare const makeRemuxer: ({ publicPath, workerUrl, workerOptions, getStream: _getStream, attachment, subtitle: _subtitle, length, bufferSize }: MakeTransmuxerOptions) => Promise<{
44
- init: () => Promise<Chunk>;
45
- destroy: (destroyWorker?: boolean) => void;
46
- read: () => Promise<Chunk>;
47
- seek: (time: number) => Promise<void>;
48
- getInfo: () => Promise<{
49
- input: MediaInfo;
50
- output: MediaInfo;
51
- }>;
52
- }>;
1
+ import type { SubtitleFragment } from './worker';
2
+ export * from './utils';
3
+ export type MakeTransmuxerOptions = {
4
+ /** Path that will be used to locate the .wasm file imported from the worker */
5
+ publicPath: string;
6
+ /** Path that will be used to locate the javascript worker file */
7
+ workerUrl: string;
8
+ workerOptions?: WorkerOptions;
9
+ getStream: (offset: number, size?: number) => Promise<ReadableStream<Uint8Array>>;
10
+ length: number;
11
+ bufferSize: number;
12
+ };
13
+ export declare const makeRemuxer: ({ publicPath, workerUrl, workerOptions, getStream, length, bufferSize }: MakeTransmuxerOptions) => Promise<{
14
+ worker: Worker;
15
+ init: () => Promise<{
16
+ data: ArrayBuffer;
17
+ attachments: import("./worker").Attachment[];
18
+ subtitles: SubtitleFragment[];
19
+ info: {
20
+ input: {
21
+ audioMimeType: string;
22
+ duration: number;
23
+ formatName: string;
24
+ mimeType: string;
25
+ videoMimeType: string;
26
+ };
27
+ output: {
28
+ audioMimeType: string;
29
+ duration: number;
30
+ formatName: string;
31
+ mimeType: string;
32
+ videoMimeType: string;
33
+ };
34
+ };
35
+ }>;
36
+ destroy: () => Promise<void>;
37
+ seek: (timestamp: number) => Promise<{
38
+ data: ArrayBuffer;
39
+ subtitles: SubtitleFragment[];
40
+ offset: number;
41
+ pts: number;
42
+ duration: number;
43
+ cancelled: boolean;
44
+ finished: boolean;
45
+ }>;
46
+ read: () => Promise<{
47
+ data: ArrayBuffer;
48
+ subtitles: SubtitleFragment[];
49
+ offset: number;
50
+ pts: number;
51
+ duration: number;
52
+ cancelled: boolean;
53
+ finished: boolean;
54
+ }>;
55
+ }>;