diff --git a/README.md b/README.md index ca0fa4f80..cc82e4d35 100644 --- a/README.md +++ b/README.md @@ -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` | + +
## Benchmark Results @@ -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) - [Audio decoding](https://github.com/pytorch/torchcodec/issues/85) Let us know if you have any feature requests by [opening an diff --git a/docs/source/index.rst b/docs/source/index.rst index b4d623654..c882dc488 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -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 @@ -71,7 +71,7 @@ We achieve these capabilities through: :caption: Examples and tutorials :hidden: - install_instructions + Installation instructions generated_examples/index diff --git a/docs/source/install_instructions.rst b/docs/source/install_instructions.rst deleted file mode 100644 index 1242c24ba..000000000 --- a/docs/source/install_instructions.rst +++ /dev/null @@ -1,32 +0,0 @@ -Installation Instructions -========================= - -.. note:: - TorchCodec is only available on Linux for now. We plan to support other - platforms in the future. - -There are three steps to installing TorchCodec: - -1. Install the latest stable version of PyTorch following the - `official instructions `_. TorchCodec - requires `PyTorch 2.4 `_. - -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 later version, install - it with: - - .. code:: bash - - conda install ffmpeg - # or - conda install ffmpeg -c conda-forge -3. Install TorchCodec: - - .. code:: bash - - pip install torchcodec - -Note that installation instructions may slightly change over time. The most -up-to-date instructions should be available from the `README -`_. diff --git a/src/torchcodec/decoders/_core/video_decoder_ops.py b/src/torchcodec/decoders/_core/video_decoder_ops.py index d4102ae5d..d3f8e9a6c 100644 --- a/src/torchcodec/decoders/_core/video_decoder_ops.py +++ b/src/torchcodec/decoders/_core/video_decoder_ops.py @@ -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. 3. Another runtime dependency; see exceptions below. The following exceptions were raised as we tried to load libtorchcodec: """