Metrics¶
The Video Analyzer SDK provides comprehensive quality metrics for each analyzed video frame through the SingleFrameMetrics
class.
Please obtain the actual metric values through the getXXX()
methods.
Available Metrics¶
Note
As this is still in beta, we may add or change metrics in future releases, and the value ranges may be adjusted.
Metric Name | Type | Value Range | Description |
---|---|---|---|
getBlockiness() |
double |
0-? | Blockiness measurement |
getBlockinessRaw() |
double |
0-? | Blockiness measurement, raw score |
getBlockinessVp9() |
double |
0-? | Blockiness measurement, VP9 variant |
getBlurriness() |
double |
0-1 | Blurriness measurement |
getBlurrinessRaw() |
double |
0-? | Blurriness measurement, raw score |
getBrightness() |
double |
0-1 | Average gray value |
getSaturation() |
double |
0-1 | S of the HSV representation, scaled |
getContrast() |
double |
0-1 | Contrast by ratio of 1st and 99th percentile |
getContrastMichelson() |
double |
0-1 | Michelson contrast |
getSumOfHighFrequencies() |
double |
? | Sum of high frequencies based on radial profile |
getNoise() |
double |
? | Noise detection |
getWhiteLevel() |
double |
0-1 | Irregular white levels (higher is worse) |
getBlackLevel() |
double |
0-1 | Irregular black levels (higher is worse) |
getFineDetail() |
double |
0-1 | High details present (higher is worse) |
getSceneScore() |
double |
? | Scene change detection score |
getSadNormalized() |
double |
0-1 | SAD against previous frame, normalized by pixel count |
getTemporalInformation() |
double |
0-? | Temporal complexity based on ITU-T P.910 |
getSpatialInformation() |
double |
0-? | Spatial complexity based on ITU-T P.910 |
getJerkiness() |
double |
0-1 | Jerkiness based on count of repeated frames in a group |
getBlackScreen() |
boolean |
true/false | Whether this is a completely black screen |
getFreezing() |
boolean |
true/false | Whether frame is freezing based on simple SAD estimate |
getSceneChange() |
boolean |
true/false | Whether scene changed based on simple SAD estimate |
Checking Metric Availability¶
Not all metrics may be available for every frame. Always check availability before using metric values:
Method 1: Using Has Methods¶
public void processMetrics(SingleFrameMetrics metrics) {
// Check availability before using
if (metrics.hasBlurriness()) {
double blur = metrics.getBlurriness();
// use blur value
}
if (metrics.hasBrightness()) {
double brightness = metrics.getBrightness();
// use brightness value
}
if (metrics.hasTemporalInformation()) {
double temporal = metrics.getTemporalInformation();
// use temporal value
}
}
Method 2: Checking for NaN Values¶
public void processMetrics(SingleFrameMetrics metrics) {
// Metrics return NaN if not available
double contrast = metrics.getContrast();
if (!Double.isNaN(contrast)) {
// use contrast value
}
double noise = metrics.getNoise();
if (!Double.isNaN(noise)) {
// use noise value
}
}
Performance and Selective Metric Calculation¶
Processing all metrics for every frame can be resource-intensive. Consider:
- Sampling frames (analyze every Nth frame)
- Selective metric calculation based on use case (see below)
- Adjusting analysis frequency based on device performance
The VideoAnalyzer SDK supports selective calculation of metrics to improve performance when you only need specific measurements. This can significantly reduce CPU usage and battery consumption on mobile devices.
Enabling Specific Features Only¶
To calculate only specific metrics, use the VideoAnalyzer.createForManualFramesWithFeatures
builder method with enabled features:
import com.aveq.videoanalyzer.VideoAnalyzer;
import com.aveq.videoanalyzer.StringSet;
// Create a set of features to enable
StringSet enabledFeatures = new StringSet();
enabledFeatures.add("BlurrinessFeature");
enabledFeatures.add("BlockinessFeature");
enabledFeatures.add("BrightnessFeature");
// Create analyzer with only specified features enabled
VideoAnalyzer analyzer = VideoAnalyzer.createForManualFramesWithFeatures(
null, // displayWidth
null, // displayHeight
null, // fps
enabledFeatures, // Only these features will be calculated
new StringSet(), // No disabled features
0, 0, 0, 0 // No crop area
);
Disabling Specific Features¶
To calculate all metrics except certain ones, use the disabled features parameter:
// Create a set of features to disable
StringSet disabledFeatures = new StringSet();
disabledFeatures.add("NoiseFeature"); // Computationally expensive
disabledFeatures.add("RadialProfileFeature"); // Not needed for this use case
// Create analyzer with specified features disabled
VideoAnalyzer analyzer = VideoAnalyzer.createForManualFramesWithFeatures(
null, // displayWidth
null, // displayHeight
null, // fps
new StringSet(), // All features enabled by default
disabledFeatures, // Except these
0, 0, 0, 0 // No crop area
);
The following feature names can be used for selective calculation:
Feature Name | Metrics Provided |
---|---|
BlockinessFeature |
blockiness, blockiness_raw, blockiness_vp9 |
BlurrinessFeature |
blurriness, blurriness_raw |
BrightnessFeature |
brightness |
BlackScreenFeature |
black_screen |
SaturationFeature |
saturation |
ContrastFeature |
contrast, contrast_michelson |
RadialProfileFeature |
sum_of_high_frequencies |
NoiseFeature |
noise |
AutoEnhancementFeature |
white_level, black_level |
FineDetailFeature |
fine_detail |
TemporalChangeFeature |
freezing, scene_change, scene_score, sad_normalized, temporal_information |
SpatialComplexityFeature |
spatial_information |
JerkinessFeature |
jerkiness |