Skip to content

APPLICATION: HTTP API get the number of frames received or sent for FPS. #851

Closed

Description

@winlinvip

To get the FPS, SRS must provide the number of frames, user can get it from HTTP API.
For example, the number of frames is 1000, duration 100s, then the FPS is 10=1000frames/100s.

Activity

  1. added this to the milestone on Apr 20, 2017
  2. portl4t commented on Apr 20, 2017

    @portl4t

    amazing

  3. winlinvip commented on Apr 20, 2017

    @winlinvip
    MemberAuthor

    Generally, frame rate calculation requires calculating a certain time difference, such as 10-second fps, or 30-second fps, or 300-second fps, to reflect the sending and receiving situation of the stream.
    For example, data can be collected every 10 seconds (the minimum statistical interval):

    In the first 10 seconds, the number of frames obtained is 1000.
    In the second 10 seconds, the number of frames obtained is 1500.
    In the third 10 seconds, the number of frames obtained is 1700.
    

    So, for the first 10 seconds, the fps=(1500-1000)/10=50fps.
    For the second 10 seconds, the fps=(1700-1500)/10=20fps.
    For the first 30 seconds, the fps=(1700-1000)/30=23.33fps.

    If the stream itself is 25FPS (original frame rate), then for the first 10 seconds, it is possible that the gop cache sent a higher frame rate. For the second 10 seconds, there is actually stuttering and the frame rate is insufficient. From 30 seconds onwards, the frame rate is slightly lower.

    How to determine the original frame rate of the stream? The configuration on the encoder can be checked by accessing the encoder's interface or through the business system. The frame rate provided by SRS is the distributed frame rate.

    TRANS_BY_GPT3

  4. Jeff885 commented on Apr 20, 2017

    @Jeff885

    Good

  5. winlinvip commented on Apr 23, 2017

    @winlinvip
    MemberAuthor

    frames

  6. added a commit that references this issue on Apr 23, 2017
  7. winlinvip commented on Apr 24, 2017

    @winlinvip
    MemberAuthor

    The time interval for updating Frames data is configured as follows:

            # the normal packet timeout in ms for encoder.
            # default: 5000
            normal_timeout      5000;
    

    The update can be done by setting the timeout for receiving packets. It should not be set too short, otherwise the encoder will be considered timed out, usually 3-5 seconds or more.

    The calculation of FPS itself is not real-time because when TCP sends packets, it is more like pulses and not sending one packet at a time, but rather in batches. Therefore, adjusting this time interval to 1 second does not make sense, and it will not affect the calculation of FPS even if it is set to 3-5 seconds or more.

    TRANS_BY_GPT3

  8. Trojann commented on Jul 31, 2020

    @Trojann

    Can I get duration of live from HTTP API, and what live_ms mean?

  9. self-assigned this
    on Sep 17, 2021
  10. added a commit that references this issue on Mar 30, 2024
    ff87318
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

FeatureIt's a new feature.TransByAITranslated by AI/GPT.

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions