Skip to content
Merged
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
51 changes: 29 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,29 +94,40 @@ ffmpeg -f lavfi -i \

## Installing TorchCodec

Note: if you're on MacOS, you'll need to [build from source](./CONTRIBUTING.md).
The instructions below assume you're on Linux.
1. Install the latest stable version of PyTorch following the
[official instructions](https://pytorch.org/get-started/locally/). For other
versions, refer to the table below for compatibility between versions of
`torch` and `torchcodec`.

1. Install the latest stable version of PyTorch following the
[official instructions](https://pytorch.org/get-started/locally/). TorchCodec
requires [PyTorch 2.4](https://pytorch.org/docs/2.4/).
2. Install FFmpeg, if it's not already installed. Linux distributions usually
come with FFmpeg pre-installed. TorchCodec supports all major FFmpeg versions
in [4, 7].

2. Install FFmpeg, if it's not already installed. Your Linux distribution probably
comes with FFmpeg pre-installed. TorchCodec supports all major FFmpeg versions
in [4, 7].
If FFmpeg is not already installed, or you need a more recent version, an
easy way to install it is to use `conda`:

If FFmpeg is not already installed, or you need a later version, install it with:
```bash
conda install ffmpeg
# or
conda install ffmpeg -c conda-forge
```

```bash
conda install ffmpeg
# or
conda install ffmpeg -c conda-forge
```
3. Install TorchCodec:
3. Install TorchCodec:

```bash
pip install torchcodec
```
```bash
pip install torchcodec
```

The following table indicates the compatibility between versions of
`torchcodec`, `torch` and Python.

| `torchcodec` | `torch` | Python |
| ------------------ | ------------------ | ------------------- |
| `main` / `nightly` | `main` / `nightly` | `>=3.9`, `<=3.12` |
| not yet supported | `2.5` | `>=3.9`, `<=3.12` |
| `0.0.3` | `2.4` | `>=3.8`, `<=3.12` |
Comment on lines +124 to +128
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to have a torchcodec with cuda column here too?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if I understand correctly. The CPU and CUDA version of torchcodec should have the same expected pytorch version?


<details>

## Benchmark Results

Expand All @@ -134,10 +145,6 @@ encoded with libx264 and yuv420p pixel format.

We are actively working on the following features:

- [Ship wheels for MacOS](https://github.com/pytorch/torchcodec/issues/111), so
that MacOS users can `pip install torchcodec`. For now this is only supported
on Linux, but MacOS users can [build from source](./CONTRIBUTING.md).
- [GPU decoding](https://github.com/pytorch/torchcodec/pull/58)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drive-by

- [Audio decoding](https://github.com/pytorch/torchcodec/issues/85)

Let us know if you have any feature requests by [opening an
Expand Down
4 changes: 2 additions & 2 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ We achieve these capabilities through:
.. grid-item-card:: :octicon:`file-code;1em`
Installation instructions
:img-top: _static/img/card-background.svg
:link: install_instructions.html
:link: https://github.com/pytorch/torchcodec?tab=readme-ov-file#installing-torchcodec
:link-type: url

How to install TorchCodec
Expand Down Expand Up @@ -71,7 +71,7 @@ We achieve these capabilities through:
:caption: Examples and tutorials
:hidden:

install_instructions
Installation instructions <https://github.com/pytorch/torchcodec?tab=readme-ov-file#installing-torchcodec>
generated_examples/index


Expand Down
32 changes: 0 additions & 32 deletions docs/source/install_instructions.rst

This file was deleted.

9 changes: 6 additions & 3 deletions src/torchcodec/decoders/_core/video_decoder_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,13 @@ def load_torchcodec_extension():
+ "\n[end of libtorchcodec loading traceback]."
)
raise RuntimeError(
"""Could not load libtorchcodec. Likely causes:
f"""Could not load libtorchcodec. Likely causes:
1. FFmpeg is not properly installed in your environment. We support
verisons 4, 5, 6 and 7.
2. PyTorch 2.4 is not properly installed in your environment.
versions 4, 5, 6 and 7.
2. The PyTorch version ({torch.__version__}) is not compatible with
this version of TorchCodec. Refer to the version compatibility
table:
https://github.com/pytorch/torchcodec?tab=readme-ov-file#installing-torchcodec.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sadly it's impossible to tell users which version of torchcodec they're using, because the torchcodec module isn't fully initialized at this point. There's also no point telling them "you can figure it out by doing python -c 'import torchcodec; print(torchcodec.__version__)'" because it is precisely the import torchcodec` part that is triggering the RuntimeError of the above message.

3. Another runtime dependency; see exceptions below.
The following exceptions were raised as we tried to load libtorchcodec:
"""
Expand Down
Loading