5G-MAG / rt-5gms-media-session-handler

5G Media Streaming - Media Session Handler
https://www.5g-mag.com/streaming
Other
4 stars 4 forks source link

Feature/metrics reporting #56

Closed dsilhavy closed 5 months ago

dsilhavy commented 6 months ago

This PR adds support for QoE Metrics Reporting. In addition, it refactors the code to make it more modular, use dependency injection and introduce a more clear separation of concerns.

Example of a report as generated by version 1.2.0:

<?xml version="1.0" encoding="utf-8"?>
<ReceptionReport contentURI="https://dash.akamaized.net/envivio/EnvivioDash3/manifest.mpd"
                 xsi:schemaLocation="urn:3gpp:metadata:2011:HSD:receptionreport DASH-QoE-Report.xsd"
                 xmlns:sv="urn:3gpp:metadata:2016:PSS:schemaVersion" xmlns="urn:3gpp:metadata:2011:HSD:receptionreport"
                 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <QoeReport reportPeriod="10" reportTime="2024-02-26T14:47:08.169Z" periodID="period0">
        <QoeMetric>
            <BufferLevel>
                <BufferLevelEntry level="0" t="2024-02-26T14:47:07.530Z"/>
                <BufferLevelEntry level="0" t="2024-02-26T14:47:07.759Z"/>
                <BufferLevelEntry level="0" t="2024-02-26T14:47:07.856Z"/>
                <BufferLevelEntry level="0" t="2024-02-26T14:47:07.908Z"/>
                <BufferLevelEntry level="2040" t="2024-02-26T14:47:08.046Z"/>
                <BufferLevelEntry level="2040" t="2024-02-26T14:47:08.046Z"/>
                <BufferLevelEntry level="2040" t="2024-02-26T14:47:08.087Z"/>
                <BufferLevelEntry level="2040" t="2024-02-26T14:47:08.119Z"/>
            </BufferLevel>
        </QoeMetric>
        <QoeMetric>
            <HttpList>
                <HttpListEntry actualurl="https://dash.akamaized.net/envivio/EnvivioDash3/manifest.mpd" interval="229"
                               range="" responsecode="200" trequest="2024-02-26T14:47:07.530Z"
                               tresponse="2024-02-26T14:47:07.530Z" type="MPD"
                               url="https://dash.akamaized.net/envivio/EnvivioDash3/manifest.mpd">
                    <Trace b="2726" d="229" s="2024-02-26T14:47:07.530Z"/>
                </HttpListEntry>
                <HttpListEntry actualurl="https://dash.akamaized.net/envivio/EnvivioDash3/v7_257-Header.m4s"
                               interval="27" range="" responsecode="200" trequest="2024-02-26T14:47:07.829Z"
                               tresponse="2024-02-26T14:47:07.829Z" type="InitializationSegment"
                               url="https://dash.akamaized.net/envivio/EnvivioDash3/v7_257-Header.m4s">
                    <Trace b="688" d="27" s="2024-02-26T14:47:07.829Z"/>
                </HttpListEntry>
                <HttpListEntry actualurl="https://dash.akamaized.net/envivio/EnvivioDash3/v4_258-Header.m4s"
                               interval="77" range="" responsecode="200" trequest="2024-02-26T14:47:07.831Z"
                               tresponse="2024-02-26T14:47:07.831Z" type="InitializationSegment"
                               url="https://dash.akamaized.net/envivio/EnvivioDash3/v4_258-Header.m4s">
                    <Trace b="615" d="77" s="2024-02-26T14:47:07.831Z"/>
                </HttpListEntry>
                <HttpListEntry actualurl="https://dash.akamaized.net/envivio/EnvivioDash3/v4_258-270146-i-1.m4s"
                               interval="136" range="" responsecode="200" trequest="2024-02-26T14:47:07.910Z"
                               tresponse="2024-02-26T14:47:07.910Z" type="MediaSegment"
                               url="https://dash.akamaized.net/envivio/EnvivioDash3/v4_258-270146-i-1.m4s">
                    <Trace b="33578" d="136" s="2024-02-26T14:47:07.910Z"/>
                </HttpListEntry>
                <HttpListEntry actualurl="https://dash.akamaized.net/envivio/EnvivioDash3/v7_257-270146-i-1.m4s"
                               interval="188" range="" responsecode="200" trequest="2024-02-26T14:47:07.858Z"
                               tresponse="2024-02-26T14:47:07.858Z" type="MediaSegment"
                               url="https://dash.akamaized.net/envivio/EnvivioDash3/v7_257-270146-i-1.m4s">
                    <Trace b="1535564" d="188" s="2024-02-26T14:47:07.858Z"/>
                </HttpListEntry>
                <HttpListEntry actualurl="https://dash.akamaized.net/envivio/EnvivioDash3/v4_258-270146-i-2.m4s"
                               interval="28" range="" responsecode="200" trequest="2024-02-26T14:47:08.058Z"
                               tresponse="2024-02-26T14:47:08.059Z" type="MediaSegment"
                               url="https://dash.akamaized.net/envivio/EnvivioDash3/v4_258-270146-i-2.m4s">
                    <Trace b="32948" d="28" s="2024-02-26T14:47:08.059Z"/>
                </HttpListEntry>
                <HttpListEntry actualurl="https://dash.akamaized.net/envivio/EnvivioDash3/v4_258-270146-i-3.m4s"
                               interval="31" range="" responsecode="200" trequest="2024-02-26T14:47:08.088Z"
                               tresponse="2024-02-26T14:47:08.088Z" type="MediaSegment"
                               url="https://dash.akamaized.net/envivio/EnvivioDash3/v4_258-270146-i-3.m4s">
                    <Trace b="32770" d="31" s="2024-02-26T14:47:08.088Z"/>
                </HttpListEntry>
            </HttpList>
        </QoeMetric>
        <QoeMetric>
            <MPDInformation representationId="v7_257">
                <Mpdinfo bandwidth="5300000" codecs="avc1.4D401E" frameRate="29.970029830932617" height="1080"
                         mimeType="video/mp4" width="1920"/>
            </MPDInformation>
            <MPDInformation representationId="v4_258">
                <Mpdinfo bandwidth="130800" codecs="mp4a.40.2" mimeType="audio/mp4"/>
            </MPDInformation>
        </QoeMetric>
        <QoeMetric>
            <RepSwitchList>
                <RepSwitchEvent mt="P0Y0DT0H0M0S" t="2024-02-26T14:47:07.869Z" to="v7_257"/>
                <RepSwitchEvent mt="P0Y0DT0H0M0S" t="2024-02-26T14:47:07.938Z" to="v4_258"/>
            </RepSwitchList>
        </QoeMetric>
        <sv:delimiter>0</sv:delimiter>
    </QoeReport>
</ReceptionReport>