Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ jobs:
"$prefix/bin/ffmpeg" -version
- name: Static checks
run: |
ruff check src/tensorcodec av/python tests scripts benchmarks/image_codecs.py
ruff format --check src/tensorcodec av/python tests scripts benchmarks/image_codecs.py
ruff check src/tensorcodec av/python tests scripts benchmarks/image_codecs.py benchmarks/transform_bench.py
ruff format --check src/tensorcodec av/python tests scripts benchmarks/image_codecs.py benchmarks/transform_bench.py
cargo fmt --manifest-path av/Cargo.toml --check
cargo clippy --manifest-path av/Cargo.toml --locked -- -D warnings
- name: Build tensorcodec-av against prebuilt FFmpeg and install tensorcodec
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ with VideoDecoder("video.mkv", seek_mode="timestamp") as decoder:
frames = decoder.get_frames_played_at([10.0, 10.1, 10.2])
```

Decoder transforms (since v0.1.5) resize and crop inside the decoder, as TorchCodec's do:
Decoder transforms (since v0.1.5) resize and crop inside the decoder:

```python
from tensorcodec.transforms import CenterCrop, Resize
Expand All @@ -69,6 +69,10 @@ with VideoDecoder("video.mp4", transforms=[Resize((256, 340)), CenterCrop((224,
frames = decoder.get_frames_at([0, 10]) # (2, 3, 224, 224)
```

Crops select the same pixels as TorchCodec's. Since v0.4.2, `Resize` scales in YUV while converting
to RGB, so it costs no more than native-size output; its pixels differ from TorchCodec's by about
0.9 levels on average (see [resizing](docs/compatibility.md#resizing)).

This TensorCodec extension selects by actual PTS and retries seeks that overshoot.
It supports time queries, including ranges with explicit `fps`, but not frame
indices, `len(decoder)`, or `get_all_frames()`. See [the contract](docs/compatibility.md#timestamp-mode).
Expand Down
2 changes: 1 addition & 1 deletion av/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion av/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "tensorcodec-av"
version = "0.4.1"
version = "0.4.2"
edition = "2021"
rust-version = "1.88" # ffmpeg-sys-next 9 builds with let chains
license = "Apache-2.0"
Expand Down
Loading
Loading