
We use SSIM to measure the transcoding quality between. SSIM is a widely used tool that compares the luma channel between two images, and generates a score from 0 to 1 that indicates "how similar" the two images are. In `SsimHelper`, we decode the two videos, extract matching frames and calculates the mean SSIM (SSIM averaged all matching frames) for both videos. Matching frames are referred to as "comparisonFrame" in the CL, which is selected based on the frame number and a user-set comparison interval. For instance, if the interval is 7, then every seventh frames are compared. We use MediaCodec/MediaExtractor to decode the video, and use ImageReader to extract the decoded frame. The SSIM calculation logic is a inspired by and modified from the CTS [MSSIMMatcher](https://cs.android.com/android/platform/superproject/+/master:cts/tests/tests/uirendering/src/android/uirendering/cts/bitmapcomparers/MSSIMComparer.java;l=1?q=mssimcom) that has some errors and extra features we don't need (like handling RGB images). Adds TranscodeQualityTest to ensure high quality transcoding. PiperOrigin-RevId: 430951206
Transformer module
Provides functionality for transforming media files.
Getting the module
The easiest way to get the module is to add it as a gradle dependency:
implementation 'com.google.android.exoplayer:exoplayer-transformer:2.X.X'
where 2.X.X
is the version, which must match the version of the other media
modules being used.
Alternatively, you can clone this GitHub project and depend on the module locally. Instructions for doing this can be found in the top level README.
Using the module
Use of the Transformer module is documented in the developer guide.