Optimizing RTSP Broadcast with FlyLeaf Player: Challenges in FPS Adjustments and Data Stream Speed #402
-
Hello, I am using the FlyLeaf player by feeding it with my own customized stream. (With a recorded RTSP broadcast) For more information see #348 While doing this, there are scenarios where I need to neither speed up nor slow down the video. For these scenarios, I send my frames at certain intervals. it doesn’t switch to the new data before the previous one finishes, For these reasons, I think one of the following options could solve the problem.
I couldn't find an example related to FPS adjustment in the FlyLeaf codes, nor a member in the source code where I can set this. I would appreciate your solution suggestion regarding this. |
Beta Was this translation helpful? Give feedback.
Replies: 9 comments
-
Hi @fatihbahceci, I'm not what you are trying to achieve. Everything that you say though it points me to MaxLatency as what you are asking is how Flyleaf can follow the the FPS/speed of the data? |
Beta Was this translation helpful? Give feedback.
-
Hello! Thanks for your response. What I'm trying to achieve is, when I send data to the player, I want it to render all the data immediately in succession and without waiting, not based on a fixed FPS. Because, even if the player operates at, say, 30 FPS, I actually send data according to 60 FPS at time X, 120 FPS at time Y, and 15 FPS at time Z. Additionally, is it possible for me to clear the player's cache in some cases? |
Beta Was this translation helpful? Give feedback.
-
@fatihbahceci I think what you need it must be set at your stream or through FFmpeg. What format/fps does you stream announce? Did you check FFmpeg options so you can force the stream's fps? You can call Player.Flush() for clearing the cache. |
Beta Was this translation helpful? Give feedback.
-
Hello, let me first ask a brief question and then explain why I am asking it. You mentioned, 'I think what you need it must be set at your stream or through FFmpeg.' I couldn’t find a place in the config class where I can set the fps through FFmpeg.
Could you briefly tell me where to set the FFmpeg settings? I couldn’t find a scenario related to this in the examples of the project. As for why I am asking, I had explained it before, but let me explain again. You will probably remember when reading. I have an application with the following tasks:
As you might remember, in Discussion #348, I had created a class that feeds the Player for this purpose. This class connects to our server and receives live/playback data frame by frame according to requests like 1x, 2x, 4x, etc. Then I contacted you about this, and you provided very useful information and made new developments/bug fixes for this purpose. You informed me with the message, 'I've fixed some issues with h264/hevc formats yesterday and also added a few improvements. I just released a new package for you to test as I suspect that you were facing the issue that I've fixed. If not, let me know so I can look deeper into it.' It should be one of these https://github.com/SuRGeoNix/Flyleaf/commits/master/?since=2023-12-01&until=2023-12-08. As for the data properties and the server's operation, The h264/hevc data coming via RTSP is recorded on the disk in raw form and sent to live clients in the same way. So, it’s sufficient to feed the player with the data as it is. Before FlyLeaf, we were rendering the data using our own resources with directdraw. I am also open to considering any other solutions you might suggest. |
Beta Was this translation helpful? Give feedback.
-
@fatihbahceci Sorry but I can't remember our previous conversations, hope you understand :) if (Demuxer.Name == "h264" || Demuxer.Name == "hevc")
{
FixTimestamps = true;
if (FPS == 0)
{
FPS = 25;
FrameDuration = (long) (10000000 / FPS);
}
} Which means that probably your stream does not announce properly the FPS (if it possible to announce it with those formats, I don't know) so it will se the default 25 Fps. If that's your issue I can expose that and you can set this manually. |
Beta Was this translation helpful? Give feedback.
-
I think manually changing the FPS will solve my problem. If I set the player to 300 FPS, I hope to turn it into a beast that can chew up and render every incoming Frame :) I have a question of interest here. By changing this property, will it be possible to decrease and increase the FPS during playback? Or once set initially, does it remain the same FPS until I reconfigure and restart the player? I have my own solution plans for both scenarios. Edit: Also, I just realized that; In the RTSP broadcast, in some cases, I should be able to determine the FPS myself. This is because while some cameras can be set to 2 FPS, 10 FPS and 30 FPS. I would need to inform the Player of this in some way ahead of time. Therefore, even if I hadn't done FFWD or BFWD, I should have been able to set this value. Thanks in advance for this development. |
Beta Was this translation helpful? Give feedback.
-
If your hardware can handle I guess it will work. OK so I will have later today a new config to adjust this value however you should consider also checking your encoding process that might be possible to set the FPS there, |
Beta Was this translation helpful? Give feedback.
-
Also, I just realized that; In the RTSP broadcast, in some cases, I should be able to determine the FPS myself. This is because while some cameras can be set to 2 FPS, 10 FPS and 30 FPS. I would need to inform the Player of this in some way ahead of time. Therefore, even if I hadn't done FFWD or BFWD, I should have been able to set this value. Thanks in advance for this development. |
Beta Was this translation helpful? Give feedback.
-
@fatihbahceci I've a new NuGet for testing. Just set this Config.Demuxer.ForceFPS = 300; Note: this is only for NOTIMESTAMP formats |
Beta Was this translation helpful? Give feedback.
@fatihbahceci I've a new NuGet for testing. Just set this
Note: this is only for NOTIMESTAMP formats