Skip to content

get_frames_by_pts() RuntimeError: Expected at most 2 arguments but received 3 #779

@mrezabayat

Description

@mrezabayat

🐛 Describe the bug

Hi,

I’m encountering a runtime error when running the benchmark script torchcodec/benchmarks/decoders/benchmark_decoders.py. This appears to be related to the number of arguments passed to the get_frames_by_pts function.

Here is how I am running the script:

python benchmarks/decoders/benchmark_decoders.py \
  --video-paths ../sample_videos/Barcelona_vc6.mxf,../sample_videos/Barcelona_h264.mxf \
  --decoders torchcodec_core \
  --plot-path codec_comparison.png \
  --min-run-seconds 2.0 \
  --verify-outputs \
  --verbose

Here is the full call stack:

Traceback (most recent call last):
  File "/home/mohammad.bayat/dev/torchcodec/benchmarks/decoders/benchmark_decoders.py", line 167, in <module>
    main()
  File "/home/mohammad.bayat/dev/torchcodec/benchmarks/decoders/benchmark_decoders.py", line 139, in main
    verify_outputs(decoders_to_run, video_paths, num_uniform_samples)
  File "/home/mohammad.bayat/dev/torchcodec/benchmarks/decoders/benchmark_decoders_library.py", line 1069, in verify_outputs
    frames = decode_and_adjust_frames(
  File "/home/mohammad.bayat/dev/torchcodec/benchmarks/decoders/benchmark_decoders_library.py", line 1085, in decode_and_adjust_frames
    non_seq_frames = decoder.decode_frames(video_file_path, pts_list)
  File "/home/mohammad.bayat/dev/torchcodec/benchmarks/decoders/benchmark_decoders_library.py", line 243, in decode_frames
    frames, *_ = get_frames_by_pts(
  File "/home/mohammad.bayat/dev/torchcodec/.venv/lib/python3.10/site-packages/torch/_ops.py", line 756, in __call__
    return self._op(*args, **kwargs)
RuntimeError: torchcodec_ns::get_frames_by_pts() expected at most 2 argument(s) but received 3 argument(s). Declaration: torchcodec_ns::get_frames_by_pts(Tensor(a!) decoder, *, float[] timestamps) -> (Tensor, Tensor, Tensor)

Versions

Package                  Version
------------------------ -----------
certifi                  2025.7.9
charset-normalizer       3.4.2
contourpy                1.3.2
cycler                   0.12.1
filelock                 3.18.0
fonttools                4.58.5
fsspec                   2025.5.1
idna                     3.10
Jinja2                   3.1.6
kiwisolver               1.4.8
MarkupSafe               3.0.2
matplotlib               3.10.3
mpmath                   1.3.0
networkx                 3.4.2
numpy                    2.2.6
nvidia-cublas-cu12       12.6.4.1
nvidia-cuda-cupti-cu12   12.6.80
nvidia-cuda-nvrtc-cu12   12.6.77
nvidia-cuda-runtime-cu12 12.6.77
nvidia-cudnn-cu12        9.5.1.17
nvidia-cufft-cu12        11.3.0.4
nvidia-cufile-cu12       1.11.1.6
nvidia-curand-cu12       10.3.7.77
nvidia-cusolver-cu12     11.7.1.2
nvidia-cusparse-cu12     12.5.4.2
nvidia-cusparselt-cu12   0.6.3
nvidia-nccl-cu12         2.26.2
nvidia-nvjitlink-cu12    12.6.85
nvidia-nvtx-cu12         12.6.77
packaging                25.0
pandas                   2.3.1
pillow                   11.3.0
pip                      22.0.2
pyparsing                3.2.3
python-dateutil          2.9.0.post0
pytz                     2025.2
requests                 2.32.4
setuptools               59.6.0
six                      1.17.0
sympy                    1.14.0
torch                    2.7.1
torchaudio               2.7.1
torchcodec               0.4.0
torchvision              0.22.1
triton                   3.3.1
typing_extensions        4.14.1
tzdata                   2025.2
urllib3                  2.5.0

OS: Ubuntu 22.04

Python: 3.10.12

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions