Skip to content
Merged
Show file tree
Hide file tree
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
15 changes: 14 additions & 1 deletion test/test_decoders.py
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,9 @@ def test_get_frame_at_av1(self, device):
if device == "cuda" and get_ffmpeg_major_version() == 4:
return

if device == "cuda" and in_fbcode():
pytest.skip("AV1 decoding on CUDA is not supported internally")

decoder = VideoDecoder(AV1_VIDEO.path, device=device)
ref_frame10 = AV1_VIDEO.get_frame_data_by_index(10)
ref_frame_info10 = AV1_VIDEO.get_frame_info(10)
Expand Down Expand Up @@ -1292,6 +1295,10 @@ def setup_frame_mappings(tmp_path, file, stream_index):
# Return the custom frame mappings as a JSON string
return custom_frame_mappings

@pytest.mark.skipif(
in_fbcode(),
reason="ffprobe not available internally",
)
@pytest.mark.parametrize("device", all_supported_devices())
@pytest.mark.parametrize("stream_index", [0, 3])
@pytest.mark.parametrize(
Expand Down Expand Up @@ -1338,12 +1345,16 @@ def test_custom_frame_mappings_json_and_bytes(
),
)

@pytest.mark.skipif(
in_fbcode(),
reason="ffprobe not available internally",
)
@pytest.mark.parametrize("device", all_supported_devices())
@pytest.mark.parametrize(
"custom_frame_mappings,expected_match",
[
pytest.param(
NASA_VIDEO.generate_custom_frame_mappings(0),
None,
"seek_mode",
id="valid_content_approximate",
),
Expand All @@ -1361,6 +1372,8 @@ def test_custom_frame_mappings_json_and_bytes(
def test_custom_frame_mappings_init_fails(
self, device, custom_frame_mappings, expected_match
):
if custom_frame_mappings is None:
custom_frame_mappings = NASA_VIDEO.generate_custom_frame_mappings(0)
with pytest.raises(ValueError, match=expected_match):
VideoDecoder(
NASA_VIDEO.path,
Expand Down
10 changes: 10 additions & 0 deletions test/test_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
import os
from functools import partial

from .utils import in_fbcode

os.environ["TORCH_LOGS"] = "output_code"
import json
import subprocess
Expand Down Expand Up @@ -480,6 +482,10 @@ def test_frame_pts_equality(self):
)
assert pts_is_equal

@pytest.mark.skipif(
in_fbcode(),
reason="ffprobe not available internally",
)
def test_seek_mode_custom_frame_mappings_fails(self):
decoder = create_from_file(
str(NASA_VIDEO.path), seek_mode="custom_frame_mappings"
Expand All @@ -506,6 +512,10 @@ def test_seek_mode_custom_frame_mappings_fails(self):
decoder, stream_index=0, custom_frame_mappings=different_lengths
)

@pytest.mark.skipif(
in_fbcode(),
reason="ffprobe not available internally",
)
@pytest.mark.parametrize("device", all_supported_devices())
def test_seek_mode_custom_frame_mappings(self, device):
stream_index = 3 # custom_frame_index seek mode requires a stream index
Expand Down
Loading