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
12 changes: 12 additions & 0 deletions tests/test_audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@ def test_audio_io_tensor(audio_data, io_tensor_func):
assert np.all(audio_tensor_value == audio_value_value)


@pytest.mark.skipif(
sys.platform == "darwin",
reason="TODO: macOS on GitHub use ffmpeg 5.0, needs update",
)
@pytest.mark.parametrize(
("io_dataset_func"),
[
Expand Down Expand Up @@ -176,6 +180,10 @@ def test_audio_io_dataset(audio_data, io_dataset_func):
assert i == 5760


@pytest.mark.skipif(
sys.platform == "darwin",
reason="TODO: macOS on GitHub use ffmpeg 5.0, needs update",
)
@pytest.mark.parametrize(
("io_tensor_func", "num_parallel_calls"),
[
Expand Down Expand Up @@ -220,6 +228,10 @@ def func(filename, position):
assert item == 2


@pytest.mark.skipif(
sys.platform == "darwin",
reason="TODO: macOS on GitHub use ffmpeg 5.0, needs update",
)
@pytest.mark.parametrize(
("io_dataset_func"),
[
Expand Down
16 changes: 16 additions & 0 deletions tests/test_ffmpeg.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ def fixture_audio_path():
)


@pytest.mark.skipif(
sys.platform == "darwin",
reason="TODO: macOS on GitHub use ffmpeg 5.0, needs update",
)
def test_ffmpeg_io_tensor_audio(audio_path):
"""test_ffmpeg_io_tensor_audio"""
audio = tfio.IOTensor.from_audio(audio_path)
Expand Down Expand Up @@ -78,6 +82,10 @@ def _test_ffmpeg_io_tensor_mkv(video_path):
assert video("v:0").to_tensor().shape == [166, 320, 560, 3]


@pytest.mark.skipif(
sys.platform == "darwin",
reason="TODO: macOS on GitHub use ffmpeg 5.0, needs update",
)
def test_ffmpeg_decode_video(video_path):
"""test_ffmpeg_decode_video"""
content = tf.io.read_file(video_path)
Expand All @@ -87,13 +95,21 @@ def test_ffmpeg_decode_video(video_path):
assert np.abs(video[0] - video[-1]).sum() > 0


@pytest.mark.skipif(
sys.platform == "darwin",
reason="TODO: macOS on GitHub use ffmpeg 5.0, needs update",
)
def test_ffmpeg_decode_video_invalid_content():
"""test_ffmpeg_decode_video_invalid_content"""
content = tf.constant(b"bad-video")
with pytest.raises(tf.errors.InvalidArgumentError):
tfio.experimental.ffmpeg.decode_video(content, 0)


@pytest.mark.skipif(
sys.platform == "darwin",
reason="TODO: macOS on GitHub use ffmpeg 5.0, needs update",
)
def test_ffmpeg_decode_video_invalid_index(video_path):
"""test_ffmpeg_decode_video_invalid_index"""
content = tf.io.read_file(video_path)
Expand Down
8 changes: 8 additions & 0 deletions tests/test_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ def fixture_video_data():
return path, value


@pytest.mark.skipif(
sys.platform == "darwin",
reason="TODO: macOS on GitHub use ffmpeg 5.0, needs update",
)
@pytest.mark.parametrize(
("io_dataset_func"),
[
Expand Down Expand Up @@ -62,6 +66,10 @@ def test_video_io_dataset(video_data, io_dataset_func):
assert i == 166


@pytest.mark.skipif(
sys.platform == "darwin",
reason="TODO: macOS on GitHub use ffmpeg 5.0, needs update",
)
@pytest.mark.parametrize(
("io_dataset_func"),
[
Expand Down