-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathllms.txt
More file actions
106 lines (81 loc) · 2.58 KB
/
llms.txt
File metadata and controls
106 lines (81 loc) · 2.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# node-webcodecs
> Native WebCodecs API implementation for Node.js using FFmpeg
## Overview
node-webcodecs brings the W3C WebCodecs API to Node.js and Bun, enabling frame-level video/audio encoding and decoding with hardware acceleration support.
## Quick Links
- Installation & Setup
- Quick Start Examples
- API Reference
- Codec Information
- Advanced Features
- Complete Examples
- Troubleshooting
## Package Details
- **Version**: 1.0.0
- **Runtime Support**: Node.js 18+, Bun 1.0+
- **Repository**: https://github.com/caseymanos/node-webcodecs
- **npm**: https://www.npmjs.com/package/node-webcodecs
- **Website**: https://node-webcodecs.com
## Key Features
- W3C WebCodecs API compatible - same API as browser WebCodecs
- Non-blocking async encoding/decoding with worker thread pool
- Hardware acceleration: VideoToolbox (macOS), NVENC (NVIDIA), QSV (Intel), VAAPI (Linux)
- Video codecs: H.264/AVC, H.265/HEVC, VP8, VP9, AV1
- Audio codecs: AAC, Opus, FLAC, MP3
- ImageDecoder for JPEG, PNG, GIF, WebP, BMP
- Native codec probing with isConfigSupported
- HDR support: BT.2020, PQ (HDR10), HLG
- Alpha channel support (VP8/VP9)
- Scalability modes for temporal layer SVC
- Latency and bitrate control modes
- Full TypeScript support
## Installation
```bash
npm install node-webcodecs
# or
bun add node-webcodecs
```
**Platform Dependencies:**
macOS (Homebrew):
```bash
brew install ffmpeg pkg-config
```
Ubuntu/Debian:
```bash
sudo apt-get install build-essential pkg-config libavcodec-dev libavutil-dev libswscale-dev libswresample-dev
```
## Full Documentation
For complete documentation including all API details, examples, and troubleshooting:
- llms-full.txt - Complete documentation in a single file
- README.md - Primary documentation
- examples/ - Working code examples
## Quick Example
```javascript
const { VideoEncoder, VideoFrame } = require('node-webcodecs');
const encoder = new VideoEncoder({
output: (chunk, metadata) => {
console.log(`Encoded: ${chunk.byteLength} bytes`);
},
error: (err) => console.error(err),
});
encoder.configure({
codec: 'avc1.42E01E', // H.264 Baseline
width: 640,
height: 480,
bitrate: 1_000_000,
});
const frame = new VideoFrame(rgbaBuffer, {
format: 'RGBA',
codedWidth: 640,
codedHeight: 480,
timestamp: 0,
});
encoder.encode(frame, { keyFrame: true });
frame.close();
await encoder.flush();
encoder.close();
```
## Support
- GitHub Issues: https://github.com/caseymanos/node-webcodecs/issues
- Documentation: https://github.com/caseymanos/node-webcodecs#readme
- Examples: https://github.com/caseymanos/node-webcodecs/tree/main/examples