Skip to content

[Feature] add to http api bitrate info for video/audio for CBR/VBR detection and better observability #4559

@felipewd

Description

@felipewd

Hello!

When probing for data using the http api, I get something like:

{
  "code": 0,
  "server": "vid-6ou26s1",
  "service": "91h157e8",
  "pid": "617435",
  "stream": {
    "id": "vid-x4em786",
    "name": "test",
    "vhost": "vid-593zr55",
    "app": "live",
    "tcUrl": "srt://xx.xx.xx.xx./live",
    "url": "/live/test",
    "live_ms": 1762283099995,
    "clients": 3,
    "frames": 0,
    "send_bytes": 18876990888,
    "recv_bytes": 9501504208,
    "kbps": {
      "recv_30s": 10197,
      "send_30s": 20395
    },
    "publish": {
      "active": true,
      "cid": "s6n9b808"
    },
    "video": {
      "codec": "H264",
      "profile": "Main",
      "level": "4",
      "width": 1920,
      "height": 1080
    },
    "audio": {
      "codec": "AAC",
      "sample_rate": 44100,
      "channel": 2,
      "profile": "LC"
    }
  }
}

However, nginx-rtmp can report the bitrate of audio and video, which provides for greater observability for streams using CBR, VBR, etc and can help detect issues.

nginx provides this as bw_video and bw_audio, as such:

<name>nginx_test</name>
<time>6004423</time><bw_in>5758864</bw_in>
<bytes_in>3851548334</bytes_in>
<bw_out>5758864</bw_out>
<bytes_out>3843815196</bytes_out>
<bw_audio>147048</bw_audio> # <=== Audio bitrate in bytes
<bw_video>5611816</bw_video> # <==== Video bitrate in bytes

It'd be great if srs can provide this as well!

Metadata

Metadata

Assignees

No one assigned

    Labels

    EnglishNativeThis issue is conveyed exclusively in English.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions