|
9 | 9 | import os
|
10 | 10 | from functools import partial
|
11 | 11 |
|
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 |
| - |
20 | 12 | os.environ["TORCH_LOGS"] = "output_code"
|
21 | 13 | import json
|
22 | 14 | import subprocess
|
|
53 | 45 | from .utils import (
|
54 | 46 | all_supported_devices,
|
55 | 47 | assert_frames_equal,
|
| 48 | + assert_tensor_close_on_at_least, |
| 49 | + get_ffmpeg_major_version, |
| 50 | + in_fbcode, |
| 51 | + IS_WINDOWS, |
56 | 52 | NASA_AUDIO,
|
57 | 53 | NASA_AUDIO_MP3,
|
58 | 54 | NASA_VIDEO,
|
|
61 | 57 | SINE_MONO_S32,
|
62 | 58 | SINE_MONO_S32_44100,
|
63 | 59 | SINE_MONO_S32_8000,
|
| 60 | + TEST_SRC_2_720P, |
64 | 61 | unsplit_device_str,
|
65 |
| - TESTSRC2_VIDEO, |
66 | 62 | )
|
67 | 63 |
|
68 | 64 | torch._dynamo.config.capture_dynamic_output_shape_ops = True
|
@@ -1389,12 +1385,20 @@ def test_video_encoder_round_trip(self, tmp_path, format):
|
1389 | 1385 | assert res > 30
|
1390 | 1386 | assert_close(s_frame, rt_frame, atol=atol, rtol=0)
|
1391 | 1387 |
|
| 1388 | + @pytest.mark.skipif(in_fbcode(), reason="ffmpeg CLI not available") |
1392 | 1389 | @pytest.mark.skipif(in_fbcode(), reason="ffmpeg CLI not available")
|
1393 | 1390 | @pytest.mark.parametrize("format", ("mov", "mp4", "avi", "mkv", "webm", "flv"))
|
1394 | 1391 | def test_video_encoder_against_ffmpeg_cli(self, tmp_path, format):
|
1395 | 1392 | 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 | + ) |
1398 | 1402 | asset = TEST_SRC_2_720P
|
1399 | 1403 | source_frames = self.decode(str(asset.path)).data
|
1400 | 1404 | frame_rate = 30
|
|
0 commit comments