libav-wasm 0.0.0 → 0.1.8
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 +17 -0
- package/build/index.d.ts +61 -0
- package/build/index.js +993 -0
- package/build/libav.wasm +0 -0
- package/build/mp4box.d.ts +121 -0
- package/build/test.d.ts +1 -0
- package/build/utils.d.ts +32 -0
- package/build/worker.d.ts +28 -0
- package/build/worker.js +1565 -0
- package/package.json +34 -3
package/README.md
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
## Intellisense
|
|
2
|
+
To have C++ autocompletion, put a ffmpeg repo clone folder in the root
|
|
3
|
+
`git clone https://github.com/FFmpeg/FFmpeg` & `git clone https://github.com/emscripten-core/emscripten`
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
## Issues to fix / features to implement
|
|
8
|
+
- Transcoding
|
|
9
|
+
- Decoding + canvas rendering
|
|
10
|
+
- Thumbnail extraction
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
<!-- https://www.ffmpeg.org/doxygen/trunk/remuxing_8c-example.html -->
|
|
17
|
+
<!-- https://github.com/leandromoreira/ffmpeg-libav-tutorial -->
|
package/build/index.d.ts
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { SEEK_FLAG, SEEK_WHENCE_FLAG } from './utils';
|
|
2
|
+
export { SEEK_FLAG, SEEK_WHENCE_FLAG };
|
|
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
|
+
read: (offset: number, size: number) => Promise<ArrayBuffer>;
|
|
10
|
+
seek: (currentOffset: number, offset: number, whence: SEEK_WHENCE_FLAG) => Promise<number>;
|
|
11
|
+
subtitle: (title: string, language: string, data: string) => Promise<void> | void;
|
|
12
|
+
attachment: (filename: string, mimetype: string, buffer: ArrayBuffer) => Promise<void> | void;
|
|
13
|
+
write: (params: {
|
|
14
|
+
isHeader: boolean;
|
|
15
|
+
offset: number;
|
|
16
|
+
buffer: Uint8Array;
|
|
17
|
+
pos: number;
|
|
18
|
+
pts: number;
|
|
19
|
+
duration: number;
|
|
20
|
+
}) => Promise<void> | void;
|
|
21
|
+
length: number;
|
|
22
|
+
bufferSize: number;
|
|
23
|
+
};
|
|
24
|
+
export type Dialogue = {
|
|
25
|
+
index: number;
|
|
26
|
+
data: string;
|
|
27
|
+
startTime: number;
|
|
28
|
+
endTime: number;
|
|
29
|
+
layerIndex: number;
|
|
30
|
+
dialogue: string;
|
|
31
|
+
};
|
|
32
|
+
export type Subtitle = {
|
|
33
|
+
streamIndex: number;
|
|
34
|
+
language: string;
|
|
35
|
+
title: string;
|
|
36
|
+
header: string;
|
|
37
|
+
dialogues: Dialogue[];
|
|
38
|
+
};
|
|
39
|
+
export type MediaInfo = {
|
|
40
|
+
formatName: string;
|
|
41
|
+
mimeType: string;
|
|
42
|
+
duration: number;
|
|
43
|
+
};
|
|
44
|
+
export type Chunk = {
|
|
45
|
+
isHeader: boolean;
|
|
46
|
+
offset: number;
|
|
47
|
+
buffer: Uint8Array;
|
|
48
|
+
pts: number;
|
|
49
|
+
duration: number;
|
|
50
|
+
pos: number;
|
|
51
|
+
};
|
|
52
|
+
export declare const makeTransmuxer: ({ publicPath, workerUrl, workerOptions, read: _read, seek: _seek, write: _write, attachment, subtitle: _subtitle, length, bufferSize }: MakeTransmuxerOptions) => Promise<{
|
|
53
|
+
init: () => Promise<void>;
|
|
54
|
+
destroy: (destroyWorker?: boolean) => Promise<void> | undefined;
|
|
55
|
+
process: (timeToProcess: number) => Promise<Chunk[]>;
|
|
56
|
+
seek: (time: number) => Promise<void>;
|
|
57
|
+
getInfo: () => Promise<{
|
|
58
|
+
input: MediaInfo;
|
|
59
|
+
output: MediaInfo;
|
|
60
|
+
}>;
|
|
61
|
+
}>;
|