How to get stats for individual video streams

I’m in a scenario where I’d like the clients to report the stats of individual video streams to an http server. (For example, in a 3-client conference, each client needs to report the stats for 2 video streams.)
I found there are stats for individual streams already provided on the client side.
As the figure shows:

these are the stats of a stream from a remote client in my local view.

And the code pointer is probably in lib-jitsi-meet/RTPStatsCollector.js at d5e60583b8c1702ef97b1a3b957e2012aa91d538 · jitsi/lib-jitsi-meet · GitHub

  • Is this the coorect way to get the stats for individual video streams?

  • If I want to report more stats (e.g., packet rate, packet jitter), which files should I look into?

Thanks a lot!

Every client gets the stats locally and broadcast it using bridge channel, this is how you see the stats from the client.
You had correctly seen this comes from webrtc internals, from getStats method.
What you want to accomplish sounds like GitHub - jitsi/rtcstats
There is also a rtcstats-server project.

Thanks for your reply!