BogdanovKirill / RtspClientSharp

Pure C# RTSP client for .NET Standard without external dependencies and with true async nature. I welcome contributions.
MIT License
706 stars 284 forks source link

Getting "RtspClientSharp.Rtsp.RtspClientException: Receive timeout" for higher resolutions. #56

Open Firoz13 opened 4 years ago

Firoz13 commented 4 years ago

Hi Kirill,

I am trying to get feed from my camera for higher resolution. When I select a 1280 * 720 resolution profile to get the feed from camera, I am able to receive feed for some time, but after around 20-30 seconds I am getting the following exception. "RtspClientSharp.Rtsp.RtspClientException: Receive timeout ---> System.TimeoutException: The operation has timed out.".

But I can see the data is received for the same just few milliseconds before this exception thrown. So I don't think this is any timeout issue, can you please comment on this what may be the exact issue.

When I tried getting feed for 704 * 576 resolution I am able to get feed seamlessly for long time without any timeout exception.

Is there anything to be changed for higher resolution profiles to get feed from? I am referring to this code base "https://github.com/BogdanovKirill/RtspClientSharp".

BogdanovKirill commented 4 years ago

Hello,

It is difficult to find out where your problem is. Try to debug H264Parser.cs. Check that TryGenerateFrame method is called in your case

BogdanovKirill commented 4 years ago

Hello,

Could you check 1.3.3 version of nuget ? Same issue?

SandipBR commented 4 years ago

Hi Kirill Thanks a lot for this amazing project. i admire the amount of work you have done for it.

The same issue of above continues with me. I have multiple rtsp cameras of different brands and they all work fine with VLC and ffmpeg. I tried with 3 different brands and many different resolutions and all the time same timeout exception comes. I tried the SimpleRtspPlayer project. These cameras need tcp for sure and are having h264 stream. Can you guide me please how to fix this error.

Thanks a lot

SandipBR commented 4 years ago

Got my way around. Changed the protocol to TCP and worked perfect. Is there a way to make it for WinForms ? The video quality becomes really bad in wpf. I tried in one ffmpeg player in winforms and quality was very good.

Thanks

present1001 commented 3 years ago

@SandipBR I found the WinForm project based on RtspClientSharp. Please refer to below repository. https://github.com/arthurjr07/simpleRtspPlayerWinforms