libav-wasm 0.4.0 → 0.5.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 +1 -0
- package/build/index.d.ts +5 -0
- package/build/index.js +2 -1
- package/build/libav.wasm +0 -0
- package/build/worker.d.ts +26 -2
- package/build/worker.js +554 -510
- 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<{
|
|
@@ -51,5 +54,7 @@ export declare const makeRemuxer: ({ publicPath, workerUrl, workerOptions, getSt
|
|
|
51
54
|
duration: number;
|
|
52
55
|
cancelled: boolean;
|
|
53
56
|
finished: boolean;
|
|
57
|
+
thumbnailData: Uint8Array;
|
|
54
58
|
}>;
|
|
59
|
+
readKeyframe: (timestamp: number) => Promise<ArrayBuffer>;
|
|
55
60
|
}>;
|
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<{
|
|
@@ -104,8 +112,9 @@ export interface RemuxerInstance {
|
|
|
104
112
|
duration: number;
|
|
105
113
|
cancelled: boolean;
|
|
106
114
|
finished: boolean;
|
|
115
|
+
thumbnailData: Uint8Array;
|
|
107
116
|
}>;
|
|
108
|
-
|
|
117
|
+
readKeyframe: (read: WASMReadFunction, timestamp: number) => Promise<ThumbnailReadResult>;
|
|
109
118
|
}
|
|
110
119
|
export type Remuxer = {
|
|
111
120
|
new (options: RemuxerInstanceOptions): RemuxerInstance;
|
|
@@ -129,6 +138,9 @@ export type Remuxer = {
|
|
|
129
138
|
videoMimeType: string;
|
|
130
139
|
};
|
|
131
140
|
};
|
|
141
|
+
chapters: Chapter[];
|
|
142
|
+
indexes: Index[];
|
|
143
|
+
videoExtradata: ArrayBuffer;
|
|
132
144
|
}>;
|
|
133
145
|
destroy: () => void;
|
|
134
146
|
seek: (read: WASMReadFunction, timestamp: number) => Promise<{
|
|
@@ -148,8 +160,15 @@ export type Remuxer = {
|
|
|
148
160
|
duration: number;
|
|
149
161
|
cancelled: boolean;
|
|
150
162
|
finished: boolean;
|
|
163
|
+
thumbnailData: Uint8Array;
|
|
164
|
+
}>;
|
|
165
|
+
readKeyframe: (read: WASMReadFunction, timestamp: number) => Promise<{
|
|
166
|
+
data: ArrayBuffer;
|
|
167
|
+
pts: number;
|
|
168
|
+
duration: number;
|
|
169
|
+
offset: number;
|
|
170
|
+
cancelled: boolean;
|
|
151
171
|
}>;
|
|
152
|
-
seekInputConvert: (read: WASMReadFunction, byteOffsetOrTimestamp: number, isTimestamp: boolean) => Promise<number>;
|
|
153
172
|
};
|
|
154
173
|
type WASMVector<T> = {
|
|
155
174
|
size: () => number;
|
|
@@ -183,6 +202,9 @@ declare const resolvers: {
|
|
|
183
202
|
videoMimeType: string;
|
|
184
203
|
};
|
|
185
204
|
};
|
|
205
|
+
chapters: Chapter[];
|
|
206
|
+
indexes: Index[];
|
|
207
|
+
videoExtradata: ArrayBuffer;
|
|
186
208
|
}>;
|
|
187
209
|
seek: (read: ReadFunction, timestamp: number) => Promise<{
|
|
188
210
|
data: ArrayBuffer;
|
|
@@ -201,7 +223,9 @@ declare const resolvers: {
|
|
|
201
223
|
duration: number;
|
|
202
224
|
cancelled: boolean;
|
|
203
225
|
finished: boolean;
|
|
226
|
+
thumbnailData: Uint8Array;
|
|
204
227
|
}>;
|
|
228
|
+
readKeyframe: (read: ReadFunction, timestamp: number) => Promise<ArrayBuffer>;
|
|
205
229
|
}>;
|
|
206
230
|
};
|
|
207
231
|
export type Resolvers = typeof resolvers;
|