Skip to content

Commit

Permalink
add feature to extra the last qpsum
Browse files Browse the repository at this point in the history
Summary:
extracts the qpSum which is a quality metrics for encoded images. See
  https://w3c.github.io/webrtc-stats/#dom-rtcinboundrtpstreamstats-qpsum

Dividing this by the number of seconds a stream is active gives us an idea about the average quality

Test Plan:
- run extract.js with a dump
- observe qpsum feature

Reviewers: gustavo

Reviewed By: gustavo

Differential Revision: https://lifeonair.phacility.com/D25260
  • Loading branch information
fippo committed Apr 5, 2019
1 parent 8cf6ca8 commit 1f39570
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions features-stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ module.exports = {
}
return duration;
},
qpSum: ({kind, stats}) => {
if (kind !== 'video' || !stats.length) {
return;
}
const last = stats[stats.length - 1];
return last.qpSum;
},
};

/* these features operate on stats of each track, in send and recv direction */
Expand Down
2 changes: 2 additions & 0 deletions features-v2.sql
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,8 @@ CREATE TABLE features (
videogoogbandwidthlimitedresolutionmin real,
videogoogbandwidthlimitedresolutionmode real,

qpsum real,

audiocodec character varying(64),
videocodec character varying(64),

Expand Down

0 comments on commit 1f39570

Please sign in to comment.