Celux

Latest version: v0.6.0

Safety actively analyzes 710445 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 6

0.6.0

**New Audio API in `VideoReader`**
**Retrieve Audio Data as a Tensor or File**

A new `.audio` property has been added to `VideoReader`, allowing direct access to the `Audio` object:

python
reader = VideoReader("test.mp4")
if reader.has_audio:
audio = reader.audio Access the audio object
tensor = audio.tensor() Retrieve audio as a PyTorch tensor, 1D. NOTE. THIS HAS BEEN MINIMALLY TESTED
success = audio.file("output.wav") Extract audio to a WAV file


**Audio Class Features**
- **`tensor()`** – Extracts the audio stream as a PyTorch tensor.
- **`file(output_path)`** – Saves the audio to a specified file path.
- **Read-only Properties:**
- `sample_rate`: Audio sample rate in Hz.
- `channels`: Number of audio channels.
- `bit_depth`: Bit depth of the audio.
- `codec`: Audio codec format.
- `bitrate`: Audio bitrate.

Example usage:
python
print(audio.sample_rate) Get the sample rate
print(audio.channels) Number of channels

0.5.8.5

- Fixed an issue with ranges being off by 1 frame.

0.5.8

**Improved Property Access for VideoReader**
- Added direct property access for video metadata.
- Users can now retrieve video properties directly instead of accessing `properties["key"]`.
- Example:
python
reader = VideoReader("test.mp4")
print(reader.width) Instead of video.properties["width"]
print(reader.fps) Instead of video.properties["fps"]


- **Available properties:**
`width, height, fps, min_fps, max_fps, duration, total_frames, pixel_format, has_audio, audio_bitrate, audio_channels, audio_sample_rate, audio_codec, bit_depth, aspect_ratio, codec`

**`__getitem__` Seeking Behavior Update**
- `__getitem__` now only accepts **seconds (float)** for seeking.
- Frame-based seeking (int) is currently **not supported** via `__getitem__`.
- Example usage:
python
reader = VideoReader("test.mp4")
frame = reader[2.5] Seeks to 2.5 seconds into the video

0.5.7

- **New color format support**
Added CPU-based conversions for:
- 12-bit YUV (420, 422, and 444)
- 10-bit YUV444
- ProRes 4444 with alpha (10-bit or 12-bit)
- Anything NOT 8-bit uses `uint-16` tensors.

- **Notes on rawvideo**
Raw `.yuv` files still require specifying resolution and pixel format manually.
(`-f rawvideo -pix_fmt yuv420p -s 1920x1080 …`)
- **IN PROGRESS****

- **Other improvements**
- Minor cleanups in converter classes.
- Updated tests to cover the newly supported pixel formats.

0.5.6.1

= Adusted `__call__` method handling.
- `Int` values seek as frames, `Float` values seek as times.
- Added several tests against `OpenCV` and `FFMPEG` for confirmation on frame/time ranges.
- Added tests for color formats.

0.5.6

= Removed `CUDA` Dependency in favor of CPU decoding. (It's faster anyways.)
- Updated repo + docs
- Tested and adjusted time range-- *should* match `OpenCV` behavior in all cases.
= Looking into color space differences...

Page 1 of 6

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.