use of com.att.aro.core.videoanalysis.pojo.VideoStream in project VideoOptimzer by attdevsupport.
the class AudioStreamImpl method runTest.
@Override
public AbstractBestPracticeResult runTest(PacketAnalyzerResult tracedata) {
result = new AudioStreamResult();
init(result);
int count = 0;
if ((streamingVideoData = tracedata.getStreamingVideoData()) != null && (videoStreamCollection = streamingVideoData.getVideoStreamMap()) != null && MapUtils.isNotEmpty(videoStreamCollection)) {
bpResultType = BPResultType.CONFIG_REQUIRED;
result.setResultExcelText(bpResultType.getDescription());
selectedManifestCount = streamingVideoData.getSelectedManifestCount();
hasSelectedManifest = (selectedManifestCount > 0);
invalidCount = streamingVideoData.getInvalidManifestCount();
if (selectedManifestCount == 0) {
if (invalidCount == videoStreamCollection.size()) {
result.setResultText(invalidManifestsFound);
} else if (invalidCount > 0) {
result.setResultText(noManifestsSelectedMixed);
} else {
result.setResultText(noManifestsSelected);
}
} else if (selectedManifestCount > 1) {
result.setResultText(multipleManifestsSelected);
} else if (hasSelectedManifest) {
for (VideoStream videoStream : videoStreamCollection.values()) {
if (videoStream != null && videoStream.isSelected()) {
count += videoStream.getAudioEventMap().size();
}
}
bpResultType = BPResultType.SELF_TEST;
result.setResultText(MessageFormat.format(textResults, count == 1 ? "was" : "were", count == 0 ? "no" : count, count == 1 ? "" : "s"));
result.setCount(count);
result.setSelfTest(true);
result.setResultExcelText(MessageFormat.format(textExcelResults, bpResultType.getDescription(), getAudioResolutions(videoStreamCollection)));
}
} else {
result.setResultText(noData);
bpResultType = BPResultType.NO_DATA;
result.setResultExcelText(bpResultType.getDescription());
}
result.setResultType(bpResultType);
return result;
}
use of com.att.aro.core.videoanalysis.pojo.VideoStream in project VideoOptimzer by attdevsupport.
the class VideoResultSummary method populateSummary.
private void populateSummary(AROTraceData trace) {
for (AbstractBestPracticeResult bpResult : trace.getBestPracticeResults()) {
if (bpResult.getClass().getName().contains("AROServiceImpl")) {
continue;
}
BestPracticeType bpType = bpResult.getBestPracticeType();
switch(bpType) {
case VIDEO_STALL:
VideoStallResult result = (VideoStallResult) bpResult;
stalls = result.getStallResult();
break;
case NETWORK_COMPARISON:
VideoNetworkComparisonResult ntkResult = (VideoNetworkComparisonResult) bpResult;
ntkComparison = ntkResult.getAvgKbps();
break;
case TCP_CONNECTION:
VideoTcpConnectionResult tcpResult = (VideoTcpConnectionResult) bpResult;
tcpConnection = tcpResult.getTcpConnections();
break;
case BUFFER_OCCUPANCY:
BufferOccupancyResult bufferResult = (BufferOccupancyResult) bpResult;
bufferOccupancy = bufferResult.getMaxBuffer();
populateBufferResult(bufferResult);
break;
case CHUNK_SIZE:
VideoChunkSizeResult segmentSizeResult = (VideoChunkSizeResult) bpResult;
segmentSize = segmentSizeResult.getSegmentSize();
segmentCount = segmentSizeResult.getSegmentCount();
break;
case CHUNK_PACING:
VideoChunkPacingResult segmentPacingResult = (VideoChunkPacingResult) bpResult;
segmentPacing = segmentPacingResult.getChunkPacing();
break;
case VIDEO_REDUNDANCY:
VideoRedundancyResult redundancyResult = (VideoRedundancyResult) bpResult;
duplicate = redundancyResult.getCountDuplicate();
redundancy = redundancyResult.getRedundantPercentage();
break;
case STARTUP_DELAY:
VideoStartUpDelayResult startupDelayResult = (VideoStartUpDelayResult) bpResult;
startUpDelay = startupDelayResult.getStartUpDelay();
break;
case VIDEO_CONCURRENT_SESSION:
VideoConcurrentSessionResult concurrentSessionResult = (VideoConcurrentSessionResult) bpResult;
concurrentSessions = concurrentSessionResult.getMaxConcurrentSessionCount();
break;
default:
break;
}
}
List<Session> allSessions = trace.getAnalyzerResult().getSessionlist();
Map<InetAddress, List<Session>> ipSessionsMap = new HashMap<InetAddress, List<Session>>();
for (Session session : allSessions) {
InetAddress ipAddress = session.getRemoteIP();
if (ipSessionsMap.containsKey(ipAddress)) {
ipSessionsMap.get(ipAddress).add(session);
} else {
List<Session> sess = new ArrayList<Session>();
sess.add(session);
ipSessionsMap.put(ipAddress, sess);
}
}
ipAddress = ipSessionsMap.keySet().size();
ipSessions = allSessions.size();
StreamingVideoData streamingVideoData;
if ((streamingVideoData = trace.getAnalyzerResult().getStreamingVideoData()) == null) {
return;
}
Collection<VideoStream> selectedVideoStreams = streamingVideoData.getVideoStreams();
movieMBytes = calculateMBytes(selectedVideoStreams, false);
totalMBytes = calculateMBytes(selectedVideoStreams, true);
if (trace.getAnalyzerResult().getStreamingVideoData().getStreamingVideoCompiled().getChunkPlayTimeList().isEmpty()) {
startupDelayStatus = false;
} else {
startupDelayStatus = true;
}
}
use of com.att.aro.core.videoanalysis.pojo.VideoStream in project VideoOptimzer by attdevsupport.
the class VideoManifestPanel method refresh.
@Override
public void refresh(AROTraceData analyzerResult) {
segmentTableList.clear();
if (analyzerResult != null && analyzerResult.getAnalyzerResult() != null && analyzerResult.getAnalyzerResult().getStreamingVideoData() != null) {
Collection<VideoStream> videoStreamMap = analyzerResult.getAnalyzerResult().getStreamingVideoData().getVideoStreams();
updateGraphPanels(analyzerResult, videoStreamMap);
int counter = 1;
for (VideoStream videoStream : videoStreamMap) {
if (MapUtils.isNotEmpty(videoStream.getVideoEventMap())) {
SegmentTablePanel segmentPanel = new SegmentTablePanel(videoStream, this.overviewRoute, analyzerResult, aroView, this, counter++);
segmentPanel.setVisible(false);
segmentTableList.add(segmentPanel);
}
}
}
videoManifestPanel.remove(manifestPanel);
manifestPanel = getManifestPanel(analyzerResult);
videoManifestPanel.add(manifestPanel);
videoManifestPanel.updateUI();
}
use of com.att.aro.core.videoanalysis.pojo.VideoStream in project VideoOptimzer by attdevsupport.
the class VideoAdaptiveBitrateLadderImpl method runTest.
@Override
public AbstractBestPracticeResult runTest(PacketAnalyzerResult tracedata) {
BPResultType bpResultType = BPResultType.SELF_TEST;
result = new VideoAdaptiveBitrateLadderResult();
init(result);
qualityMap.clear();
if ((streamingVideoData = tracedata.getStreamingVideoData()) != null && (videoStreamCollection = streamingVideoData.getVideoStreamMap()) != null && MapUtils.isNotEmpty(videoStreamCollection)) {
selectedManifestCount = streamingVideoData.getSelectedManifestCount();
hasSelectedManifest = (selectedManifestCount > 0);
invalidCount = streamingVideoData.getInvalidManifestCount();
bpResultType = BPResultType.CONFIG_REQUIRED;
result.setResultExcelText(bpResultType.getDescription());
if (selectedManifestCount == 0) {
if (invalidCount == videoStreamCollection.size()) {
result.setResultText(invalidManifestsFound);
} else if (invalidCount > 0) {
result.setResultText(noManifestsSelectedMixed);
} else {
result.setResultText(noManifestsSelected);
}
} else if (selectedManifestCount > 1) {
result.setResultText(multipleManifestsSelected);
} else if (hasSelectedManifest) {
QualityTime qualityTime;
double maxTime = 0;
QualityTime maxSection = null;
double videoRatio = 1;
double durationTotal = 0;
Set<String> resolutions = new TreeSet<>();
for (VideoStream videoStream : videoStreamCollection.values()) {
if (videoStream.isSelected() && MapUtils.isNotEmpty(videoStream.getVideoEventMap())) {
videoRatio = PERCENTILE_LINE / videoStream.getDuration();
for (VideoEvent videoEvent : videoStream.getVideoEventMap().values()) {
if (videoEvent.isNormalSegment() && videoEvent.isSelected()) {
resolutions.add(String.valueOf(videoEvent.getResolutionHeight()));
double duration = videoEvent.getDuration();
durationTotal += duration;
Integer track = StringParse.stringToDouble(videoEvent.getQuality(), 0).intValue();
if ((qualityTime = qualityMap.get(track)) != null) {
int count = qualityTime.getCount();
qualityTime.setDuration(qualityTime.getDuration() + duration);
qualityTime.setPercentage(qualityTime.getDuration() * videoRatio);
qualityTime.setBitrateAverage((qualityTime.getBitrateAverage() * count + videoEvent.getBitrate()) / ++count);
qualityTime.setCount(count);
} else {
qualityTime = new QualityTime(videoEvent.getManifest().getVideoName(), 1, track, duration, duration * videoRatio, videoEvent.getResolutionHeight(), videoEvent.getSegmentStartTime(), // bitrateDeclared (kbps)
videoEvent.getChildManifest().getBandwidth() / 1000, // bitrateAverage (kbps)
videoEvent.getBitrate());
qualityMap.put(track, qualityTime);
}
if (maxTime < qualityTime.getDuration()) {
maxTime = qualityTime.getDuration();
maxSection = qualityTime;
}
}
}
}
}
bpResultType = BPResultType.SELF_TEST;
int count = qualityMap.size();
double maxDuration = 0;
double percentage = 0;
int track = 0;
if (maxSection != null) {
maxDuration = maxSection.getDuration();
percentage = maxSection.getPercentage();
track = maxSection.getTrack();
}
result.setResultText(MessageFormat.format(textResults, count == 1 ? "was" : "were", count, count == 1 ? "" : "s", track, String.format("%.2f", maxDuration), String.format("%.2f", percentage), String.format("%.3f", durationTotal)));
result.setResultExcelText(MessageFormat.format(textExcelResults, bpResultType.getDescription(), String.join("p, ", resolutions) + "p"));
} else {
bpResultType = BPResultType.CONFIG_REQUIRED;
result.setResultText(novalidManifestsFound);
result.setResultExcelText(bpResultType.getDescription());
}
result.setResults(qualityMap);
} else {
// No Data
result.setResultText(noData);
bpResultType = BPResultType.NO_DATA;
result.setResultExcelText(bpResultType.getDescription());
}
result.setResultType(bpResultType);
result.setResults(qualityMap);
return result;
}
use of com.att.aro.core.videoanalysis.pojo.VideoStream in project VideoOptimzer by attdevsupport.
the class VideoRedundancyImpl method runTest.
@Override
public AbstractBestPracticeResult runTest(PacketAnalyzerResult tracedata) {
result = new VideoRedundancyResult();
init(result);
if ((streamingVideoData = tracedata.getStreamingVideoData()) != null && (videoStreamCollection = streamingVideoData.getVideoStreamMap()) != null && MapUtils.isNotEmpty(videoStreamCollection)) {
bpResultType = BPResultType.CONFIG_REQUIRED;
result.setResultExcelText(BPResultType.CONFIG_REQUIRED.getDescription());
selectedManifestCount = streamingVideoData.getSelectedManifestCount();
hasSelectedManifest = (selectedManifestCount > 0);
invalidCount = streamingVideoData.getInvalidManifestCount();
if (selectedManifestCount == 0) {
if (invalidCount == videoStreamCollection.size()) {
result.setResultText(invalidManifestsFound);
} else if (invalidCount > 0) {
result.setResultText(noManifestsSelectedMixed);
} else {
result.setResultText(noManifestsSelected);
}
} else if (selectedManifestCount > 1) {
result.setResultText(multipleManifestsSelected);
} else if (hasSelectedManifest) {
for (VideoStream videoStream : videoStreamCollection.values()) {
if (videoStream.isSelected()) {
countDuplicateChunks(videoStream);
break;
}
}
redundantPercentage = calculateRedundantPercentage(countRedundant, countSegment);
bpResultType = Util.checkPassFailorWarning(redundantPercentage, videoPref.getVideoUsagePreference().getSegmentRedundancyWarnVal(), videoPref.getVideoUsagePreference().getSegmentRedundancyFailVal());
result.setResultType(bpResultType);
// TODO: Validate the logic
if (redundantPercentage != 0.0) {
result.setResultText(MessageFormat.format(textResults, (String.format("%d", redundantPercentage))));
result.setResultExcelText(MessageFormat.format(textExcelResults, bpResultType.getDescription(), String.format("%d", redundantPercentage)));
} else {
result.setResultText(MessageFormat.format(textResultPass, redundantPercentage));
result.setResultExcelText(bpResultType.getDescription());
}
result.setRedundantPercentage(redundantPercentage);
result.setSegmentCount(countSegment);
result.setRedundantCount(countRedundant);
result.setDuplicateCount(countDuplicate);
result.setSelfTest(true);
}
} else {
result.setSelfTest(false);
result.setResultText(noData);
bpResultType = BPResultType.NO_DATA;
result.setResultExcelText(bpResultType.getDescription());
}
result.setResultType(bpResultType);
return result;
}
Aggregations