apivideo / api.video-reactnative-live-stream

React Native RTMP live stream client. Made with ♥ by api.video
https://api.video
MIT License
171 stars 33 forks source link

[Feat]: Frame drops #85

Open talhatsk opened 3 weeks ago

talhatsk commented 3 weeks ago

Version

2.0.0

Environment that reproduces the issue

*

Use case description

Hi, is there any method or callback that can tell us the frame drops in our stream?

Proposed solution

there should be a callback function that tells us the frame drop after some interval of time

Alternative solutions

No response

ThibaultBee commented 3 weeks ago

Hi,

There isn't such APIs. To understand the need, I have to understand:

xoraingroup commented 3 weeks ago

We would also like to have frame drops in some callback due to the reason, that some times when we stream to a specific RTMP server, the stream seems pixelated and stuttering.

Having this option can enable us to adjust bitrate dynamically for high latency and poor internet connection users.

Frame drops are audio video frames. If its not possible, then a packet drops will suffice as well.

talhatsk commented 3 weeks ago

Hi,

There isn't such APIs. To understand the need, I have to understand:

  • Why do you need it? (how do you plan to use it?)
  • What is a frame? (video/audio/network packet)

yes i second @xoraingroup , the need is to change the bitrate when the users have high latency due to poor connection. to give them a seem less and fine streaming experience.

ThibaultBee commented 3 weeks ago

Ok, so you want to know if the connection is reliatable or not. That made more senses for RTMP than a callback with frame drops as RTMP is based on TCP. I would rather add a small optional mechanism (maybe customizable with custom algorithm) to reduce bitrate when sender internal buffer are too large. But it is a complicated topic.

xoraingroup commented 3 weeks ago

Yes thats true, TCP connection do resend packets, but as observed in OBS, it drops frames at source may be due to wrong time stamps???

Basically, an optional parameter with max and min bitrate would be ideal, in which it should automatically reduce bitrate to the min level if there is too much retransmission of packets due to latency, bad network etc.