Skip to content

Commit 79ade05

Browse files
committed
Merge branch 'main' of github.com:pytorch/torchcodec into audio_support
2 parents 90d7409 + 492a6bc commit 79ade05

File tree

13 files changed

+639
-347
lines changed

13 files changed

+639
-347
lines changed

.github/workflows/cpp_tests.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ jobs:
1919
strategy:
2020
fail-fast: false
2121
matrix:
22-
ffmpeg-version-for-tests: ['4.4.2', '5.1.2', '6.1.1', '7.0.1']
22+
# TODO put back 6.1.1. See
23+
# https://github.com/pytorch/torchcodec/issues/518
24+
ffmpeg-version-for-tests: ['4.4.2', '5.1.2', '7.0.1']
2325
steps:
2426
- name: Check out repo
2527
uses: actions/checkout@v3

.github/workflows/docs.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,6 @@ jobs:
7575
uses: pytorch/test-infra/.github/actions/setup-miniconda@main
7676
with:
7777
python-version: ${{ matrix.python-version }}
78-
#
79-
# For some reason nvidia::libnpp=12.4 doesn't install but nvidia/label/cuda-12.4.0::libnpp does.
80-
# So we use the latter convention for libnpp.
8178
# We install conda packages at the start because otherwise conda may have conflicts with dependencies.
8279
default-packages: "nvidia/label/cuda-${{ matrix.cuda-version }}.0::libnpp nvidia::cuda-nvrtc=${{ matrix.cuda-version }} nvidia::cuda-toolkit=${{ matrix.cuda-version }} nvidia::cuda-cudart=${{ matrix.cuda-version }} nvidia::cuda-driver-dev=${{ matrix.cuda-version }} conda-forge::ffmpeg=${{ matrix.ffmpeg-version-for-tests }}"
8380
- name: Check env

.github/workflows/linux_cuda_wheel.yaml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,10 @@ jobs:
6666
# For the actual release we should add that label and change this to
6767
# include more python versions.
6868
python-version: ['3.9']
69-
cuda-version: ['11.8', '12.4', '12.6']
69+
cuda-version: ['11.8', '12.6']
7070
# TODO: put back ffmpeg 5 https://github.com/pytorch/torchcodec/issues/325
71-
ffmpeg-version-for-tests: ['6', '7']
71+
ffmpeg-version-for-tests: ['4.4.2', '6', '7']
72+
7273
container:
7374
image: "pytorch/manylinux2_28-builder:cuda${{ matrix.cuda-version }}"
7475
options: "--gpus all -e NVIDIA_DRIVER_CAPABILITIES=video,compute,utility"
@@ -88,9 +89,6 @@ jobs:
8889
uses: pytorch/test-infra/.github/actions/setup-miniconda@main
8990
with:
9091
python-version: ${{ matrix.python-version }}
91-
#
92-
# For some reason nvidia::libnpp=12.4 doesn't install but nvidia/label/cuda-12.4.0::libnpp does.
93-
# So we use the latter convention for libnpp.
9492
# We install conda packages at the start because otherwise conda may have conflicts with dependencies.
9593
default-packages: "nvidia/label/cuda-${{ matrix.cuda-version }}.0::libnpp nvidia::cuda-nvrtc=${{ matrix.cuda-version }} nvidia::cuda-toolkit=${{ matrix.cuda-version }} nvidia::cuda-cudart=${{ matrix.cuda-version }} nvidia::cuda-driver-dev=${{ matrix.cuda-version }} conda-forge::ffmpeg=${{ matrix.ffmpeg-version-for-tests }}"
9694
- name: Check env
@@ -141,7 +139,7 @@ jobs:
141139
${CONDA_RUN} python test/decoders/manual_smoke_test.py
142140
- name: Run Python tests
143141
run: |
144-
${CONDA_RUN} FAIL_WITHOUT_CUDA=1 pytest test -vvv
142+
${CONDA_RUN} FAIL_WITHOUT_CUDA=1 pytest test -v --tb=short
145143
- name: Run Python benchmark
146144
run: |
147145
${CONDA_RUN} time python benchmarks/decoders/gpu_benchmark.py --devices=cuda:0,cpu --resize_devices=none

README.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -146,14 +146,12 @@ First, make sure you have a GPU that has NVDEC hardware that can decode the
146146
format you want. Refer to Nvidia's GPU support matrix for more details
147147
[here](https://developer.nvidia.com/video-encode-and-decode-gpu-support-matrix-new).
148148

149-
1. Install CUDA Toolkit. Pytorch and TorchCodec supports CUDA Toolkit
150-
versions 11.8, 12.1 or 12.4. In particular TorchCodec depends on
151-
CUDA libraries libnpp and libnvrtc (which are part of CUDA Toolkit).
149+
1. Install Pytorch corresponding to your CUDA Toolkit using the
150+
[official instructions](https://pytorch.org/get-started/locally/). You'll
151+
need the `libnpp` and `libnvrtc` CUDA libraries, which are usually part of
152+
the CUDA Toolkit.
152153

153-
2. Install Pytorch that corresponds to your CUDA Toolkit version using the
154-
[official instructions](https://pytorch.org/get-started/locally/).
155-
156-
3. Install or compile FFmpeg with NVDEC support.
154+
2. Install or compile FFmpeg with NVDEC support.
157155
TorchCodec with CUDA should work with FFmpeg versions in [5, 7].
158156

159157
If FFmpeg is not already installed, or you need a more recent version, an
@@ -184,13 +182,13 @@ format you want. Refer to Nvidia's GPU support matrix for more details
184182
ffmpeg -hwaccel cuda -hwaccel_output_format cuda -i test/resources/nasa_13013.mp4 -f null -
185183
```
186184

187-
4. Install TorchCodec by passing in an `--index-url` parameter that corresponds
185+
3. Install TorchCodec by passing in an `--index-url` parameter that corresponds
188186
to your CUDA Toolkit version, example:
189187

190188
```bash
191-
# This corresponds to CUDA Toolkit version 12.4. It should be the same one
189+
# This corresponds to CUDA Toolkit version 12.6. It should be the same one
192190
# you used when you installed PyTorch (If you installed PyTorch with pip).
193-
pip install torchcodec --index-url=https://download.pytorch.org/whl/cu124
191+
pip install torchcodec --index-url=https://download.pytorch.org/whl/cu126
194192
```
195193

196194
Note that without passing in the `--index-url` parameter, `pip` installs
@@ -207,7 +205,10 @@ The top row is a [Mandelbrot](https://ffmpeg.org/ffmpeg-filters.html#mandelbrot)
207205
generated from FFmpeg that has a resolution of 1280x720 at 60 fps and is 120 seconds long.
208206
The bottom row is [promotional video from NASA](https://download.pytorch.org/torchaudio/tutorial-assets/stream-api/NASAs_Most_Scientifically_Complex_Space_Observatory_Requires_Precision-MP4_small.mp4)
209207
that has a resolution of 960x540 at 29.7 fps and is 206 seconds long. Both videos were
210-
encoded with libx264 and yuv420p pixel format.
208+
encoded with libx264 and yuv420p pixel format. All decoders, except for TorchVision, used FFmpeg 6.1.2. TorchVision used FFmpeg 4.2.2.
209+
210+
For TorchCodec, the "approx" label means that it was using [approximate mode](https://pytorch.org/torchcodec/stable/generated_examples/approximate_mode.html)
211+
for seeking.
211212

212213
## Planned future work
213214

38.3 KB
Loading

0 commit comments

Comments
 (0)