Search in sources :

Example 11 with VideoStream

use of com.att.aro.core.videoanalysis.pojo.VideoStream in project VideoOptimzer by attdevsupport.

the class VideoBufferPlot method calculateBufferProgress.

/*
	 * called by:
	 *  -> VideoBufferPlot.VideoBufferPlot(AROTraceData, VideoStream)
	 *     -> SegmentBufferGraphPanel.refresh(AROTraceData, VideoStream, JCheckBox, JCheckBox)
	 */
public void calculateBufferProgress(AROTraceData aroTraceData) {
    bufferProgressSeries.clear();
    if (aroTraceData != null && aroTraceData.getAnalyzerResult().getStreamingVideoData() != null) {
        for (VideoStream videoStream : aroTraceData.getAnalyzerResult().getStreamingVideoData().getVideoStreams()) {
            if (videoStream.isSelected()) {
                LOGGER.debug("VideoStream :" + videoStream.getManifest().getVideoName());
                for (XYPair xy : videoStream.getPlayTimeList()) {
                    bufferProgressSeries.add(xy.getXVal(), xy.getYVal());
                }
            }
        }
    }
    minYValue = bufferProgressSeries.getMinY();
    maxYValue = bufferProgressSeries.getMaxY();
    minXValue = bufferProgressSeries.getMinX();
    maxXValue = bufferProgressSeries.getMaxX();
}
Also used : VideoStream(com.att.aro.core.videoanalysis.pojo.VideoStream) XYPair(com.att.aro.core.videoanalysis.XYPair)

Example 12 with VideoStream

use of com.att.aro.core.videoanalysis.pojo.VideoStream in project VideoOptimzer by attdevsupport.

the class SegmentTablePanel method updateTitleButton.

public void updateTitleButton(AROTraceData analyzerResult) {
    if (titlePanel != null) {
        if (analyzerResult.getAnalyzerResult() != null) {
            streamingVideoData = analyzerResult.getAnalyzerResult().getStreamingVideoData();
            for (VideoStream manifest : streamingVideoData.getVideoStreamMap().values()) {
                if (manifest.equals(videoStream) && ((!videoStream.getVideoEventsBySegment().isEmpty()) && ((VideoEvent) videoStream.getVideoEventsBySegment().toArray()[0]).getSegmentID() >= 0)) {
                    videoStream.setSelected(manifest.isSelected());
                    enableCheckBox.setSelected(videoStream.isSelected());
                    streamingVideoData.setValidatedCount(false);
                    break;
                }
            }
            if (streamingVideoData.getValidatedCount()) {
                streamingVideoData.scanVideoStreams();
            }
        }
    }
}
Also used : VideoStream(com.att.aro.core.videoanalysis.pojo.VideoStream) VideoEvent(com.att.aro.core.videoanalysis.pojo.VideoEvent)

Example 13 with VideoStream

use of com.att.aro.core.videoanalysis.pojo.VideoStream in project VideoOptimzer by attdevsupport.

the class VideoManifestPanel method updateGraphPanels.

public void updateGraphPanels(AROTraceData analyzerResult, Collection<VideoStream> videoStreamMap) {
    VideoTab videoTab = aroView.getVideoTab();
    if (videoStreamMap != null && videoStreamMap.size() > 0) {
        Iterator<VideoStream> videoStreamIterator = videoStreamMap.iterator();
        while (videoStreamIterator.hasNext()) {
            VideoStream videoStream = videoStreamIterator.next();
            SegmentThroughputGraphPanel throughputGraphPanel = videoTab.getThroughputGraphPanel();
            SegmentProgressGraphPanel progressGraphPanel = videoTab.getProgressGraphPanel();
            SegmentBufferGraphPanel bufferGraphPanel = videoTab.getBufferGraphPanel();
            if (videoStream.getVideoSegmentEventList().size() > 0 || videoStream.getAudioSegmentEventList().size() > 0) {
                throughputGraphPanel.refresh(analyzerResult, videoStream, null, null);
                progressGraphPanel.refresh(analyzerResult, videoStream, null, null);
                boolean isStartupDelaySet = (videoStream.getPlayRequestedTime() != null || videoStream.getVideoPlayBackTime() != null);
                if (isStartupDelaySet && videoStream.isCurrentStream()) {
                    bufferGraphPanel.refresh(analyzerResult, videoStream, null, null);
                }
                boolean isGraphVisible = videoStreamMap.size() == 1;
                toggleGraphPanels(videoTab, isGraphVisible, isStartupDelaySet);
            } else {
                toggleGraphPanels(videoTab, false, false);
            }
        }
    } else {
        toggleGraphPanels(videoTab, false, false);
    }
}
Also used : VideoStream(com.att.aro.core.videoanalysis.pojo.VideoStream)

