Metadata-Version: 2.4
Name: rv565
Version: 1.1.0
Summary: Read, write and check RV565 frame-independent RGB565 video files; Pillow plugin included.
Author-email: Ayushman Bhattacharya <ayushman.elixpo@gmail.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/elixpo/rv565
Project-URL: Documentation, https://github.com/elixpo/rv565/tree/main/python#readme
Project-URL: Paper, https://arxiv.org/abs/2610.35935
Project-URL: Issues, https://github.com/elixpo/rv565/issues
Keywords: rgb565,video,esp32,st7789,microcontroller,pillow,arduino
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Multimedia :: Video :: Conversion
Classifier: Topic :: Software Development :: Embedded Systems
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: pillow
Requires-Dist: Pillow>=10.1; extra == "pillow"
Dynamic: license-file

# rv565 for Python

Read, write and check [RV565](https://github.com/elixpo/rv565) video files:
independently zlib-compressed RGB565 frames, the format the RV565 library
plays at 24 FPS on ESP32-S3 SPI displays
([arXiv:2610.35935](https://arxiv.org/abs/2610.35935)).

```bash
pip install rv565            # core and the `rv565` command, no dependencies
pip install "rv565[pillow]"  # plus the Pillow plugin
```

## Command line

```bash
rv565 encode input.mp4 clip.rv565 --size 180x135 --fps 24   # needs FFmpeg
rv565 info clip.rv565        # sizes and predicted missed frames on ESP32-S3
rv565 verify clip.rv565
rv565 c-array clip.rv565 clip.h   # for Arduino sketches
```

## Library

```python
import rv565

clip = rv565.open("clip.rv565")
print(clip.width, clip.height, clip.fps, len(clip))
frame = clip.frame(0)                     # RGB565 big-endian bytes, O(1) seek
report = clip.check_schedule(overlap=True)
print(report.late_frames)                 # 0: plays without misses (ESP32-S3 model)

rv565.write("out.rv565", 180, 135, 24, frames)   # frames: RGB565BE bytes each
```

## Pillow

```python
import rv565.pillow                       # registers the format
from PIL import Image, ImageSequence

with Image.open("clip.rv565") as im:      # mode "RGB", im.n_frames, im.info["fps"]
    frames = [f.copy() for f in ImageSequence.Iterator(im)]

frames[0].save("out.rv565", save_all=True, append_images=frames[1:], fps=24)
```

Any image sequence Pillow can open (GIF, APNG, WebP) can be saved as RV565 the
same way; colours are reduced to RGB565.

## License

MIT.
