Skip to content

Commit 2055291

Browse files
author
Daniel Flores
committed
skip webm/windows/ffmpeg6,7
1 parent 5f2928f commit 2055291

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed

src/torchcodec/_core/Encoder.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,6 @@ VideoEncoder::VideoEncoder(
583583

584584
void VideoEncoder::initializeEncoder(
585585
const VideoStreamOptions& videoStreamOptions) {
586-
av_log_set_level(AV_LOG_VERBOSE);
587586
const AVCodec* avCodec =
588587
avcodec_find_encoder(avFormatContext_->oformat->video_codec);
589588
TORCH_CHECK(avCodec != nullptr, "Video codec not found");

test/test_ops.py

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,6 @@
99
import os
1010
from functools import partial
1111

12-
from .utils import (
13-
assert_tensor_close_on_at_least,
14-
get_ffmpeg_major_version,
15-
in_fbcode,
16-
IS_WINDOWS,
17-
TEST_SRC_2_720P,
18-
)
19-
2012
os.environ["TORCH_LOGS"] = "output_code"
2113
import json
2214
import subprocess
@@ -53,6 +45,10 @@
5345
from .utils import (
5446
all_supported_devices,
5547
assert_frames_equal,
48+
assert_tensor_close_on_at_least,
49+
get_ffmpeg_major_version,
50+
in_fbcode,
51+
IS_WINDOWS,
5652
NASA_AUDIO,
5753
NASA_AUDIO_MP3,
5854
NASA_VIDEO,
@@ -61,8 +57,8 @@
6157
SINE_MONO_S32,
6258
SINE_MONO_S32_44100,
6359
SINE_MONO_S32_8000,
60+
TEST_SRC_2_720P,
6461
unsplit_device_str,
65-
TESTSRC2_VIDEO,
6662
)
6763

6864
torch._dynamo.config.capture_dynamic_output_shape_ops = True
@@ -1431,12 +1427,20 @@ def test_video_encoder_round_trip(self, tmp_path, format):
14311427
assert res > 30
14321428
assert_close(s_frame, rt_frame, atol=atol, rtol=0)
14331429

1430+
@pytest.mark.skipif(in_fbcode(), reason="ffmpeg CLI not available")
14341431
@pytest.mark.skipif(in_fbcode(), reason="ffmpeg CLI not available")
14351432
@pytest.mark.parametrize("format", ("mov", "mp4", "avi", "mkv", "webm", "flv"))
14361433
def test_video_encoder_against_ffmpeg_cli(self, tmp_path, format):
14371434
ffmpeg_version = get_ffmpeg_major_version()
1438-
if format == "webm" and ffmpeg_version == 4:
1439-
pytest.skip("Codec for webm is not available in the FFmpeg4 installation.")
1435+
if format == "webm":
1436+
if ffmpeg_version == 4:
1437+
pytest.skip(
1438+
"Codec for webm is not available in the FFmpeg4 installation."
1439+
)
1440+
if IS_WINDOWS and ffmpeg_version in (6, 7):
1441+
pytest.skip(
1442+
"Codec for webm is not available in the FFmpeg6/7 installation on Windows."
1443+
)
14401444
asset = TEST_SRC_2_720P
14411445
source_frames = self.decode(str(asset.path)).data
14421446
frame_rate = 30

0 commit comments

Comments
 (0)