Example 14 with VideoStream

use of com.att.aro.core.videoanalysis.pojo.VideoStream in project VideoOptimzer by attdevsupport.

the class VideoNetworkComparisonImpl method runTest.

@Override
public AbstractBestPracticeResult runTest(PacketAnalyzerResult tracedata) {
    BPResultType bpResultType = BPResultType.SELF_TEST;
    double avgKbps = 0.0;
    double avgBitRate = 0.0;
    double summaryBitRate = 0.0;
    VideoNetworkComparisonResult result = new VideoNetworkComparisonResult();
    init(result);
    SortedMap<Integer, SegmentComparison> qualityMap = new TreeMap<>();
    if ((streamingVideoData = tracedata.getStreamingVideoData()) != null && (videoStreamCollection = streamingVideoData.getVideoStreamMap()) != null && MapUtils.isNotEmpty(videoStreamCollection)) {
        selectedCount = streamingVideoData.getSelectedManifestCount();
        invalidCount = streamingVideoData.getInvalidManifestCount();
        List<VideoEvent> filteredVideoSegment = filterVideoSegment(streamingVideoData);
        if (selectedCount == 0) {
            if (invalidCount == videoStreamCollection.size()) {
                result.setResultText(invalidManifestsFound);
            } else if (invalidCount > 0) {
                result.setResultText(noManifestsSelectedMixed);
            } else {
                result.setResultText(noManifestsSelected);
            }
            bpResultType = BPResultType.CONFIG_REQUIRED;
            result.setResultExcelText(BPResultType.CONFIG_REQUIRED.getDescription());
            result.setSelfTest(false);
        } else if (selectedCount > 1) {
            bpResultType = BPResultType.CONFIG_REQUIRED;
            result.setResultText(multipleManifestsSelected);
            result.setResultExcelText(BPResultType.CONFIG_REQUIRED.getDescription());
            result.setSelfTest(false);
        } else {
            SegmentComparison segmentComparison;
            for (VideoStream videoStream : videoStreamCollection.values()) {
                if (videoStream.isSelected() && MapUtils.isNotEmpty(videoStream.getVideoEventMap())) {
                    for (VideoEvent videoEvent : videoStream.getVideoEventMap().values()) {
                        if (videoEvent.isNormalSegment() && videoEvent.isSelected()) {
                            Integer track = StringParse.stringToDouble(videoEvent.getQuality(), 0).intValue();
                            double endTS = videoEvent.getEndTS();
                            double startTS = videoEvent.getStartTS();
                            double durationInMilliseconds = endTS - startTS;
                            double throughput = 0.0;
                            if (durationInMilliseconds > 0) {
                                throughput = (videoEvent.getTotalBytes() * 8) / durationInMilliseconds;
                            }
                            if ((segmentComparison = qualityMap.get(track)) != null) {
                                int count = segmentComparison.getCount();
                                segmentComparison.setCount(++count);
                                segmentComparison.getCalculatedThroughputList().add(throughput);
                            } else {
                                List<Double> throughputs = new ArrayList<Double>();
                                throughputs.add(throughput);
                                segmentComparison = new SegmentComparison(videoEvent.getManifest().getVideoName(), // declaredBitrate (kbps)
                                1, // declaredBitrate (kbps)
                                track, // declaredBitrate (kbps)
                                videoEvent.getChildManifest().getBandwidth() / 1000.0, throughputs);
                                qualityMap.put(track, segmentComparison);
                            }
                        }
                    }
                }
            }
            result.setResults(qualityMap);
            avgBitRate = getAvgBitRate(summaryBitRate, filteredVideoSegment);
            avgKbps = getAvgThroughput(tracedata);
            result.setAvgBitRate(avgBitRate);
            result.setAvgKbps(avgKbps);
            result.setSelfTest(true);
            bpResultType = BPResultType.SELF_TEST;
            result.setResultText(MessageFormat.format(textResults, avgKbps, avgBitRate));
            result.setResultExcelText(MessageFormat.format(textExcelResults, BPResultType.SELF_TEST.getDescription(), avgKbps, avgBitRate));
        }
    } else {
        result.setResultText(noData);
        result.setResultExcelText(BPResultType.NO_DATA.getDescription());
        bpResultType = BPResultType.NO_DATA;
    }
    result.setResultType(bpResultType);
    return result;
}
Also used : BPResultType(com.att.aro.core.bestpractice.pojo.BPResultType) SegmentComparison(com.att.aro.core.videoanalysis.pojo.SegmentComparison) VideoNetworkComparisonResult(com.att.aro.core.bestpractice.pojo.VideoNetworkComparisonResult) VideoStream(com.att.aro.core.videoanalysis.pojo.VideoStream) VideoEvent(com.att.aro.core.videoanalysis.pojo.VideoEvent) TreeMap(java.util.TreeMap) ArrayList(java.util.ArrayList) List(java.util.List)

