@@ -1235,45 +1235,6 @@ def test_read_video_from_memory_scripted(self):
1235
1235
)
1236
1236
# FUTURE: check value of video / audio frames
1237
1237
1238
- def test_audio_video_sync (self ):
1239
- """Test if audio/video are synchronised with pyav output."""
1240
- for test_video , config in test_videos .items ():
1241
- full_path = os .path .join (VIDEO_DIR , test_video )
1242
- container = av .open (full_path )
1243
- if not container .streams .audio :
1244
- # Skip if no audio stream
1245
- continue
1246
- start_pts_val , cutoff = 0 , 1
1247
- if container .streams .video :
1248
- video = container .streams .video [0 ]
1249
- arr = []
1250
- for index , frame in enumerate (container .decode (video )):
1251
- if index == cutoff :
1252
- start_pts_val = frame .pts
1253
- if index >= cutoff :
1254
- arr .append (frame .to_rgb ().to_ndarray ())
1255
- visual , _ , info = io .read_video (full_path , start_pts = start_pts_val , pts_unit = 'pts' )
1256
- self .assertAlmostEqual (
1257
- config .video_fps , info ['video_fps' ], delta = 0.0001
1258
- )
1259
- arr = torch .Tensor (arr )
1260
- if arr .shape == visual .shape :
1261
- self .assertGreaterEqual (
1262
- torch .mean (torch .isclose (visual .float (), arr , atol = 1e-5 ).float ()), 0.99 )
1263
-
1264
- container = av .open (full_path )
1265
- if container .streams .audio :
1266
- audio = container .streams .audio [0 ]
1267
- arr = []
1268
- for index , frame in enumerate (container .decode (audio )):
1269
- if index >= cutoff :
1270
- arr .append (frame .to_ndarray ())
1271
- _ , audio , _ = io .read_video (full_path , start_pts = start_pts_val , pts_unit = 'pts' )
1272
- arr = torch .as_tensor (np .concatenate (arr , axis = 1 ))
1273
- if arr .shape == audio .shape :
1274
- self .assertGreaterEqual (
1275
- torch .mean (torch .isclose (audio .float (), arr ).float ()), 0.99 )
1276
-
1277
1238
def test_invalid_file (self ):
1278
1239
set_video_backend ('video_reader' )
1279
1240
with self .assertRaises (RuntimeError ):
0 commit comments