Open whitphx opened 3 years ago
Could you please try using bigger and lower networkCache
? (RTSP broken video) The default is 2000 milliseconds. Try something like 100, and also try 10000. It wouldn't make sense that a shorter buffer solves issues, but curiously enough some users have reported so in the past, so it's worth a try.
Using drop-on-latency=TRUE
means that incoming frames are dropped when the buffer is full. Before this, without drop-on-latency=TRUE
what happened is that the internal buffer would grow bigger and bigger, eventually consuming all of the machine's memory. This happens when the CPU is lagging behind and not able to consume data fast enough to prevent the buffer from filling. It might make sense that your issue disappears when removing drop-on-latency=TRUE
, but in that case you'll probably see your memory usage grow over time.
Maybe we should update the default buffer, so it is bigger by default. I'm open to discussing this.
Re: OpenH264, it is interesting that this problem doesn't happen with this decoder. Maybe it works much faster than libav? Although the errors further down the line in the Pipeline make me think that the issue is still there, but just shows up in a different way.
As it seems the error is around libav, I firstly investigated arount it and found the versions of
libav
are different betweenkurento/kurento-media-server-exp:bionic-gstreamer
(/usr/lib/x86_64-linux-gnu/libavformat.so.57.83.100
) andkurento/kurento-media-server:6.14.0
(/usr/lib/x86_64-linux-gnu/libavformat-ffmpeg.so.56.40.101
).
This happens because kurento/kurento-media-server:6.14.0
uses the GStreamer 1.8 fork on Ubuntu 16.04, and kurento/kurento-media-server-exp:bionic-gstreamer
should be using the system's official GStreamer build on Ubuntu 18.04, so it makes sense that libraries are different versions in these two images.
Thank you for the suggestion,
but though I tried 10, 100, and 10000 for networdCache
option, none of them worked.
What do you think about trying to use uridecodebin3
with drop-on-latency=TRUE
option?
As I have shown, with uridecodebin3
, the error didn't occur somehow. It seems it worked correctly on decoding.
Then, it may be successful even with drop-on-latency=TRUE
.
I tried it and it seemed to work. I will create a PR as a next starting point for discussion.
EDIT: The PR introducing uridecodebin3
fixes the problem and properly configure rtspsrc
inside it.
Related:
Prerequisites
Issue description
As I posted to the mailing list, videos streamed via PlayerEndpoint consuming RTSP have visual problems with the new version of Kurento (bionic-gstreamer). Please see below (note that they have slight delays at starting).
KMS pipeline is a simple one like
PlayerEndpoint (uri=rtsp://....)
->WebRtcEndpoint
. Please see the JS client code that controls KMS pipelines.During this problem, KMS7 outputs error logs like below:
However, KMS6 also outputs similar logs like below though it does not have visual problems:
I'm using docker and KMS7 is running inside
kurento/kurento-media-server-exp:bionic-gstreamer
with little modifications and KMS6 iskurento/kurento-media-server:6.14.0
(details below).(These logs looks same to the one in #492 )
The camera I'm using is SNC-CX600W from SONY. I also found JVC VN-H237B makes a similar problem.
Context
I simply tried to play videos from RTSP streams via KMS7, which had been successful with KMS6.
How to reproduce?
docker-compose.yml
kurento/kurento-media-server-exp:bionic-gstreamer
but the newestentrypoint.sh
is added.KMS_EXTERNAL_ADDRESS
is set to the local IP address of the server.bionic-gstreamer
branch ofkms-omni-build
can reproduce the bug in the same environment. To reproduce it, I simply addvolumes
directive to thedocker-compose.yml
above to mount thekms-omni-build
directory to the docker environment.yarn start
infrontend
directory of the repo.A big problem here is that I cannot share the RTSP stream to reproduce the bug, while I can say that I reproduced the bug with SONY SNC-CX600W and JVC VN-H237B. I hope you also reproduce this bug with your environment...
Expected & current behavior
See the images above that describes the expected appearance by KMS6 and the current behavior of KMS7.
(Optional) Possible solution
I found the following workarounds.
Removing
libavformat
As it seems the error is around libav, I firstly investigated arount it and found the versions of
libav
are different betweenkurento/kurento-media-server-exp:bionic-gstreamer
(/usr/lib/x86_64-linux-gnu/libavformat.so.57.83.100
) andkurento/kurento-media-server:6.14.0
(/usr/lib/x86_64-linux-gnu/libavformat-ffmpeg.so.56.40.101
). Then I think the fundamental problem is in it.When I simply removed
libavformat
(apt remove libavformat57
) and built KMS based onkms-omni-build
,PlayerEndpoint
used OpenH264 instead and the visual problem disappeared though different errors below came out.Of course, removing
libav
is not an optimal solution, but it may be a good entrypoint to investigate the bug.Removing
drop-on-latency=TRUE
fromrtspsrc
When I removed
drop-on-latency=TRUE
fromrtspsrc
insidePlayerEndpoint
by commenting out this line, the visual problem disappeared though the error logs are still there. It was same to the case of KMS6.However, I don't know it was a right fix because the option has been introduced on purpose by https://github.com/Kurento/kms-elements/pull/11/files
Switching
uridecodebin
touridecodebin3
When I changed
uridecodebin
insidePlayerEndpoint
touridecodebin3
by fixing this line, the visual problem disappeared and the error logs are also no longer there.It looks like a complete solution, but I still don't know it is because
uridecodebin3
does not emitelement-added
signal therefore setting options tortspsrc
inside it is skipped.INFO about Kurento Media Server
INFO about your Application Server
INFO about end-user clients
INFO about your environment
In my env,
KMS_EXTERNAL_ADDRESS
option is used because the server is in the same LAN without STUN servers. See "How to reproduce?" section above for the details.Run these commands