Skip to content

Commit

Permalink
DOC: build from source for now (pytorch#133)
Browse files Browse the repository at this point in the history
Summary: Pull Request resolved: pytorch#133

Reviewed By: scotts, ahmadsharif1

Differential Revision: D60521151

Pulled By: NicolasHug

fbshipit-source-id: 2f36e8a649d9f9aa44eeadecbbe15f26ed4bc1eb
  • Loading branch information
NicolasHug authored and facebook-github-bot committed Jul 31, 2024
1 parent 699e8c6 commit 361968f
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 36 deletions.
39 changes: 23 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,38 +81,45 @@ ffmpeg -f lavfi -i \

## Installing TorchCodec

Note: if you're on MacOS, you'll need to [build from source](./CONTRIBUTING.md).
Instructions below assume you're on Linux.

First install the latest stable version of PyTorch following the [official
We'll be providing wheels in the coming days so that you can just install
torchcodec using `pip`. For now, you can just build from source. You will need
the following dependencies:

- A C++ compiler+linker. This is typically available on a baseline Linux
installation already.
- cmake
- pkg-config
- FFmpeg
- PyTorch nightly

Start by installing PyTorch following the [official
instructions](https://pytorch.org/get-started/locally/).

Then:
Then, the easiest way to install the rest of the dependencies is to run:

```bash
pip install torchcodec
conda install cmake pkg-config ffmpeg -c conda-forge
```
You will also need FFmpeg installed on your system, and TorchCodec decoding
capabilities are determined by your underlying FFmpeg installation. There are
different options to install FFmpeg e.g.:

To clone and install the repo, run:

```bash
conda install ffmpeg
# or
conda install ffmpeg -c conda-forge
git clone [email protected]:pytorch/torchcodec.git
# Or, using https instead of ssh: git clone https://github.com/pytorch/torchcodec.git
cd torchcodec

pip install -e ".[dev]" --no-build-isolation -vv
```

Your Linux distribution probably comes with FFmpeg pre-installed as well.
TorchCodec supports all major FFmpeg version in [4, 7].


## Planned future work

We are actively working on the following features:

- Ship wheels for Linux, so that Linux users can `pip install torchcodec`.
- [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).
that MacOS users can `pip install torchcodec`.
- [GPU decoding](https://github.com/pytorch/torchcodec/pull/58)
- [Audio decoding](https://github.com/pytorch/torchcodec/issues/85)

Expand Down
38 changes: 18 additions & 20 deletions docs/source/install_instructions.rst
Original file line number Diff line number Diff line change
@@ -1,32 +1,30 @@
Installation Instructions
=========================

.. note::
TorchCodec is only available on Linux for now. We plan to support other
platforms in the future.
We'll be providing wheels in the coming days so that you can just install
torchcodec using ``pip``. For now, you can just build from source. You will need
the following dependencies:

Installing torchcodec should be as simple as:
- A C++ compiler+linker. This is typically available on a baseline Linux
installation already.
- cmake
- pkg-config
- FFmpeg
- PyTorch nightly

.. code:: bash
Start by installing PyTorch following the `official instructions
<https://pytorch.org/get-started/locally/>`_.

pip install torchcodec
Then, the easiest way to install the rest of the dependencies is to run:

You will need a working PyTorch installation, which you can install following
the `official instructions <https://pytorch.org/get-started/locally/>`_.
conda install cmake pkg-config ffmpeg -c conda-forge

You will also need FFmpeg installed on your system, and TorchCodec decoding
capabilities are determined by your underlying FFmpeg installation. There are
different options to install FFmpeg e.g.:
To clone and install the repo, run:

.. code:: bash
git clone [email protected]:pytorch/torchcodec.git
# Or, using https instead of ssh: git clone https://github.com/pytorch/torchcodec.git
cd torchcodec

conda install ffmpeg
# or
conda install ffmpeg -c conda-forge
pip install -e ".[dev]" --no-build-isolation -vv

Your Linux distribution probably comes with FFmpeg pre-installed as well.
TorchCodec supports all major FFmpeg version in [4, 7].

Note that installation instructions may slightly change over time. The most
up-to-date instructions should be available from the `README
<https://github.com/pytorch/torchcodec?tab=readme-ov-file#installing-torchcodec>`_.

0 comments on commit 361968f

Please sign in to comment.