@browser-mc/webcodecs-avif 0.0.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 +68 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +119 -0
- package/dist/index.js.map +1 -0
- package/package.json +31 -0
package/README.md
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# @browser-mc/webcodecs-avif
|
|
2
|
+
|
|
3
|
+
WebCodecs AV1 still-image encoder plus a minimal AVIF muxer re-exported from `@browser-mc/media-container`.
|
|
4
|
+
|
|
5
|
+
## Encode A Canvas Source To AVIF
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import { encodeImageToAvif } from '@browser-mc/webcodecs-avif';
|
|
9
|
+
|
|
10
|
+
const bitmap = await createImageBitmap(file);
|
|
11
|
+
const avif = await encodeImageToAvif(bitmap, { quality: 0.72 });
|
|
12
|
+
bitmap.close();
|
|
13
|
+
|
|
14
|
+
await fetch('/upload', {
|
|
15
|
+
method: 'POST',
|
|
16
|
+
body: new Blob([avif], { type: 'image/avif' }),
|
|
17
|
+
});
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Mux An Existing AV1 Still Frame
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
import { muxStillAvif, type EncodedStillAv1 } from '@browser-mc/webcodecs-avif';
|
|
24
|
+
|
|
25
|
+
const encoded: EncodedStillAv1 = {
|
|
26
|
+
chunk: av1Chunk,
|
|
27
|
+
decoderConfig: { codec: 'av01.0.08M.08', codedWidth: 1920, codedHeight: 1080 },
|
|
28
|
+
av1Config,
|
|
29
|
+
width: 1920,
|
|
30
|
+
height: 1080,
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const avif = muxStillAvif(encoded);
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Add Metadata Items
|
|
37
|
+
|
|
38
|
+
```ts
|
|
39
|
+
import { muxStillAvif } from '@browser-mc/webcodecs-avif';
|
|
40
|
+
|
|
41
|
+
const avif = muxStillAvif(encoded, {
|
|
42
|
+
metadata: [
|
|
43
|
+
{
|
|
44
|
+
type: 'Exif',
|
|
45
|
+
data: exifItemPayload,
|
|
46
|
+
name: 'Exif',
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
});
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
`metadata[].data` is the AVIF item payload. For Exif items, callers should include the AVIF Exif item prefix when needed.
|
|
53
|
+
|
|
54
|
+
## Commands
|
|
55
|
+
|
|
56
|
+
```sh
|
|
57
|
+
pnpm --filter @browser-mc/webcodecs-avif build
|
|
58
|
+
pnpm --filter @browser-mc/webcodecs-avif typecheck
|
|
59
|
+
node packages/webcodecs-avif/test/encode-jpeg-to-avif.mjs
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Notes
|
|
63
|
+
|
|
64
|
+
- Requires WebCodecs for encoding/decoding.
|
|
65
|
+
- Alpha is rejected until auxiliary alpha item muxing is implemented.
|
|
66
|
+
- The muxer writes a minimal still-image AVIF and does not preserve arbitrary source AVIF boxes.
|
|
67
|
+
- `av1C`, `pixi`, and `colr` are derived from the AV1 Sequence Header OBU. Profile compatibility brands are emitted only when the encoded image meets the matching AVIF profile constraints.
|
|
68
|
+
- Container-specific mux helpers live in `@browser-mc/media-container`; this package re-exports the AVIF helpers for convenience.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type EncodedStillAv1 } from '@browser-mc/media-container';
|
|
2
|
+
export type { AvifMetadataItem, EncodedStillAv1, MuxStillAvifOptions, } from '@browser-mc/media-container';
|
|
3
|
+
export { findSequenceHeaderObu, makeAv1Config, muxStillAvif, } from '@browser-mc/media-container';
|
|
4
|
+
export type EncodeAvifOptions = {
|
|
5
|
+
quality?: number;
|
|
6
|
+
width?: number;
|
|
7
|
+
height?: number;
|
|
8
|
+
codec?: string;
|
|
9
|
+
bitrate?: number;
|
|
10
|
+
av1Config?: Uint8Array;
|
|
11
|
+
alpha?: 'discard' | 'keep';
|
|
12
|
+
};
|
|
13
|
+
export declare function encodeImageToAv1(source: CanvasImageSource | VideoFrame, options?: EncodeAvifOptions): Promise<EncodedStillAv1>;
|
|
14
|
+
export declare function encodeImageToAvif(source: CanvasImageSource | VideoFrame, options?: EncodeAvifOptions): Promise<Uint8Array>;
|
|
15
|
+
export declare function decodeAv1Still(encoded: EncodedStillAv1): Promise<VideoFrame>;
|
|
16
|
+
export declare function canvasSourceFromBlob(blob: Blob): Promise<ImageBitmap>;
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,KAAK,eAAe,EACrB,MAAM,6BAA6B,CAAC;AAErC,YAAY,EACV,gBAAgB,EAChB,eAAe,EACf,mBAAmB,GACpB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,qBAAqB,EACrB,aAAa,EACb,YAAY,GACb,MAAM,6BAA6B,CAAC;AAErC,MAAM,MAAM,iBAAiB,GAAG;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,UAAU,CAAC;IACvB,KAAK,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;CAC5B,CAAC;AAEF,wBAAsB,gBAAgB,CAAC,MAAM,EAAE,iBAAiB,GAAG,UAAU,EAAE,OAAO,GAAE,iBAAsB,GAAG,OAAO,CAAC,eAAe,CAAC,CA4DxI;AAED,wBAAsB,iBAAiB,CAAC,MAAM,EAAE,iBAAiB,GAAG,UAAU,EAAE,OAAO,GAAE,iBAAsB,GAAG,OAAO,CAAC,UAAU,CAAC,CAEpI;AAED,wBAAsB,cAAc,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,UAAU,CAAC,CAiBlF;AAED,wBAAsB,oBAAoB,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,WAAW,CAAC,CAE3E"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { bytesEqual, concat } from '@browser-mc/binary';
|
|
2
|
+
import { findSequenceHeaderObu, makeAv1Config, muxStillAvif, } from '@browser-mc/media-container';
|
|
3
|
+
export { findSequenceHeaderObu, makeAv1Config, muxStillAvif, } from '@browser-mc/media-container';
|
|
4
|
+
export async function encodeImageToAv1(source, options = {}) {
|
|
5
|
+
assertWebCodecs();
|
|
6
|
+
if (options.alpha === 'keep')
|
|
7
|
+
throw new Error('AVIF alpha is not supported yet; auxiliary alpha items are not muxed');
|
|
8
|
+
const width = options.width ?? sourceWidth(source);
|
|
9
|
+
const height = options.height ?? sourceHeight(source);
|
|
10
|
+
const codec = options.codec ?? 'av01.0.08M.08';
|
|
11
|
+
const bitrate = options.bitrate ?? Math.max(80_000, Math.round(width * height * (options.quality ?? 0.8) * 0.7));
|
|
12
|
+
const support = await VideoEncoder.isConfigSupported({
|
|
13
|
+
codec,
|
|
14
|
+
width,
|
|
15
|
+
height,
|
|
16
|
+
bitrate,
|
|
17
|
+
framerate: 1,
|
|
18
|
+
alpha: options.alpha ?? 'discard',
|
|
19
|
+
latencyMode: 'quality',
|
|
20
|
+
});
|
|
21
|
+
if (!support.supported)
|
|
22
|
+
throw new Error(`VideoEncoder does not support ${codec}`);
|
|
23
|
+
const config = support.config;
|
|
24
|
+
if (!config)
|
|
25
|
+
throw new Error(`VideoEncoder did not return a normalized config for ${codec}`);
|
|
26
|
+
let metadataConfig;
|
|
27
|
+
const chunks = [];
|
|
28
|
+
let rejectEncoderError = () => { };
|
|
29
|
+
const encoderError = new Promise((_, reject) => { rejectEncoderError = reject; });
|
|
30
|
+
const encoder = new VideoEncoder({
|
|
31
|
+
error: rejectEncoderError,
|
|
32
|
+
output: (chunk, metadata) => {
|
|
33
|
+
const bytes = new Uint8Array(chunk.byteLength);
|
|
34
|
+
chunk.copyTo(bytes);
|
|
35
|
+
chunks.push(bytes);
|
|
36
|
+
if (metadata?.decoderConfig)
|
|
37
|
+
metadataConfig = metadata.decoderConfig;
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
let shouldCloseFrame = false;
|
|
41
|
+
const frame = source instanceof VideoFrame ? source : makeFrameFromCanvasSource(source);
|
|
42
|
+
try {
|
|
43
|
+
encoder.configure(config);
|
|
44
|
+
encoder.encode(frame, { keyFrame: true });
|
|
45
|
+
await Promise.race([encoder.flush(), encoderError]);
|
|
46
|
+
}
|
|
47
|
+
finally {
|
|
48
|
+
encoder.close();
|
|
49
|
+
if (shouldCloseFrame)
|
|
50
|
+
frame.close();
|
|
51
|
+
}
|
|
52
|
+
function makeFrameFromCanvasSource(canvasSource) {
|
|
53
|
+
shouldCloseFrame = true;
|
|
54
|
+
return new VideoFrame(canvasSource, { timestamp: 0, duration: 1_000_000 });
|
|
55
|
+
}
|
|
56
|
+
const chunk = concat(chunks);
|
|
57
|
+
const decoderConfig = metadataConfig ?? { codec, codedWidth: width, codedHeight: height, description: options.av1Config };
|
|
58
|
+
const sequenceHeaderObu = findSequenceHeaderObu(chunk);
|
|
59
|
+
if (!sequenceHeaderObu)
|
|
60
|
+
throw new Error('Encoded AV1 chunk does not contain a Sequence Header OBU');
|
|
61
|
+
const generatedAv1Config = makeAv1Config(codec, sequenceHeaderObu);
|
|
62
|
+
if (options.av1Config && !bytesEqual(options.av1Config, generatedAv1Config)) {
|
|
63
|
+
throw new Error('Provided av1Config does not match the encoded AV1 Sequence Header OBU');
|
|
64
|
+
}
|
|
65
|
+
const av1Config = generatedAv1Config;
|
|
66
|
+
return { chunk, decoderConfig, av1Config, width, height };
|
|
67
|
+
}
|
|
68
|
+
export async function encodeImageToAvif(source, options = {}) {
|
|
69
|
+
return muxStillAvif(await encodeImageToAv1(source, options));
|
|
70
|
+
}
|
|
71
|
+
export async function decodeAv1Still(encoded) {
|
|
72
|
+
assertWebCodecs();
|
|
73
|
+
const frame = await new Promise((resolve, reject) => {
|
|
74
|
+
const decoder = new VideoDecoder({
|
|
75
|
+
error: reject,
|
|
76
|
+
output: resolve,
|
|
77
|
+
});
|
|
78
|
+
decoder.configure(encoded.decoderConfig);
|
|
79
|
+
decoder.decode(new EncodedVideoChunk({
|
|
80
|
+
type: 'key',
|
|
81
|
+
timestamp: 0,
|
|
82
|
+
duration: 1_000_000,
|
|
83
|
+
data: encoded.chunk,
|
|
84
|
+
}));
|
|
85
|
+
decoder.flush().then(() => decoder.close(), reject);
|
|
86
|
+
});
|
|
87
|
+
return frame;
|
|
88
|
+
}
|
|
89
|
+
export async function canvasSourceFromBlob(blob) {
|
|
90
|
+
return createImageBitmap(blob);
|
|
91
|
+
}
|
|
92
|
+
function assertWebCodecs() {
|
|
93
|
+
if (typeof VideoEncoder === 'undefined' || typeof VideoDecoder === 'undefined' || typeof VideoFrame === 'undefined') {
|
|
94
|
+
throw new Error('WebCodecs API is not available in this environment');
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
function sourceWidth(source) {
|
|
98
|
+
if (source instanceof VideoFrame)
|
|
99
|
+
return source.displayWidth;
|
|
100
|
+
if ('videoWidth' in source)
|
|
101
|
+
return source.videoWidth;
|
|
102
|
+
if ('naturalWidth' in source)
|
|
103
|
+
return source.naturalWidth;
|
|
104
|
+
if ('width' in source)
|
|
105
|
+
return Number(source.width);
|
|
106
|
+
throw new Error('Cannot determine source width');
|
|
107
|
+
}
|
|
108
|
+
function sourceHeight(source) {
|
|
109
|
+
if (source instanceof VideoFrame)
|
|
110
|
+
return source.displayHeight;
|
|
111
|
+
if ('videoHeight' in source)
|
|
112
|
+
return source.videoHeight;
|
|
113
|
+
if ('naturalHeight' in source)
|
|
114
|
+
return source.naturalHeight;
|
|
115
|
+
if ('height' in source)
|
|
116
|
+
return Number(source.height);
|
|
117
|
+
throw new Error('Cannot determine source height');
|
|
118
|
+
}
|
|
119
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EACL,qBAAqB,EACrB,aAAa,EACb,YAAY,GAEb,MAAM,6BAA6B,CAAC;AAOrC,OAAO,EACL,qBAAqB,EACrB,aAAa,EACb,YAAY,GACb,MAAM,6BAA6B,CAAC;AAYrC,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,MAAsC,EAAE,UAA6B,EAAE;IAC5G,eAAe,EAAE,CAAC;IAClB,IAAI,OAAO,CAAC,KAAK,KAAK,MAAM;QAAE,MAAM,IAAI,KAAK,CAAC,sEAAsE,CAAC,CAAC;IACtH,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,WAAW,CAAC,MAAM,CAAC,CAAC;IACnD,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,YAAY,CAAC,MAAM,CAAC,CAAC;IACtD,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,eAAe,CAAC;IAC/C,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,MAAM,GAAG,CAAC,OAAO,CAAC,OAAO,IAAI,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;IAEjH,MAAM,OAAO,GAAG,MAAM,YAAY,CAAC,iBAAiB,CAAC;QACnD,KAAK;QACL,KAAK;QACL,MAAM;QACN,OAAO;QACP,SAAS,EAAE,CAAC;QACZ,KAAK,EAAE,OAAO,CAAC,KAAK,IAAI,SAAS;QACjC,WAAW,EAAE,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,OAAO,MAAM,CAAC,YAAY,CAAC;IACzD,IAAI,OAAO,IAAI,MAAM;QAAE,OAAO,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACnD,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;AACnD,CAAC;AAED,SAAS,YAAY,CAAC,MAAsC;IAC1D,IAAI,MAAM,YAAY,UAAU;QAAE,OAAO,MAAM,CAAC,aAAa,CAAC;IAC9D,IAAI,aAAa,IAAI,MAAM;QAAE,OAAO,MAAM,CAAC,WAAW,CAAC;IACvD,IAAI,eAAe,IAAI,MAAM;QAAE,OAAO,MAAM,CAAC,aAAa,CAAC;IAC3D,IAAI,QAAQ,IAAI,MAAM;QAAE,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACrD,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;AACpD,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@browser-mc/webcodecs-avif",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"types": "./dist/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"import": "./dist/index.js"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"@browser-mc/binary": "^0.0.1",
|
|
15
|
+
"@browser-mc/media-container": "^0.0.1"
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist",
|
|
19
|
+
"README.md"
|
|
20
|
+
],
|
|
21
|
+
"publishConfig": {
|
|
22
|
+
"access": "public"
|
|
23
|
+
},
|
|
24
|
+
"scripts": {
|
|
25
|
+
"prebuild": "pnpm --filter @browser-mc/media-container build",
|
|
26
|
+
"build": "tsc -p tsconfig.json",
|
|
27
|
+
"pretypecheck": "pnpm --filter @browser-mc/media-container build",
|
|
28
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
29
|
+
"test": "pnpm build"
|
|
30
|
+
}
|
|
31
|
+
}
|