mirror of
https://github.com/samsonjs/media.git
synced 2026-03-29 10:05:48 +00:00
Add an SSIM test with 360p input
This test should run on all devices from API 21 (the media uses Baseline profile level 3.0 H.264) to give us coverage of the full pipeline (forcing re-encoding) and SSIM calculation on all devices. PiperOrigin-RevId: 443650002
This commit is contained in:
parent
5a3ed3421b
commit
6443d5b840
3 changed files with 29 additions and 0 deletions
|
|
@ -57,6 +57,10 @@ public final class AndroidTestUtil {
|
|||
.setFrameRate(30.00f)
|
||||
.build();
|
||||
|
||||
/** Baseline profile level 3.0 H.264 stream, which should be supported on all devices. */
|
||||
public static final String MP4_ASSET_WITH_INCREASING_TIMESTAMPS_360P_15S_URI_STRING =
|
||||
"asset:///media/mp4/sample_with_increasing_timestamps_360p.mp4";
|
||||
|
||||
public static final String MP4_ASSET_SEF_URI_STRING =
|
||||
"asset:///media/mp4/sample_sef_slow_motion.mp4";
|
||||
public static final Format MP4_ASSET_SEF_FORMAT =
|
||||
|
|
|
|||
|
|
@ -86,4 +86,29 @@ public final class TranscodeQualityTest {
|
|||
|
||||
assertThat(result.ssim).isGreaterThan(0.90);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void transcodeAvcToAvc360p_ssimIsGreaterThan90Percent() throws Exception {
|
||||
Context context = ApplicationProvider.getApplicationContext();
|
||||
String testId = "transcodeAvcToAvc360p_ssim";
|
||||
|
||||
// Note: We never skip this test as the input and output formats should be within CDD
|
||||
// requirements on all supported API versions.
|
||||
|
||||
Transformer transformer =
|
||||
new Transformer.Builder(context)
|
||||
.setTransformationRequest(
|
||||
new TransformationRequest.Builder().setVideoMimeType(MimeTypes.VIDEO_H264).build())
|
||||
.setEncoderFactory(AndroidTestUtil.FORCE_ENCODE_ENCODER_FACTORY)
|
||||
.setRemoveAudio(true)
|
||||
.build();
|
||||
|
||||
TransformationTestResult result =
|
||||
new TransformerAndroidTestRunner.Builder(context, transformer)
|
||||
.setCalculateSsim(true)
|
||||
.build()
|
||||
.run(testId, AndroidTestUtil.MP4_ASSET_WITH_INCREASING_TIMESTAMPS_360P_15S_URI_STRING);
|
||||
|
||||
assertThat(result.ssim).isGreaterThan(0.90);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
BIN
testdata/src/test/assets/media/mp4/sample_with_increasing_timestamps_360p.mp4
vendored
Normal file
BIN
testdata/src/test/assets/media/mp4/sample_with_increasing_timestamps_360p.mp4
vendored
Normal file
Binary file not shown.
Loading…
Reference in a new issue