Example 15 with VideoStream

use of com.att.aro.core.videoanalysis.pojo.VideoStream in project VideoOptimzer by attdevsupport.

the class VideoResolutionQualityImpl method scanManifestsForHeight.

/**
 * Sets values on maxHeightUsed and overSizeCount
 * @param videoStreamCollection
 */
private void scanManifestsForHeight(SortedMap<Double, VideoStream> videoStreamCollection) {
    maxHeightUsed = 0;
    overSizeCount = 0;
    for (VideoStream videoStream : videoStreamCollection.values()) {
        if (videoStream.isSelected()) {
            for (VideoEvent videoEvent : videoStream.getVideoEventMap().values()) {
                double height = videoEvent.getResolutionHeight();
                if (height > maxHeightUsed) {
                    maxHeightUsed = height;
                }
                if (height > MAX_HEIGHT) {
                    overSizeCount++;
                }
            }
            break;
        }
    }
}
Also used : VideoStream(com.att.aro.core.videoanalysis.pojo.VideoStream) VideoEvent(com.att.aro.core.videoanalysis.pojo.VideoEvent)

Aggregations

VideoStream (com.att.aro.core.videoanalysis.pojo.VideoStream)33 VideoEvent (com.att.aro.core.videoanalysis.pojo.VideoEvent)19 ArrayList (java.util.ArrayList)13 BPResultType (com.att.aro.core.bestpractice.pojo.BPResultType)6 StreamingVideoData (com.att.aro.core.videoanalysis.pojo.StreamingVideoData)6 XYPair (com.att.aro.core.videoanalysis.XYPair)5 List (java.util.List)5 TreeMap (java.util.TreeMap)5 AbstractTraceResult (com.att.aro.core.packetanalysis.pojo.AbstractTraceResult)3 Session (com.att.aro.core.packetanalysis.pojo.Session)3 TraceDirectoryResult (com.att.aro.core.packetanalysis.pojo.TraceDirectoryResult)3 VideoStall (com.att.aro.core.packetanalysis.pojo.VideoStall)3 DUPLICATE_HANDLING (com.att.aro.core.videoanalysis.pojo.VideoUsagePrefs.DUPLICATE_HANDLING)3 Collections (java.util.Collections)3 HashMap (java.util.HashMap)3 StringUtils (org.apache.commons.lang.StringUtils)3 LogManager (org.apache.log4j.LogManager)3 Logger (org.apache.log4j.Logger)3 XYSeries (org.jfree.data.xy.XYSeries)3 Autowired (org.springframework.beans.factory.annotation.Autowired)3