This topic describes how to query data that is generated during stream ingest and streaming in ApsaraVideo Live.

Log on to the ApsaraVideo Live console. You can click Monitoring, Statistics-Visits, and Statistics-Usage to query the corresponding data.

  • On the Resource Monitoring page, you can query the monitoring data on the Upstream Bandwidth, Downstream Bandwidth, Back-to-Origin Statistics, and HTTP Status Codes tabs. For more information, see Resource monitoring.
  • On the Real-time Monitoring page, you can query the monitoring data on the Ingest Monitoring, Bandwidth and Traffic, and HTTP Status Codes tabs. For more information, see Real-time monitoring.
  • On the Statistics-Visits page, you can query the data on the Unique Visitors (UV), Total Visits, and Domains tabs. For more information, see Access statistics.
  • On the Statistics-Usage page, you can query the data on the tabs such as Streaming Bandwidth/Traffic, Ingest Endpoints, Transcoding Duration, and Snapshots. For more information, see Usage statistics.

You can also query data by using the following ApsaraVideo Live API operations:

Query the data generated during stream ingest

Monitoring stream ingest in real time can help you diagnose live streaming issues such as stuttering and latency. Monitoring data is returned every second in real time, including the received audio and video frame rates from a streamer to CDN nodes, audio and video timestamps, sequence headers, audio and video bitrates (Kbit/s), maximum audio and video frame intervals (milliseconds), error codes of interrupted stream ingest, and real-time logs. You can check the status of video streams every second to determine the stability of stream ingest and monitor live streams in real time. This reduces issues that are caused by video stuttering.

Procedure

  1. Log on to the ApsaraVideo Live console.
  2. In the left-side navigation pane, choose Monitoring > Real-time Monitoring.
  3. Select the ingest domain, time period, application name, and stream name. Then, click Update.
    • To query the monitoring data in real time, select Last 10 Minutes. The monitoring data can be queried 3 minutes after events occur.
    • To query the historical monitoring data, select Last 30 Minutes, Last 1 Hour, or Custom. Monitoring data of up to the last 24 hours can be queried.

The following tables describe the metric details.

