-
Notifications
You must be signed in to change notification settings - Fork 406
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Video lags after few minutes and high memory consumption #1042
Comments
I've had a very similar experience with both issues. The memory usage is due to some non ideal memory management in the RTPPeerconnection.SendView & SendAudio methods. The byte arrays are being copied many times per call, due to byte arrays not being resizable. I'm having the same issue with latency in video streams. As far as I can tell, it's due to the chrome jitter buffer detecting that the video stream is unstable so it starts to buffer it, however this is even happening on Localhost. I believe this is due to some issues with exceptions being thrown on a background thread somehow causing some jitter in the stream. When the latency starts increasing, check the output window in visual studio, look for either an exception being thrown or a thread exiting. |
Yes, I am getting "Exceptions" and some "threads are exiting"
|
Optimization is possible in the video frame buffers, but this alone may not meet the required throughput levels. A significant performance challenge arises when crossing the native-to-managed boundary, such as from Win32 to .NET. This is evident in the sipsorcery library, which aims to implement as much of the WebRTC stack in .NET as possible. However, there's currently no direct .NET API for video/audio devices on Windows, and based on the last 23 years of the .NET Framework's evolution, it seems unlikely that Microsoft will introduce this feature. In summary, for high performance, the best approach is to use C++ and libwebrtc. An alternative is to find a .NET wrapper for libwebrtc, ideally one that maintains a fully native media-to-SRTP pipeline. However, the existence of such a wrapper is uncertain. |
I am using FFmpeg File and Device Test to share my screen. It works perfectly fine initially, but after a few minutes, there is some lag—between 1-3 seconds, and very rarely, it becomes 5 seconds. Also, the application consumes a significant amount of memory, always hovering around 180 MB or more(200 MB+ some times). I am using .NET v6. Is there a way to solve these issues? Is anyone else facing the same issues as me?
The text was updated successfully, but these errors were encountered: