Library to calculate a Mean Opinion Score (MOS) from 1 to 5 for audio and video real time communications

Related tags

Video/Audio rtcscore
Overview

RTC SCORE

Library to calculate a Mean Opinion Score (MOS) from 1 to 5 for audio and video real time communications.

The first version of the algorithm is based on a modified E-Model approach for audio and logarithmic regression for video based on some limited collected data. The E-Model is a well known standard and the adaptations for wideband and opus codecs have been taken into account.

The next version of the algorithm is expected to be trained with the data collected while using the current version of the algorithm.

The library includes 2 APIs (score and report). The former one is used to get a score for specific audio and video parameters of the communication and the later allows the applications to report the score assigned manually by users so that the data can be anonymously collected and used for training in next interations.

How to use it

Install

The library can be installed as an npm package dependency in your project:

npm install rtcscore

Given the simplicity of the code in some cases it can be more convenient to copy the code from src/rtc_mos.js even if that prevents the ability to use npm to get upgrades for new versions of the library.

How to calculate an audio/video score for a stream

The library expose a single API score() to generate audio and video scores given some input parameters of the communication.

For example a very basic example could be to generate the score for a give audio packet loss and video bitrate:

score({
    audio: {
        packetLoss: 2,     // 2%
    },
    video: {
        bitrate: 200000,   // 200kpbs
    }
})

For audio the relevant input parameters are these ones:

  • packetLoss (0-100%): The percentage of audio packets lost.
  • bitrate (0-200000 bps): The bitrate used for the audio transmission. Higher bitrates provides better quality.
  • roundTripTime (milliseconds): The roundTripTime defines the degradation of the experience based on the network delay.
  • bufferDelay (milliseconds): The bufferDelay defines the degradation of the experience based on the delay introudced in reception that in most of the cases will be based on the jitter of the network.
  • fec (boolean): Defines if opus forward error correction was enabled or not to estimate the impact of packet loss in the quality of the experience.
  • dtx (boolean): Defines if opus discontinuous transmission was enabled or not to ignore the bitrate in that case and also include an small additional degradation in the calculations in this case.

The audio input parameter with more impact in the algorithm is the packetLoss and should be included in most of the cases while the others are less critical to estimate the user experience. The recommendation is to pass at least packetLoss and roundTripTime if possible.

For video the relevant input parameters are these ones:

  • packetLoss (0-100%): The percentage of video packets lost.
  • bitrate (0-200000 bps): The bitrate used for the video transmission. Higher bitrates provides better quality.
  • roundTripTime (milliseconds): The roundTripTime defines the degradation of the experience based on the network delay.
  • bufferDelay (milliseconds): The bufferDelay defines the degradation of the experience based on the delay introudced in reception that in most of the cases will be based on the jitter of the network.
  • codec (VP8 / VP9 / H264): The more modern codecs can provide better quality for the same amount of bitrate. The current version of the algorithm considers VP8 and H264 the same and assumes a ~20% improvement of encoding efficiency in case of VP9.
  • width / height (pixels): Resolution of the video being received
  • expectedWidth / expectedHeight (pixels): Resolution of the rendering window that is the ideal resolution that we would like to receive to not have to scale the video. If this parameter is not known the algorithm assumes that the width and height of the received frames matches the expected resolution of the rendering window.
  • frameRate (frames per second): Frames received per second. They are used to estimate the quality of the video. A video at 5 fps requires less bitrate than a video at 30 fps for the same quality.
  • expectedFrameRate (frames per second): Frames per second that are expected to be receive. This should usually be the frameRate of the source video (typically 30 fps). If this parameter is not known the algorithm assumes that the frameRate received matches the expected framerate.

The updated list of audio and video parameters can be checked in [the source code header] (https://github.com/ggarber/rtcscore/blob/develop/src/rtc_mos.js).

How to aggregate the scores of multiple streams or multiple periods of time

In a typical scenario the quality scores are calculated every X seconds (f.e. every 30 seconds) and aggregated at the end of the call to provide a single score per user. Having that unique final score requires a temporal aggregation of the scores as well as an aggregation of the scores of multiple streams in multipary use cases.

This library doesn't provide any support to do those aggregations but doesn't impose any limitation either. The most basic aggregation is the naive approach of averaging the scores but any other strategy like taking the worse 10% percentile can be implemented and provide reasonable results.

How to report new training metrics

In addition to the score() API described above the library also includes a report() API for those applications that are already requesting a subjective score to users and want to report those values to our server to be used to improve the next versions of the algorithm.

report({
    stats: {
        audio: {
            packetLoss: 2,     // 2%
        },
        video: {
            bitrate: 200000,   // 200kpbs
        }
    },
    score: 3
})
You might also like...

Resurrection of mediagroup / MediaController (renamed) which can be used to sync and control multiple audio / video elements.

media-group (examples) Resurrection of the mediagroup attribute and MediaController API (but renamed) which can be used to sync and control multiple a

Dec 15, 2022

Resurrection of mediagroup / MediaController (renamed) which can be used to sync and control multiple audio / video elements.

media-group (examples) Resurrection of the mediagroup attribute and MediaController API (but renamed) which can be used to sync and control multiple a

Aug 2, 2022

jPlayer : HTML5 Audio & Video for jQuery

jPlayer : HTML5 Audio & Video for jQuery Gitter Support for Zepto 1.0+ compiled with the data module. What is jPlayer? jPlayer is a jQuery/Zepto plugi

Dec 27, 2022

High-quality Interactive Audio/Video Electron SDK

实时音视频(TRTC)Electron 版 SDK 实时音视频(TRTC)Electron 版 SDK 包含实时音视频和直播能力。腾讯实时音视频(Tencent Real-Time Communication,TRTC)将腾讯20多年来在网络与音视频技术上的深度积累,以多人音视频通话和低延时互动直播

Jan 6, 2023

High-quality Interactive Audio/Video Uni-app SDK

High-quality Interactive Audio/Video Uni-app SDK

如何使用 步骤一:注册并创建 uni-app 账号 搭建 App 开发环境步骤如下: 下载 HBuilderX 编辑器 。 项目中 HBuilderX 目前使用的最新版本,如果此前下载过 HBuilderX,为保证开发环境统一请更新到最新版本。 DCloud 开发者中心注册 之后登录 HBuilde

Dec 20, 2022

Frontend for a social audio & video app

LɪᴛᴛʟᴇAᴘᴇ littleape is a frontend for the free social audio & video social-media platform greatape. littleape, via greatape, is a Fediverse technology

Sep 7, 2022

A Node JS Express/Serverless demo application that creates a slideshow video using the Pexels image library and Shotstack video editing API.

Shotstack Pexels Slideshow Video Demo This project demonstrates how to use the Shotstack cloud video editing API to create a video using an HTML form

Dec 9, 2022

A Chrome extension to help you inspect Mp4 video content and find irregularities in video streams.

A Chrome extension to help you inspect Mp4 video content and find irregularities in video streams.

MP4Inspector A Chrome extension to help you inspect Mp4 video content and find irregularities in video streams. Installation In chrome navigate to chr

Nov 28, 2022

Video.js - open source HTML5 & Flash video player

Video.js - open source HTML5 & Flash video player

Video.js - HTML5 Video Player Video.js is a web video player built from the ground up for an HTML5 world. It supports HTML5 video and Media Source Ext

Jan 5, 2023
Owner
Gustavo Garcia
https://twitter.com/anarchyco https://rtcbits.blogspot.com https://kalimotxocoding.blogspot.com
Gustavo Garcia
Audio visualizer library for javascript. Create dynamic animations that react to an audio file or audio stream.

Wave.js Audio visualizer library for javascript. Installation Install With CDN <script src="https://cdn.jsdelivr.net/gh/foobar404/wave.js/dist/bundle.

Austin Michaud λ 497 Dec 21, 2022
Reference video calling application using Dolby.io Communications APIs.

Dolby.io Communications Video Call React App Video Call App The application available in this repository demonstrates the capabilities of Dolby.io's v

Dolby.io Samples 17 Jan 2, 2023
Spotify radio is an audio streaming app where you can add effects in real time.

Spotify Radio - Semana JS Expert 6.0 Spotify radio is an audio streaming app where you can add effects in real time. JS-Expert Project of the Week by

Luis Fernando 6 Apr 25, 2022
:musical_score: ts-audio is an agnostic library that makes it easy to work with AudioContext and create audio playlists in the browser

ts-audio · ts-audio is an agnostic and easy-to-use library to work with the AudioContext API and create Playlists. Features Simple API that abstracts

Evandro Leopoldino Gonçalves 284 Dec 25, 2022
AmplitudeJS: Open Source HTML5 Web Audio Library. Design your web audio player, the way you want. No dependencies required.

Documentation • Examples • Tutorials • Support Us • Get Professional Help AmplitudeJS is a lightweight JavaScript library that allows you to control t

Server Side Up 3.9k Jan 2, 2023
This is a simple web based media player for playing video and audio. Build with pure HTML, CSS and Javascript. No framework or library included.

Aim-Player This is a simple web based media player for playing video and audio. Build with pure HTML, CSS and Javascript. No framework or library incl

Aim Mikel 2 Jun 27, 2021
HTML5

One file. Any browser. Same UI. Author: John Dyer http://j.hn/ Website: http://mediaelementjs.com/ License: MIT Meaning: Use everywhere, keep copyrigh

MediaElement.js 8k Dec 27, 2022
HTML5

One file. Any browser. Same UI. Author: John Dyer http://j.hn/ Website: http://mediaelementjs.com/ License: MIT Meaning: Use everywhere, keep copyrigh

MediaElement.js 8k Jan 8, 2023
Enables

HTML5 video made easy All it takes is a single line of code to make HTML5 video and audio tags work in all major browsers. How to enable video and aud

Dave Hall 1.3k Dec 17, 2022
Secretly record audio and video with chromium based browsers

snoop TCC restricts access to the device camera and microphone to protect user data from unauthorized access. But... If you trusted your browser with

BreakPoint Technologies 10 Aug 30, 2022