Skip to content

Commit 17693d9

Browse files
authored
Improve README
Updated README to include new features, usage examples, and installation instructions.
1 parent c0766b1 commit 17693d9

File tree

1 file changed

+46
-34
lines changed

1 file changed

+46
-34
lines changed

README.md

Lines changed: 46 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,77 @@
1-
# viteo
1+
<div align="center">
22

3-
High-performance video frame extraction for Apple Silicon using AVFoundation/VideoToolbox with MLX integration.
3+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" height="200px" width="400px" viewBox="0 0 400 100">
4+
<defs>
5+
<linearGradient x1="87.9681034%" y1="50%" x2="1.27351722%" y2="50%" id="linearGradient-1">
6+
<stop offset="0%" stop-color="#174889"></stop>
7+
<stop offset="67.6877392%" stop-color="#7c46ce"></stop>
8+
<stop offset="100%" stop-color="#c1c8ca"></stop>
9+
</linearGradient>
10+
</defs>
11+
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" font-family="Arial-BoldMT, Arial" font-weight="bold">
12+
<g id="gh-banner">
13+
<text id="gh-title-reflection" fill="url(#linearGradient-1)" font-size="72">
14+
<tspan x="200" y="120" text-anchor="middle">viteo</tspan>
15+
</text>
16+
</g>
17+
</g>
18+
</svg>
419

5-
## Usage
20+
**High-performance video frame extraction for Apple Silicon**
21+
22+
[![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)
23+
[![Apple Silicon](https://img.shields.io/badge/platform-Apple%20Silicon-lightgrey.svg)](https://www.apple.com/mac/)
24+
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
25+
26+
</div>
27+
28+
---
29+
30+
- **Hardware-accelerated** extraction using AVFoundation/VideoToolbox
31+
- **MLX native** with direct BGRA frame copy to `mx.array`
32+
- **Lightweight bindings** using `nanobind` and GIL release
33+
- **Pythonic** interface with simple iterators and context managers
34+
35+
<br />
36+
37+
## Getting started
638

739
```python
840
import viteo
941

10-
# Simple iteration
42+
# Simple iteration with context manager
1143
with viteo.open("video.mp4") as frames:
1244
for frame in frames:
1345
# frame is MLX array (height, width, 4) BGRA format
1446
process(frame)
1547

16-
# Or direct extraction
48+
# Direct extraction
1749
extractor = viteo.FrameExtractor("video.mp4")
1850
for frame in extractor:
1951
process(frame)
2052
```
2153

2254
## Installation
2355

24-
> **PyPI package coming very soon!**
56+
> **Note:** PyPI package coming very soon!
57+
58+
### From source
2559

2660
```bash
2761
git clone https://github.com/codeSamuraii/viteo
2862
cd viteo
2963
pip install -v -e .
3064
```
3165

32-
Building/rebuilding the package in editable mode:
66+
#### Rebuilding
67+
3368
```bash
3469
rm -rf dist/
3570
pip install -e . --force-reinstall --no-deps
3671
```
3772

38-
## Key Features
39-
40-
- **Hardware acelerated**: Zero-copy extraction using VideoToolbox with Metal compatibility
41-
- **MLX native**: Direct integration with MLX arrays for GPU-ready processing
42-
- **Optimized bindings**: `nanobind` extension with internal batching and GIL release for maximum throughput
43-
44-
## Architecture
45-
46-
The extension implements a three-layer architecture optimized for performance:
47-
48-
**C++ Core** (`frame_extractor.h/mm`)
49-
- Minimal interface with only essential operations (open, extract_batch, reset)
50-
- Direct CVPixelBuffer to memory copy with fast-path optimization
51-
- Cached video properties and frame-level seeking support
52-
53-
**Objective-C++ Backend**
54-
- AVFoundation/VideoToolbox integration with hardware acceleration
55-
- IOSurface backing and Metal compatibility for GPU transfers
56-
- Native BGRA format to avoid color conversion overhead
57-
58-
**Python Bindings** (`bindings.cpp`)
59-
- Custom iterator using nanobind for minimal overhead
60-
- Direct buffer protocol integration with MLX arrays
61-
- Automatic batch management transparent to users
62-
63-
## License
73+
### Requirements
6474

65-
MIT
75+
- macOS with Apple Silicon (M1/M2/M3/M4)
76+
- Python 3.8+
77+
- MLX framework

0 commit comments

Comments
 (0)