openvidu-test-e2e: check frameRate on RecordingUtils

pull/621/head
pabloFuente 2021-04-06 18:03:19 +02:00
parent 12b8087042
commit e15fcebb02
1 changed files with 6 additions and 3 deletions

View File

@ -47,7 +47,7 @@ public class RecordingUtils {
private boolean recordedFileFine(File file, Recording recording, private boolean recordedFileFine(File file, Recording recording,
Function<Map<String, Long>, Boolean> colorCheckFunction) throws IOException { Function<Map<String, Long>, Boolean> colorCheckFunction) throws IOException {
this.checkMultimediaFile(file, recording.hasAudio(), recording.hasVideo(), recording.getDuration(), this.checkMultimediaFile(file, recording.hasAudio(), recording.hasVideo(), recording.getDuration(),
recording.getResolution(), "aac", "h264", true); recording.getResolution(), recording.getFrameRate(), "aac", "h264", true);
boolean isFine = false; boolean isFine = false;
Picture frame; Picture frame;
@ -170,7 +170,7 @@ public class RecordingUtils {
log.info("Duration of {} according to sync metadata json file: {} s", webmFile.getName(), log.info("Duration of {} according to sync metadata json file: {} s", webmFile.getName(),
durationInSeconds); durationInSeconds);
this.checkMultimediaFile(webmFile, recording.hasAudio(), recording.hasVideo(), durationInSeconds, this.checkMultimediaFile(webmFile, recording.hasAudio(), recording.hasVideo(), durationInSeconds,
recording.getResolution(), audioDecoder, videoDecoder, checkAudio); recording.getResolution(), recording.getFrameRate(), audioDecoder, videoDecoder, checkAudio);
webmFile.delete(); webmFile.delete();
} }
@ -181,7 +181,7 @@ public class RecordingUtils {
} }
public void checkMultimediaFile(File file, boolean hasAudio, boolean hasVideo, double duration, String resolution, public void checkMultimediaFile(File file, boolean hasAudio, boolean hasVideo, double duration, String resolution,
String audioDecoder, String videoDecoder, boolean checkAudio) throws IOException { Integer frameRate, String audioDecoder, String videoDecoder, boolean checkAudio) throws IOException {
// Check tracks, duration, resolution, framerate and decoders // Check tracks, duration, resolution, framerate and decoders
MultimediaFileMetadata metadata = new MultimediaFileMetadata(file.getAbsolutePath()); MultimediaFileMetadata metadata = new MultimediaFileMetadata(file.getAbsolutePath());
@ -200,6 +200,9 @@ public class RecordingUtils {
if (resolution != null) { if (resolution != null) {
Assert.assertEquals(resolution, metadata.getVideoWidth() + "x" + metadata.getVideoHeight()); Assert.assertEquals(resolution, metadata.getVideoWidth() + "x" + metadata.getVideoHeight());
} }
if (frameRate != null) {
Assert.assertEquals(frameRate.intValue(), metadata.getFrameRate());
}
Assert.assertTrue(metadata.getVideoDecoder().toLowerCase().contains(videoDecoder)); Assert.assertTrue(metadata.getVideoDecoder().toLowerCase().contains(videoDecoder));
} else if (hasAudio && checkAudio) { } else if (hasAudio && checkAudio) {
Assert.assertTrue(metadata.hasAudio()); Assert.assertTrue(metadata.hasAudio());