Skip to content
Draft
Changes from all 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
12 changes: 6 additions & 6 deletions test/decoders/test_video_decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,14 +443,14 @@ def test_get_frame_played_at(self, device):
assert isinstance(decoder.get_frame_played_at(6.02).pts_seconds, float)
assert isinstance(decoder.get_frame_played_at(6.02).duration_seconds, float)

def test_get_frame_played_at_h265(self):
@pytest.mark.parametrize("device", cpu_and_cuda())
def test_get_frame_played_at_h265(self, device):
# Non-regression test for https://github.com/pytorch/torchcodec/issues/179
# We don't parametrize with CUDA because the current GPUs on CI do not
# support x265:
# https://github.com/pytorch/torchcodec/pull/350#issuecomment-2465011730
decoder = VideoDecoder(H265_VIDEO.path)
decoder = VideoDecoder(H265_VIDEO.path, device=device)
ref_frame6 = H265_VIDEO.get_frame_data_by_index(5)
assert_frames_equal(ref_frame6, decoder.get_frame_played_at(0.5).data)
assert_frames_equal(
ref_frame6.to(device=device), decoder.get_frame_played_at(0.5).data
)

@pytest.mark.parametrize("device", cpu_and_cuda())
def test_get_frame_played_at_fails(self, device):
Expand Down
Loading