Skip to content

Conversation

@ossrs-ai
Copy link
Contributor

@ossrs-ai ossrs-ai commented Nov 8, 2025

This PR adds separate audio and video frame counting to the HTTP API (/api/v1/streams/) for better stream observability. The API now reports three frame fields:

  • frames - Total frames (video + audio)
  • video_frames - Video frames/packets only
  • audio_frames - Audio frames/packets only

This enhancement provides better visibility into stream composition and helps detect issues with CBR/VBR streams, audio/video sync problems, and codec-specific behavior.

Before:

{
  "streams": [
    {
      "frames": 0, // video frames.
    }
  ]
}

After:

{
  "streams": [
    {
      "frames": 6912, // video frames.
      "audio_frames": 5678, // audio frames.
      "video_frames": 1234, // video frames.
    }
  ]
}

Frame Counting Strategy

  • All protocols report frames every N frames to balance accuracy and performance
  • Frames are counted at the protocol-specific message/packet level:
    • RTMP: Counts RTMP messages (video/audio)
    • WebRTC: Counts RTP packets (video/audio)
    • SRT: Counts MPEG-TS messages (H.264/HEVC/AAC)

@winlinvip winlinvip added the EnglishNative This issue is conveyed exclusively in English. label Nov 8, 2025
@winlinvip winlinvip merged commit 1a96abc into ossrs:develop Nov 8, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

EnglishNative This issue is conveyed exclusively in English.

Development

Successfully merging this pull request may close these issues.

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

2 participants