@@ -52,8 +52,6 @@ class VideoDecoderIssueDetector extends BaseIssueDetector {
52
52
53
53
const throtthedStreams = data . video . inbound
54
54
. map ( ( incomeVideoStream ) : { ssrc : number , allFps : number [ ] , volatility : number } | undefined => {
55
- const allFps : number [ ] = [ ] ;
56
-
57
55
const isSpatialLayerChanged = isSvcSpatialLayerChanged ( incomeVideoStream . ssrc , allProcessedStats ) ;
58
56
if ( isSpatialLayerChanged ) {
59
57
return undefined ;
@@ -64,6 +62,19 @@ class VideoDecoderIssueDetector extends BaseIssueDetector {
64
62
return undefined ;
65
63
}
66
64
65
+ const allFps : number [ ] = [ ] ;
66
+
67
+ // exclude first element to calculate accurate delta
68
+ for ( let i = 1 ; i < allProcessedStats . length ; i += 1 ) {
69
+ const videoStreamStats = allProcessedStats [ i ] . video . inbound . find (
70
+ ( stream ) => stream . ssrc === incomeVideoStream . ssrc ,
71
+ ) ;
72
+
73
+ if ( videoStreamStats ) {
74
+ allFps . push ( videoStreamStats . framesPerSecond ) ;
75
+ }
76
+ }
77
+
67
78
// Calculate volatility fps
68
79
const meanFps = allFps . reduce ( ( acc , val ) => acc + val , 0 ) / allFps . length ;
69
80
const meanAbsoluteDeviationFps = allFps
@@ -85,6 +96,7 @@ class VideoDecoderIssueDetector extends BaseIssueDetector {
85
96
. filter ( ( throttledVideoStream ) => Boolean ( throttledVideoStream ) ) ;
86
97
87
98
const affectedStreamsPercent = throtthedStreams . length / ( data . video . inbound . length / 100 ) ;
99
+ console . log ( 'THROTTLE AFFECTION' , { affectedStreamsPercent } ) ;
88
100
if ( affectedStreamsPercent > this . #affectedStreamsPercentThreshold) {
89
101
console . log ( 'THROTTLE DETECTED !!!!' ) ;
90
102
issues . push ( {
0 commit comments