Search in sources :

Example 1 with VideoStream

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;
}
Also used : AudioStreamResult(com.att.aro.core.bestpractice.pojo.AudioStreamResult) VideoStream(com.att.aro.core.videoanalysis.pojo.VideoStream)

Example 2 with VideoStream

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;
    }
}
Also used : VideoRedundancyResult(com.att.aro.core.bestpractice.pojo.VideoRedundancyResult) HashMap(java.util.HashMap) AbstractBestPracticeResult(com.att.aro.core.bestpractice.pojo.AbstractBestPracticeResult) VideoNetworkComparisonResult(com.att.aro.core.bestpractice.pojo.VideoNetworkComparisonResult) ArrayList(java.util.ArrayList) VideoStream(com.att.aro.core.videoanalysis.pojo.VideoStream) BestPracticeType(com.att.aro.core.bestpractice.pojo.BestPracticeType) VideoStallResult(com.att.aro.core.bestpractice.pojo.VideoStallResult) VideoConcurrentSessionResult(com.att.aro.core.bestpractice.pojo.VideoConcurrentSessionResult) StreamingVideoData(com.att.aro.core.videoanalysis.pojo.StreamingVideoData) VideoTcpConnectionResult(com.att.aro.core.bestpractice.pojo.VideoTcpConnectionResult) BufferOccupancyResult(com.att.aro.core.bestpractice.pojo.BufferOccupancyResult) ArrayList(java.util.ArrayList) List(java.util.List) VideoChunkPacingResult(com.att.aro.core.bestpractice.pojo.VideoChunkPacingResult) VideoChunkSizeResult(com.att.aro.core.bestpractice.pojo.VideoChunkSizeResult) VideoStartUpDelayResult(com.att.aro.core.bestpractice.pojo.VideoStartUpDelayResult) InetAddress(java.net.InetAddress) Session(com.att.aro.core.packetanalysis.pojo.Session)

Example 3 with VideoStream

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();
}
Also used : VideoStream(com.att.aro.core.videoanalysis.pojo.VideoStream)

Example 4 with VideoStream

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;
}
Also used : BPResultType(com.att.aro.core.bestpractice.pojo.BPResultType) TreeSet(java.util.TreeSet) QualityTime(com.att.aro.core.videoanalysis.pojo.QualityTime) VideoStream(com.att.aro.core.videoanalysis.pojo.VideoStream) VideoAdaptiveBitrateLadderResult(com.att.aro.core.bestpractice.pojo.VideoAdaptiveBitrateLadderResult) VideoEvent(com.att.aro.core.videoanalysis.pojo.VideoEvent)

Example 5 with VideoStream

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;
}
Also used : VideoRedundancyResult(com.att.aro.core.bestpractice.pojo.VideoRedundancyResult) VideoStream(com.att.aro.core.videoanalysis.pojo.VideoStream)

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