Skip to content
Open
Show file tree
Hide file tree
Changes from 4 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
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,10 @@ format you want. Refer to Nvidia's GPU support matrix for more details
conda install -c conda-forge "torchcodec=*=*cuda*"
```

### Specify FFmpeg Path Manually

If torchcodec cannot detect the FFmpeg installation correctly, you can set the `TORCHCODEC_FFMPEG_DIR` environment variable to the directory containing the FFmpeg DLLs.
Comment thread
bcw222 marked this conversation as resolved.
Outdated

## Benchmark Results

The following was generated by running [our benchmark script](./benchmarks/decoders/generate_readme_data.py) on a lightly loaded 22-core machine with an Nvidia A100 with
Expand Down
13 changes: 8 additions & 5 deletions src/torchcodec/_core/ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,15 @@
# On windows we try to locate the FFmpeg DLLs and temporarily add them to
# the DLL search path. This seems to be needed on some users machine, but
# not on our CI. We don't know why.
if ffmpeg_path := shutil.which("ffmpeg"):

def expose_ffmpeg_dlls(): # noqa: F811
ffmpeg_dir = Path(ffmpeg_path).parent.absolute()
return os.add_dll_directory(str(ffmpeg_dir)) # that's the actual CM
if ffmpeg_dir := os.getenv("TORCHCODEC_FFMPEG_DIR"):
def expose_ffmpeg_dlls():
return os.add_dll_directory(str(ffmpeg_dir))
Comment thread
bcw222 marked this conversation as resolved.
Outdated
else:
if ffmpeg_path := shutil.which("ffmpeg"):

def expose_ffmpeg_dlls(): # noqa: F811
ffmpeg_dir = Path(ffmpeg_path).parent
return os.add_dll_directory(str(ffmpeg_dir)) # that's the actual CM

with expose_ffmpeg_dlls():
ffmpeg_major_version, core_library_path, _pybind_ops = (
Expand Down
Loading