Skip to content
Open
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
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,16 @@ request = MediaDecodeRequest(
streams = avtensor.decode_asset(request)
```

By default `fps` keeps the source frame nearest each output timestamp, which
spaces frames unevenly for non-integer ratios (30 -> 24 fps keeps 4 of every 5
frames). `fps_conversion="blend"` cross-fades neighbouring frames instead, and
`fps_conversion="motion"` interpolates along estimated motion (about 1.25x
the cost of the default):

```python
VideoStreamRequest(fps=24.0, fps_conversion="motion")
```

### Decode a time window (seek)

```python
Expand Down
6 changes: 6 additions & 0 deletions avtensor.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ class VideoStreamRequest:
# "raw" when you need the actual HDR signal, e.g. training on PQ
# masters or colorimetric measurement.
hdr_mode: Literal["tonemap", "raw"] | None
# How `fps` resampling builds each output frame: "nearest" (default)
# keeps the nearest source frame (uneven spacing for e.g. 30 -> 24 fps);
# "blend" cross-fades neighbouring frames; "motion" interpolates along
# estimated block motion (about 1.2-1.6x the cost of "nearest").
fps_conversion: Literal["nearest", "blend", "motion"] | None

def __init__(
self,
Expand All @@ -52,6 +57,7 @@ class VideoStreamRequest:
device: str | None = None,
dtype: str | None = None,
hdr_mode: Literal["tonemap", "raw"] | None = None,
fps_conversion: Literal["nearest", "blend", "motion"] | None = None,
): ...

class LoudnessNormalization:
Expand Down
Loading
Loading