Closed athibault42 closed 4 years ago
Hello !
Thank you very much for report. Please could you make some changes and test? You need to replace GenerateFrame method in MJPEGVideoPayloadParser: https://gist.github.com/BogdanovKirill/8fb7d7b4f6fd858ffe67d6f0b03c0082
Thanks for the quick response. Removing the lines
if (_previousTimeOffset != timeOffset && _frameStream.Position != 0)
_frameStream.Position = 0;
and changing GenerateFrame to your updated version did the trick, I'm now getting images in both my code and SimpleRtspPlayer.
What if these lines will stay?
if (_previousTimeOffset != timeOffset && _frameStream.Position != 0) _frameStream.Position = 0;
With these lines in the code, FrameReceived is never raised, so I get a Receive Timeout exception. These lines reset Position to 0 just before the frame is due to be generated.
Ok, thank you. Then it should be removed.
Thank you. Do you know when a new NuGet package will be available with the fix?
Hello,
I've published 1.3.2 version. Please check and reopen if it would required.
Hi,
While trying to use the client in a project, I noticed that while H264 streams worked beautifully, I had systematic receive timeouts for MJPEG streams, both in my code and with SimpleRtspPlayer. Looked into it and turns out the FrameReceived event was never raised while trying to get a MJPEG stream. Part of the problem seems to be in MJPEGVideoPayloadParser.Parse() line 145:
This reset Position to 0 before
is called, so frames are never generated. Commenting lines 145/146 make it so frames are now generated, but then SimpleRtspPlayer still doesn't works because FFmpegVideoDecoder.TryDecode() returns null. Looks like FFmpegVideoPInvoke.DecodeFrame() return -3. Reverting changes to MJPEGVideoPayloadParser.cs, ElasticBuffer.cs and BufferOverflowException.cs like they were before the commit 3b1b21967217ec30d1ae3c62fdbd7ce409106646 make it so SimpleRtspPlayer works again with MJPEG streams.
Thank you. Great work, love the client.