libav-wasm 0.4.0 → 0.5.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 +1 -0
- package/build/index.d.ts +4 -0
- package/build/index.js +2 -1
- package/build/libav.wasm +0 -0
- package/build/worker.d.ts +23 -2
- package/build/worker.js +534 -493
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -63,6 +63,7 @@ To have C++ autocompletion, put a ffmpeg repo clone folder in the root
|
|
|
63
63
|
|
|
64
64
|
|
|
65
65
|
## Issues to fix / features to implement
|
|
66
|
+
- Try to play around with `sourceBuffer.timestampOffset = res.pts` and always increasing timestamps to not have to re-init on backwards seeks
|
|
66
67
|
- Transcoding
|
|
67
68
|
- Decoding + canvas rendering
|
|
68
69
|
- Thumbnail extraction
|
package/build/index.d.ts
CHANGED
|
@@ -32,6 +32,9 @@ export declare const makeRemuxer: ({ publicPath, workerUrl, workerOptions, getSt
|
|
|
32
32
|
videoMimeType: string;
|
|
33
33
|
};
|
|
34
34
|
};
|
|
35
|
+
chapters: import("./worker").Chapter[];
|
|
36
|
+
indexes: import("./worker").Index[];
|
|
37
|
+
videoExtradata: ArrayBuffer;
|
|
35
38
|
}>;
|
|
36
39
|
destroy: () => Promise<void>;
|
|
37
40
|
seek: (timestamp: number) => Promise<{
|
|
@@ -52,4 +55,5 @@ export declare const makeRemuxer: ({ publicPath, workerUrl, workerOptions, getSt
|
|
|
52
55
|
cancelled: boolean;
|
|
53
56
|
finished: boolean;
|
|
54
57
|
}>;
|
|
58
|
+
readKeyframe: (timestamp: number) => Promise<ArrayBuffer>;
|
|
55
59
|
}>;
|
package/build/index.js
CHANGED
|
@@ -1088,7 +1088,8 @@ const makeRemuxer = async ({
|
|
|
1088
1088
|
worker.terminate();
|
|
1089
1089
|
},
|
|
1090
1090
|
seek: (timestamp) => addTask((abortController) => remuxer.seek(wasmRead(abortController), timestamp)),
|
|
1091
|
-
read: () => addTask((abortController) => remuxer.read(wasmRead(abortController)))
|
|
1091
|
+
read: () => addTask((abortController) => remuxer.read(wasmRead(abortController))),
|
|
1092
|
+
readKeyframe: (timestamp) => addTask((abortController) => remuxer.readKeyframe(wasmRead(abortController), timestamp))
|
|
1092
1093
|
};
|
|
1093
1094
|
};
|
|
1094
1095
|
|
package/build/libav.wasm
CHANGED
|
Binary file
|
package/build/worker.d.ts
CHANGED
|
@@ -25,6 +25,13 @@ export type SubtitleFragment = {
|
|
|
25
25
|
content: string;
|
|
26
26
|
fields: Record<string, string>;
|
|
27
27
|
};
|
|
28
|
+
export interface ThumbnailReadResult {
|
|
29
|
+
data: Uint8Array;
|
|
30
|
+
pts: number;
|
|
31
|
+
duration: number;
|
|
32
|
+
offset: number;
|
|
33
|
+
cancelled: boolean;
|
|
34
|
+
}
|
|
28
35
|
export type Index = {
|
|
29
36
|
index: number;
|
|
30
37
|
timestamp: number;
|
|
@@ -85,6 +92,7 @@ export interface RemuxerInstance {
|
|
|
85
92
|
videoMimeType: string;
|
|
86
93
|
};
|
|
87
94
|
};
|
|
95
|
+
videoExtradata: WASMVector<number>;
|
|
88
96
|
}>;
|
|
89
97
|
destroy: () => void;
|
|
90
98
|
seek: (read: WASMReadFunction, timestamp: number) => Promise<{
|
|
@@ -105,7 +113,7 @@ export interface RemuxerInstance {
|
|
|
105
113
|
cancelled: boolean;
|
|
106
114
|
finished: boolean;
|
|
107
115
|
}>;
|
|
108
|
-
|
|
116
|
+
readKeyframe: (read: WASMReadFunction, timestamp: number) => Promise<ThumbnailReadResult>;
|
|
109
117
|
}
|
|
110
118
|
export type Remuxer = {
|
|
111
119
|
new (options: RemuxerInstanceOptions): RemuxerInstance;
|
|
@@ -129,6 +137,9 @@ export type Remuxer = {
|
|
|
129
137
|
videoMimeType: string;
|
|
130
138
|
};
|
|
131
139
|
};
|
|
140
|
+
chapters: Chapter[];
|
|
141
|
+
indexes: Index[];
|
|
142
|
+
videoExtradata: ArrayBuffer;
|
|
132
143
|
}>;
|
|
133
144
|
destroy: () => void;
|
|
134
145
|
seek: (read: WASMReadFunction, timestamp: number) => Promise<{
|
|
@@ -149,7 +160,13 @@ export type Remuxer = {
|
|
|
149
160
|
cancelled: boolean;
|
|
150
161
|
finished: boolean;
|
|
151
162
|
}>;
|
|
152
|
-
|
|
163
|
+
readKeyframe: (read: WASMReadFunction, timestamp: number) => Promise<{
|
|
164
|
+
data: ArrayBuffer;
|
|
165
|
+
pts: number;
|
|
166
|
+
duration: number;
|
|
167
|
+
offset: number;
|
|
168
|
+
cancelled: boolean;
|
|
169
|
+
}>;
|
|
153
170
|
};
|
|
154
171
|
type WASMVector<T> = {
|
|
155
172
|
size: () => number;
|
|
@@ -183,6 +200,9 @@ declare const resolvers: {
|
|
|
183
200
|
videoMimeType: string;
|
|
184
201
|
};
|
|
185
202
|
};
|
|
203
|
+
chapters: Chapter[];
|
|
204
|
+
indexes: Index[];
|
|
205
|
+
videoExtradata: ArrayBuffer;
|
|
186
206
|
}>;
|
|
187
207
|
seek: (read: ReadFunction, timestamp: number) => Promise<{
|
|
188
208
|
data: ArrayBuffer;
|
|
@@ -202,6 +222,7 @@ declare const resolvers: {
|
|
|
202
222
|
cancelled: boolean;
|
|
203
223
|
finished: boolean;
|
|
204
224
|
}>;
|
|
225
|
+
readKeyframe: (read: ReadFunction, timestamp: number) => Promise<ArrayBuffer>;
|
|
205
226
|
}>;
|
|
206
227
|
};
|
|
207
228
|
export type Resolvers = typeof resolvers;
|