Stream details
Stream monitoring Description Scenario
Ingest URL The ingest URL of the streamer, in the format of rtmp://domainName/appName/streamName. View the ingest URL.
AppName The name of the application in which live streaming is implemented. View the application name.
StreamName The name of the stream that is ingested by the streamer. View the stream name.
Start At The start time when the streamer ingests the stream. View the start time of stream ingest.
Finish At The end time when the streamer ingests the stream. View the end time of stream ingest.
Caster IP Address The IP address of the streamer that ingests the stream. Monitor the IP address of the streamer.
Encoding The metadata of the stream that is ingested by the streamer, in the format of {Video codec ID}{Resolution}/{Audio codec ID}{Audio sampling rate}. The server collects the video codec ID, resolution, audio codec ID, and audio sample rate from the videocodecid, frame_rate, audiocodecid, and aac headers of the metadata. Monitor the encoding settings of the stream.
Activity Log The records of stream ingest and interrupted ingest that are generated by the stream. Monitor the point in time when the stream ingest and interrupted ingest occur.
Received audio and video frame rates from a streamer to CDN nodes
Metric Description Scenario
Video Frame Rate The number of received video frames, the statistics of which are collected by the server per second. Monitor the stability of the upstream video frame rate from the streamer to the server.
Audio Frame Rate The number of received audio frames, the statistics of which are collected by the server per second. Monitor the stability of the upstream audio frame rate from the streamer to the server.
Audio and video timestamps
Metric Description Scenario
Video Timestamp The timestamp of the last video frame, the statistics of which are collected by the server per second, in milliseconds.
Note If no video frames are received in the one second, the value is set to -1.
Monitor the monotonicity of video timestamps.
Audio Timestamp The timestamp of the last audio frame, the statistics of which are collected by the server per second, in milliseconds.
Note If no audio frames are received in the one second, the value is set to -1.
Monitor the monotonicity of audio timestamps.
Difference Between Audio and Video Timestamps The difference between the audio and video timestamps, in milliseconds. Determine whether the audio and video timestamps are synchronized during live streaming by monitoring the difference trend of audio and video timestamps.
Sequence headers
Metric Description Scenario
AVC The cumulative number of AVC sequence headers ingested by the streamer, the statistics of which are collected by the server. Monitor the number of AVC sequence headers that are ingested by the streamer.
AAC The cumulative number of AAC sequence headers ingested by the streamer, the statistics of which are collected by the server. Monitor the number of AAC sequence headers that are ingested by the streamer.
Audio and video bitrates
Metric Description Scenario
Video Bitrate The video bitrate, the statistics of which are collected by the server per second, in Kbit/s. Monitor the video bitrate of the stream that is ingested by the streamer.
Audio Bitrate The audio bitrate, the statistics of which are collected by the server per second, in Kbit/s. Monitor the audio bitrate of the stream that is ingested by the streamer.
Maximum audio and video frame intervals
Metric Description Scenario
Video Keyframe Interval The maximum interval for capturing video frames, the statistics of which are collected by the server per second. Monitor whether the timestamp of video frames jumps.
Audio Frame Interval The maximum interval for capturing audio frames, the statistics of which are collected by the server per second. Monitor whether the timestamp of audio frames jumps.
Error codes of interrupted ingest
Metric Description Scenario
Error Code The error code of interrupted ingest, the statistics of which are collected by the server per second. Monitor the reason why the stream ingest is interrupted. The following common error codes may be returned:
  • 2: The stream ingest client closes the connection.
  • 1, 3, 4, or 6: The connection request that is sent from the client times out.
  • 101: The ingest endpoint in use is disabled.
  • 103: No data is sent from the stream ingest client for more than 10 seconds.
  • 104 or 106: The chunk stream ID exceeds 32.
  • 105: The size of an ingested stream frame exceeds 5,242,880 bytes.
  • 122 or 123: The stream ingest authentication fails.
  • 125: An ingested stream with the same name already exists in the live center.
  • Other error codes: If other error codes are returned, submit a ticket with snapshots.

Real-time logs

For real-time log delivery, logs can be collected within seconds after they are generated. This helps you know the details of live stream ingest and access in real time. For more information, see Log management.

Procedure

  1. Log on to the ApsaraVideo Live console.
  2. In the left-side navigation pane, click Log Management.
  3. Select the domain name and time. Then, click Search to query the logs of the domain at the specified time.
  4. For more information about the log fields of ingested streams, see Log management.

Analyze the data generated during streaming

You can analyze the data that is generated during streaming based on the bandwidth and traffic, HTTP status codes, number of unique visitors, and user distribution.

Tab Description Query method
Bandwidth and Traffic Displays the real-time traffic and bandwidth of a streaming domain within a specified time period for each provider in a region.
  1. Log on to the ApsaraVideo Live console.
  2. In the left-side navigation pane, choose Monitoring > Real-time Monitoring. Then, click the Bandwidth and Traffic tab.
  3. Select the streaming domain, provider, region, and time period. Then, click Update.
Streaming Bandwidth/Traffic Displays the traffic and bandwidth usage of a specified domain.
  1. Log on to the ApsaraVideo Live console.
  2. In the left-side navigation pane, click Statistics-Usage.
  3. Select the domain name, region, and time period to query the traffic and bandwidth usage of the domain. To select a time period, select Today, Yesterday, Last 7 Days, Last 30 Days, or Custom.
HTTP Status Codes Displays the returned HTTP status codes.
  1. Log on to the ApsaraVideo Live console.
  2. In the left-side navigation pane, choose Monitoring > Real-time Monitoring. Then, click the HTTP Status Codes tab.
Total Visits Displays the distribution of regions where the video users reside.
  1. Log on to the ApsaraVideo Live console.
  2. In the left-side navigation pane, click Statistics-Visits.
  3. Click the Unique Visitors (UV), Total Visits, or Domains tab to view the corresponding data.
  4. Select the domain name and time period as required and click Update.
Domains Displays the visit rankings of domain names for CDN.
Unique Visitors (UV) Displays the number of independent requests from IP addresses within the current domain within a specified time period.