Skip to content

Commit c29dee3

Browse files
author
Daniel Flores
committed
skip webm/windows/ffmpeg6,7
1 parent 206d4e4 commit c29dee3

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
@@ -1389,12 +1385,20 @@ def test_video_encoder_round_trip(self, tmp_path, format):
13891385
assert res > 30
13901386
assert_close(s_frame, rt_frame, atol=atol, rtol=0)
13911387

1388+
@pytest.mark.skipif(in_fbcode(), reason="ffmpeg CLI not available")
13921389
@pytest.mark.skipif(in_fbcode(), reason="ffmpeg CLI not available")
13931390
@pytest.mark.parametrize("format", ("mov", "mp4", "avi", "mkv", "webm", "flv"))
13941391
def test_video_encoder_against_ffmpeg_cli(self, tmp_path, format):
13951392
ffmpeg_version = get_ffmpeg_major_version()
1396-
if format == "webm" and ffmpeg_version == 4:
1397-
pytest.skip("Codec for webm is not available in the FFmpeg4 installation.")
1393+
if format == "webm":
1394+
if ffmpeg_version == 4:
1395+
pytest.skip(
1396+
"Codec for webm is not available in the FFmpeg4 installation."
1397+
)
1398+
if IS_WINDOWS and ffmpeg_version in (6, 7):
1399+
pytest.skip(
1400+
"Codec for webm is not available in the FFmpeg6/7 installation on Windows."
1401+
)
13981402
asset = TEST_SRC_2_720P
13991403
source_frames = self.decode(str(asset.path)).data
14001404
frame_rate = 30

0 commit comments

Comments
 (0)